diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1fda422fc6a3dcec07590321bfa480d6a289021c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.d.ts @@ -0,0 +1,11 @@ +export type Options = [ + { + ignoreParameters?: boolean; + ignoreProperties?: boolean; + } +]; +export type MessageIds = 'noInferrableType'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noInferrableType", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js new file mode 100644 index 0000000000000000000000000000000000000000..622ac2db36a013bc19a961e19bc65e846c626460 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-inferrable-types.js @@ -0,0 +1,182 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-inferrable-types', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean', + recommended: 'stylistic', + }, + fixable: 'code', + messages: { + noInferrableType: 'Type {{type}} trivially inferred from a {{type}} literal, remove type annotation.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoreParameters: { + type: 'boolean', + description: 'Whether to ignore function parameters.', + }, + ignoreProperties: { + type: 'boolean', + description: 'Whether to ignore class properties.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoreParameters: false, + ignoreProperties: false, + }, + ], + create(context, [{ ignoreParameters, ignoreProperties }]) { + function isFunctionCall(init, callName) { + const node = (0, util_1.skipChainExpression)(init); + return (node.type === utils_1.AST_NODE_TYPES.CallExpression && + node.callee.type === utils_1.AST_NODE_TYPES.Identifier && + node.callee.name === callName); + } + function isLiteral(init, typeName) { + return (init.type === utils_1.AST_NODE_TYPES.Literal && typeof init.value === typeName); + } + function isIdentifier(init, ...names) { + return (init.type === utils_1.AST_NODE_TYPES.Identifier && names.includes(init.name)); + } + function hasUnaryPrefix(init, ...operators) { + return (init.type === utils_1.AST_NODE_TYPES.UnaryExpression && + operators.includes(init.operator)); + } + const keywordMap = { + [utils_1.AST_NODE_TYPES.TSBigIntKeyword]: 'bigint', + [utils_1.AST_NODE_TYPES.TSBooleanKeyword]: 'boolean', + [utils_1.AST_NODE_TYPES.TSNullKeyword]: 'null', + [utils_1.AST_NODE_TYPES.TSNumberKeyword]: 'number', + [utils_1.AST_NODE_TYPES.TSStringKeyword]: 'string', + [utils_1.AST_NODE_TYPES.TSSymbolKeyword]: 'symbol', + [utils_1.AST_NODE_TYPES.TSUndefinedKeyword]: 'undefined', + }; + /** + * Returns whether a node has an inferrable value or not + */ + function isInferrable(annotation, init) { + switch (annotation.type) { + case utils_1.AST_NODE_TYPES.TSBigIntKeyword: { + // note that bigint cannot have + prefixed to it + const unwrappedInit = hasUnaryPrefix(init, '-') + ? init.argument + : init; + return (isFunctionCall(unwrappedInit, 'BigInt') || + unwrappedInit.type === utils_1.AST_NODE_TYPES.Literal); + } + case utils_1.AST_NODE_TYPES.TSBooleanKeyword: + return (hasUnaryPrefix(init, '!') || + isFunctionCall(init, 'Boolean') || + isLiteral(init, 'boolean')); + case utils_1.AST_NODE_TYPES.TSNumberKeyword: { + const unwrappedInit = hasUnaryPrefix(init, '+', '-') + ? init.argument + : init; + return (isIdentifier(unwrappedInit, 'Infinity', 'NaN') || + isFunctionCall(unwrappedInit, 'Number') || + isLiteral(unwrappedInit, 'number')); + } + case utils_1.AST_NODE_TYPES.TSNullKeyword: + return init.type === utils_1.AST_NODE_TYPES.Literal && init.value == null; + case utils_1.AST_NODE_TYPES.TSStringKeyword: + return (isFunctionCall(init, 'String') || + isLiteral(init, 'string') || + init.type === utils_1.AST_NODE_TYPES.TemplateLiteral); + case utils_1.AST_NODE_TYPES.TSSymbolKeyword: + return isFunctionCall(init, 'Symbol'); + case utils_1.AST_NODE_TYPES.TSTypeReference: { + if (annotation.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + annotation.typeName.name === 'RegExp') { + const isRegExpLiteral = init.type === utils_1.AST_NODE_TYPES.Literal && + init.value instanceof RegExp; + const isRegExpNewCall = init.type === utils_1.AST_NODE_TYPES.NewExpression && + init.callee.type === utils_1.AST_NODE_TYPES.Identifier && + init.callee.name === 'RegExp'; + const isRegExpCall = isFunctionCall(init, 'RegExp'); + return isRegExpLiteral || isRegExpCall || isRegExpNewCall; + } + return false; + } + case utils_1.AST_NODE_TYPES.TSUndefinedKeyword: + return (hasUnaryPrefix(init, 'void') || isIdentifier(init, 'undefined')); + } + return false; + } + /** + * Reports an inferrable type declaration, if any + */ + function reportInferrableType(node, typeNode, initNode) { + if (!typeNode || !initNode) { + return; + } + if (!isInferrable(typeNode.typeAnnotation, initNode)) { + return; + } + const type = typeNode.typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference + ? // TODO - if we add more references + 'RegExp' + : keywordMap[typeNode.typeAnnotation.type]; + context.report({ + node, + messageId: 'noInferrableType', + data: { + type, + }, + *fix(fixer) { + if ((node.type === utils_1.AST_NODE_TYPES.AssignmentPattern && + node.left.optional) || + (node.type === utils_1.AST_NODE_TYPES.PropertyDefinition && node.definite)) { + yield fixer.remove((0, util_1.nullThrows)(context.sourceCode.getTokenBefore(typeNode), util_1.NullThrowsReasons.MissingToken('token before', 'type node'))); + } + yield fixer.remove(typeNode); + }, + }); + } + function inferrableVariableVisitor(node) { + reportInferrableType(node, node.id.typeAnnotation, node.init); + } + function inferrableParameterVisitor(node) { + if (ignoreParameters) { + return; + } + node.params.forEach(param => { + if (param.type === utils_1.AST_NODE_TYPES.TSParameterProperty) { + param = param.parameter; + } + if (param.type === utils_1.AST_NODE_TYPES.AssignmentPattern) { + reportInferrableType(param, param.left.typeAnnotation, param.right); + } + }); + } + function inferrablePropertyVisitor(node) { + // We ignore `readonly` because of Microsoft/TypeScript#14416 + // Essentially a readonly property without a type + // will result in its value being the type, leading to + // compile errors if the type is stripped. + if (ignoreProperties || node.readonly || node.optional) { + return; + } + reportInferrableType(node, node.typeAnnotation, node.value); + } + return { + AccessorProperty: inferrablePropertyVisitor, + ArrowFunctionExpression: inferrableParameterVisitor, + FunctionDeclaration: inferrableParameterVisitor, + FunctionExpression: inferrableParameterVisitor, + PropertyDefinition: inferrablePropertyVisitor, + VariableDeclarator: inferrableVariableVisitor, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4defcf8cad975a38dd2ac1d83eeaa746142f8ee3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.d.ts @@ -0,0 +1,15 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util'; +declare const baseRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unexpectedThis", [({ + capIsConstructor?: boolean; +} | undefined)?], unknown, { + ThisExpression(node: TSESTree.ThisExpression): void; +}>; +export type Options = InferOptionsTypeFromRule; +export type MessageIds = InferMessageIdsTypeFromRule; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unexpectedThis", [({ + capIsConstructor?: boolean; +} | undefined)?], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js new file mode 100644 index 0000000000000000000000000000000000000000..a3d80e7b0871cadea28f121ad7388d0181137df0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-this.js @@ -0,0 +1,75 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-invalid-this'); +const defaultOptions = [{ capIsConstructor: true }]; +exports.default = (0, util_1.createRule)({ + name: 'no-invalid-this', + meta: { + type: 'suggestion', + defaultOptions, + docs: { + description: 'Disallow `this` keywords outside of classes or class-like objects', + extendsBaseRule: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: baseRule.meta.schema, + }, + defaultOptions, + create(context) { + const rules = baseRule.create(context); + /** + * Since function definitions can be nested we use a stack storing if "this" is valid in the current context. + * + * Example: + * + * function a(this: number) { // valid "this" + * function b() { + * console.log(this); // invalid "this" + * } + * } + * + * When parsing the function declaration of "a" the stack will be: [true] + * When parsing the function declaration of "b" the stack will be: [true, false] + */ + const thisIsValidStack = []; + return { + ...rules, + AccessorProperty() { + thisIsValidStack.push(true); + }, + 'AccessorProperty:exit'() { + thisIsValidStack.pop(); + }, + FunctionDeclaration(node) { + thisIsValidStack.push(node.params.some(param => param.type === utils_1.AST_NODE_TYPES.Identifier && param.name === 'this')); + }, + 'FunctionDeclaration:exit'() { + thisIsValidStack.pop(); + }, + FunctionExpression(node) { + thisIsValidStack.push(node.params.some(param => param.type === utils_1.AST_NODE_TYPES.Identifier && param.name === 'this')); + }, + 'FunctionExpression:exit'() { + thisIsValidStack.pop(); + }, + PropertyDefinition() { + thisIsValidStack.push(true); + }, + 'PropertyDefinition:exit'() { + thisIsValidStack.pop(); + }, + ThisExpression(node) { + const thisIsValidHere = thisIsValidStack[thisIsValidStack.length - 1]; + if (thisIsValidHere) { + return; + } + // baseRule's work + rules.ThisExpression(node); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..71aba5a17b5f980fbd72b2dbf5da152d92a3677f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.d.ts @@ -0,0 +1,9 @@ +export interface Options { + allowAsThisParameter?: boolean; + allowInGenericTypeArguments?: boolean | [string, ...string[]]; +} +export type MessageIds = 'invalidVoidForGeneric' | 'invalidVoidNotReturn' | 'invalidVoidNotReturnOrGeneric' | 'invalidVoidNotReturnOrThisParam' | 'invalidVoidNotReturnOrThisParamOrGeneric' | 'invalidVoidUnionConstituent'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js new file mode 100644 index 0000000000000000000000000000000000000000..ba54c514a755e660c9ee653f057119181d28440b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-invalid-void-type.js @@ -0,0 +1,210 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-invalid-void-type', + meta: { + type: 'problem', + docs: { + description: 'Disallow `void` type outside of generic or return types', + recommended: 'strict', + }, + messages: { + invalidVoidForGeneric: '{{ generic }} may not have void as a type argument.', + invalidVoidNotReturn: 'void is only valid as a return type.', + invalidVoidNotReturnOrGeneric: 'void is only valid as a return type or generic type argument.', + invalidVoidNotReturnOrThisParam: 'void is only valid as return type or type of `this` parameter.', + invalidVoidNotReturnOrThisParamOrGeneric: 'void is only valid as a return type or generic type argument or the type of a `this` parameter.', + invalidVoidUnionConstituent: 'void is not valid as a constituent in a union type', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowAsThisParameter: { + type: 'boolean', + description: 'Whether a `this` parameter of a function may be `void`.', + }, + allowInGenericTypeArguments: { + description: 'Whether `void` can be used as a valid value for generic type parameters.', + oneOf: [ + { + type: 'boolean', + description: 'Whether `void` can be used as a valid value for all generic type parameters.', + }, + { + type: 'array', + description: 'Allowlist of types that may accept `void` as a generic type parameter.', + items: { type: 'string' }, + minItems: 1, + }, + ], + }, + }, + }, + ], + }, + defaultOptions: [ + { allowAsThisParameter: false, allowInGenericTypeArguments: true }, + ], + create(context, [{ allowAsThisParameter, allowInGenericTypeArguments }]) { + const validParents = [ + utils_1.AST_NODE_TYPES.TSTypeAnnotation, // + ]; + const invalidGrandParents = [ + utils_1.AST_NODE_TYPES.TSPropertySignature, + utils_1.AST_NODE_TYPES.CallExpression, + utils_1.AST_NODE_TYPES.PropertyDefinition, + utils_1.AST_NODE_TYPES.AccessorProperty, + utils_1.AST_NODE_TYPES.Identifier, + ]; + const validUnionMembers = [ + utils_1.AST_NODE_TYPES.TSVoidKeyword, + utils_1.AST_NODE_TYPES.TSNeverKeyword, + ]; + if (allowInGenericTypeArguments === true) { + validParents.push(utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation); + } + /** + * @brief check if the given void keyword is used as a valid generic type + * + * reports if the type parametrized by void is not in the allowlist, or + * allowInGenericTypeArguments is false. + * no-op if the given void keyword is not used as generic type + */ + function checkGenericTypeArgument(node) { + // only matches T<..., void, ...> + // extra check for precaution + /* istanbul ignore next */ + if (node.parent.type !== utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation || + node.parent.parent.type !== utils_1.AST_NODE_TYPES.TSTypeReference) { + return; + } + // check allowlist + if (Array.isArray(allowInGenericTypeArguments)) { + const fullyQualifiedName = context.sourceCode + .getText(node.parent.parent.typeName) + .replaceAll(' ', ''); + if (!allowInGenericTypeArguments + .map(s => s.replaceAll(' ', '')) + .includes(fullyQualifiedName)) { + context.report({ + node, + messageId: 'invalidVoidForGeneric', + data: { generic: fullyQualifiedName }, + }); + } + return; + } + if (!allowInGenericTypeArguments) { + context.report({ + node, + messageId: allowAsThisParameter + ? 'invalidVoidNotReturnOrThisParam' + : 'invalidVoidNotReturn', + }); + } + } + /** + * @brief checks if the generic type parameter defaults to void + */ + function checkDefaultVoid(node, parentNode) { + if (parentNode.default !== node) { + context.report({ + node, + messageId: getNotReturnOrGenericMessageId(node), + }); + } + } + /** + * @brief checks that a union containing void is valid + * @return true if every member of the union is specified as a valid type in + * validUnionMembers, or is a valid generic type parametrized by void + */ + function isValidUnionType(node) { + return node.types.every(member => validUnionMembers.includes(member.type) || + // allows any T<..., void, ...> here, checked by checkGenericTypeArgument + (member.type === utils_1.AST_NODE_TYPES.TSTypeReference && + member.typeArguments?.type === + utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation && + member.typeArguments.params + .map(param => param.type) + .includes(utils_1.AST_NODE_TYPES.TSVoidKeyword))); + } + return { + TSVoidKeyword(node) { + // checks T<..., void, ...> against specification of allowInGenericArguments option + if (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation && + node.parent.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference) { + checkGenericTypeArgument(node); + return; + } + // allow if allowInGenericTypeArguments is specified, and report if the generic type parameter extends void + if (allowInGenericTypeArguments && + node.parent.type === utils_1.AST_NODE_TYPES.TSTypeParameter && + node.parent.default?.type === utils_1.AST_NODE_TYPES.TSVoidKeyword) { + checkDefaultVoid(node, node.parent); + return; + } + // union w/ void must contain types from validUnionMembers, or a valid generic void type + if (node.parent.type === utils_1.AST_NODE_TYPES.TSUnionType && + isValidUnionType(node.parent)) { + return; + } + // using `void` as part of the return type of function overloading implementation + if (node.parent.type === utils_1.AST_NODE_TYPES.TSUnionType) { + const declaringFunction = getParentFunctionDeclarationNode(node.parent); + if (declaringFunction && + (0, util_1.hasOverloadSignatures)(declaringFunction, context)) { + return; + } + } + // this parameter is ok to be void. + if (allowAsThisParameter && + node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAnnotation && + node.parent.parent.type === utils_1.AST_NODE_TYPES.Identifier && + node.parent.parent.name === 'this') { + return; + } + // default cases + if (validParents.includes(node.parent.type) && + // https://github.com/typescript-eslint/typescript-eslint/issues/6225 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + !invalidGrandParents.includes(node.parent.parent.type)) { + return; + } + context.report({ + node, + messageId: allowInGenericTypeArguments && allowAsThisParameter + ? 'invalidVoidNotReturnOrThisParamOrGeneric' + : allowInGenericTypeArguments + ? getNotReturnOrGenericMessageId(node) + : allowAsThisParameter + ? 'invalidVoidNotReturnOrThisParam' + : 'invalidVoidNotReturn', + }); + }, + }; + }, +}); +function getNotReturnOrGenericMessageId(node) { + return node.parent.type === utils_1.AST_NODE_TYPES.TSUnionType + ? 'invalidVoidUnionConstituent' + : 'invalidVoidNotReturnOrGeneric'; +} +function getParentFunctionDeclarationNode(node) { + let current = node.parent; + while (current) { + if (current.type === utils_1.AST_NODE_TYPES.FunctionDeclaration) { + return current; + } + if (current.type === utils_1.AST_NODE_TYPES.MethodDefinition && + current.value.body != null) { + return current; + } + current = current.parent; + } + return null; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..684e2e4549c1636c82948a387c1968e54bd628d7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.d.ts @@ -0,0 +1,13 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util'; +declare const baseRule: TSESLint.RuleModule<"unsafeRefs", [], unknown, { + ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; + FunctionDeclaration(node: TSESTree.FunctionDeclaration): void; + FunctionExpression(node: TSESTree.FunctionExpression): void; +}>; +export type Options = InferOptionsTypeFromRule; +export type MessageIds = InferMessageIdsTypeFromRule; +declare const _default: TSESLint.RuleModule<"unsafeRefs", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js new file mode 100644 index 0000000000000000000000000000000000000000..29b857964afd3b61769669a820eacfcca02887c5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loop-func.js @@ -0,0 +1,187 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-loop-func'); +exports.default = (0, util_1.createRule)({ + name: 'no-loop-func', + meta: { + type: 'suggestion', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Disallow function declarations that contain unsafe references inside loop statements', + extendsBaseRule: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: [], + }, + defaultOptions: [], + create(context) { + const SKIPPED_IIFE_NODES = new Set(); + /** + * Gets the containing loop node of a specified node. + * + * We don't need to check nested functions, so this ignores those. + * `Scope.through` contains references of nested functions. + * + * @param node An AST node to get. + * @returns The containing loop node of the specified node, or `null`. + */ + function getContainingLoopNode(node) { + for (let currentNode = node; currentNode.parent; currentNode = currentNode.parent) { + const parent = currentNode.parent; + switch (parent.type) { + case utils_1.AST_NODE_TYPES.WhileStatement: + case utils_1.AST_NODE_TYPES.DoWhileStatement: + return parent; + case utils_1.AST_NODE_TYPES.ForStatement: + // `init` is outside of the loop. + if (parent.init !== currentNode) { + return parent; + } + break; + case utils_1.AST_NODE_TYPES.ForInStatement: + case utils_1.AST_NODE_TYPES.ForOfStatement: + // `right` is outside of the loop. + if (parent.right !== currentNode) { + return parent; + } + break; + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionDeclaration: + // We don't need to check nested functions. + // We need to check nested functions only in case of IIFE. + if (SKIPPED_IIFE_NODES.has(parent)) { + break; + } + return null; + default: + break; + } + } + return null; + } + /** + * Gets the containing loop node of a given node. + * If the loop was nested, this returns the most outer loop. + * @param node A node to get. This is a loop node. + * @param excludedNode A node that the result node should not include. + * @returns The most outer loop node. + */ + function getTopLoopNode(node, excludedNode) { + const border = excludedNode ? excludedNode.range[1] : 0; + let retv = node; + let containingLoopNode = node; + while (containingLoopNode && containingLoopNode.range[0] >= border) { + retv = containingLoopNode; + containingLoopNode = getContainingLoopNode(containingLoopNode); + } + return retv; + } + /** + * Checks whether a given reference which refers to an upper scope's variable is + * safe or not. + * @param loopNode A containing loop node. + * @param reference A reference to check. + * @returns `true` if the reference is safe or not. + */ + function isSafe(loopNode, reference) { + const variable = reference.resolved; + const definition = variable?.defs[0]; + const declaration = definition?.parent; + const kind = declaration?.type === utils_1.AST_NODE_TYPES.VariableDeclaration + ? declaration.kind + : ''; + // type references are all safe + // this only really matters for global types that haven't been configured + if (reference.isTypeReference) { + return true; + } + // Variables which are declared by `const` is safe. + if (kind === 'const') { + return true; + } + /* + * Variables which are declared by `let` in the loop is safe. + * It's a different instance from the next loop step's. + */ + if (kind === 'let' && + declaration && + declaration.range[0] > loopNode.range[0] && + declaration.range[1] < loopNode.range[1]) { + return true; + } + /* + * WriteReferences which exist after this border are unsafe because those + * can modify the variable. + */ + const border = getTopLoopNode(loopNode, kind === 'let' ? declaration : null).range[0]; + /** + * Checks whether a given reference is safe or not. + * The reference is every reference of the upper scope's variable we are + * looking now. + * + * It's safe if the reference matches one of the following condition. + * - is readonly. + * - doesn't exist inside a local function and after the border. + * + * @param upperRef A reference to check. + * @returns `true` if the reference is safe. + */ + function isSafeReference(upperRef) { + const id = upperRef.identifier; + return (!upperRef.isWrite() || + (variable?.scope.variableScope === upperRef.from.variableScope && + id.range[0] < border)); + } + return variable?.references.every(isSafeReference) ?? false; + } + /** + * Reports functions which match the following condition: + * - has a loop node in ancestors. + * - has any references which refers to an unsafe variable. + * + * @param node The AST node to check. + */ + function checkForLoops(node) { + const loopNode = getContainingLoopNode(node); + if (!loopNode) { + return; + } + const references = context.sourceCode.getScope(node).through; + if (!(node.async || node.generator) && isIIFE(node)) { + const isFunctionExpression = node.type === utils_1.AST_NODE_TYPES.FunctionExpression; + // Check if the function is referenced elsewhere in the code + const isFunctionReferenced = isFunctionExpression && node.id + ? references.some(r => r.identifier.name === node.id?.name) + : false; + if (!isFunctionReferenced) { + SKIPPED_IIFE_NODES.add(node); + return; + } + } + const unsafeRefs = references + .filter(r => r.resolved && !isSafe(loopNode, r)) + .map(r => r.identifier.name); + if (unsafeRefs.length > 0) { + context.report({ + node, + messageId: 'unsafeRefs', + data: { varNames: `'${unsafeRefs.join("', '")}'` }, + }); + } + } + return { + ArrowFunctionExpression: checkForLoops, + FunctionDeclaration: checkForLoops, + FunctionExpression: checkForLoops, + }; + }, +}); +function isIIFE(node) { + return (node.parent.type === utils_1.AST_NODE_TYPES.CallExpression && + node.parent.callee === node); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..68625b4aec03c368a3e82b69ebc5f58b3d7d4fbf --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.d.ts @@ -0,0 +1,9 @@ +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; +declare const baseRule: ReturnType; +export type Options = InferOptionsTypeFromRule>; +export type MessageIds = InferMessageIdsTypeFromRule>; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noLossOfPrecision", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js new file mode 100644 index 0000000000000000000000000000000000000000..0c2b6a7b94c6879a221386e0b13a787ff1b4c228 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-loss-of-precision.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-loss-of-precision'); +exports.default = (0, util_1.createRule)({ + name: 'no-loss-of-precision', + meta: { + type: 'problem', + // defaultOptions, -- base rule does not use defaultOptions + deprecated: { + deprecatedSince: '8.0.0', + replacedBy: [ + { + rule: { + name: 'no-loss-of-precision', + url: 'https://eslint.org/docs/latest/rules/no-loss-of-precision', + }, + }, + ], + url: 'https://github.com/typescript-eslint/typescript-eslint/pull/8832', + }, + docs: { + description: 'Disallow literal numbers that lose precision', + extendsBaseRule: true, + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: [], + }, + defaultOptions: [], + create(context) { + return baseRule.create(context); + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4296ba0d163057c0b4691e95b76f49116d5ca5e8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.d.ts @@ -0,0 +1,29 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util'; +declare const baseRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noMagic", [{ + detectObjects?: boolean; + enforceConst?: boolean; + ignore?: (number | string)[]; + ignoreArrayIndexes?: boolean; + ignoreEnums?: boolean; + ignoreNumericLiteralTypes?: boolean; + ignoreReadonlyClassProperties?: boolean; + ignoreTypeIndexes?: boolean; +}], unknown, { + Literal(node: TSESTree.Literal): void; +}>; +export type Options = InferOptionsTypeFromRule; +export type MessageIds = InferMessageIdsTypeFromRule; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noMagic", [{ + detectObjects?: boolean; + enforceConst?: boolean; + ignore?: (number | string)[]; + ignoreArrayIndexes?: boolean; + ignoreEnums?: boolean; + ignoreNumericLiteralTypes?: boolean; + ignoreReadonlyClassProperties?: boolean; + ignoreTypeIndexes?: boolean; +}], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js new file mode 100644 index 0000000000000000000000000000000000000000..408cdc7334b62d6c9451e6a2f23306901b99bb32 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-magic-numbers.js @@ -0,0 +1,249 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-magic-numbers'); +// Extend base schema with additional property to ignore TS numeric literal types +const schema = (0, util_1.deepMerge)( +// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- https://github.com/microsoft/TypeScript/issues/17002 +Array.isArray(baseRule.meta.schema) + ? baseRule.meta.schema[0] + : baseRule.meta.schema, { + properties: { + ignoreEnums: { + type: 'boolean', + description: 'Whether enums used in TypeScript are considered okay.', + }, + ignoreNumericLiteralTypes: { + type: 'boolean', + description: 'Whether numbers used in TypeScript numeric literal types are considered okay.', + }, + ignoreReadonlyClassProperties: { + type: 'boolean', + description: 'Whether `readonly` class properties are considered okay.', + }, + ignoreTypeIndexes: { + type: 'boolean', + description: 'Whether numbers used to index types are okay.', + }, + }, +}); +const defaultOptions = [ + { + detectObjects: false, + enforceConst: false, + ignore: [], + ignoreArrayIndexes: false, + ignoreEnums: false, + ignoreNumericLiteralTypes: false, + ignoreReadonlyClassProperties: false, + ignoreTypeIndexes: false, + }, +]; +exports.default = (0, util_1.createRule)({ + name: 'no-magic-numbers', + meta: { + type: 'suggestion', + defaultOptions, + docs: { + description: 'Disallow magic numbers', + extendsBaseRule: true, + frozen: true, + }, + messages: baseRule.meta.messages, + schema: [schema], + }, + defaultOptions, + create(context, [options]) { + const rules = baseRule.create(context); + const ignored = new Set((options.ignore ?? []).map(normalizeIgnoreValue)); + return { + Literal(node) { + // If it’s not a numeric literal we’re not interested + if (typeof node.value !== 'number' && typeof node.value !== 'bigint') { + return; + } + // This will be `true` if we’re configured to ignore this case (eg. it’s + // an enum and `ignoreEnums` is `true`). It will be `false` if we’re not + // configured to ignore this case. It will remain `undefined` if this is + // not one of our exception cases, and we’ll fall back to the base rule. + let isAllowed; + // Check if the node is ignored + if (ignored.has(normalizeLiteralValue(node, node.value))) { + isAllowed = true; + } + // Check if the node is a TypeScript enum declaration + else if (isParentTSEnumDeclaration(node)) { + isAllowed = options.ignoreEnums === true; + } + // Check TypeScript specific nodes for Numeric Literal + else if (isTSNumericLiteralType(node)) { + isAllowed = options.ignoreNumericLiteralTypes === true; + } + // Check if the node is a type index + else if (isAncestorTSIndexedAccessType(node)) { + isAllowed = options.ignoreTypeIndexes === true; + } + // Check if the node is a readonly class property + else if (isParentTSReadonlyPropertyDefinition(node)) { + isAllowed = options.ignoreReadonlyClassProperties === true; + } + // If we’ve hit a case where the ignore option is true we can return now + if (isAllowed === true) { + return; + } + // If the ignore option is *not* set we can report it now + if (isAllowed === false) { + let fullNumberNode = node; + let raw = node.raw; + if (node.parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + // the base rule only shows the operator for negative numbers + // https://github.com/eslint/eslint/blob/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d/lib/rules/no-magic-numbers.js#L126 + node.parent.operator === '-') { + fullNumberNode = node.parent; + raw = `${node.parent.operator}${node.raw}`; + } + context.report({ + node: fullNumberNode, + messageId: 'noMagic', + data: { raw }, + }); + return; + } + // Let the base rule deal with the rest + rules.Literal(node); + }, + }; + }, +}); +/** + * Convert the value to bigint if it's a string. Otherwise, return the value as-is. + * @param value The value to normalize. + * @returns The normalized value. + */ +function normalizeIgnoreValue(value) { + if (typeof value === 'string') { + return BigInt(value.slice(0, -1)); + } + return value; +} +/** + * Converts the node to its numeric value, handling prefixed numbers (-1 / +1) + * @param node the node to normalize. + * @param value the node's value. + */ +function normalizeLiteralValue(node, value) { + if (node.parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + ['-', '+'].includes(node.parent.operator) && + node.parent.operator === '-') { + return -value; + } + return value; +} +/** + * Gets the true parent of the literal, handling prefixed numbers (-1 / +1) + */ +function getLiteralParent(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + ['-', '+'].includes(node.parent.operator)) { + return node.parent.parent; + } + return node.parent; +} +/** + * Checks if the node grandparent is a Typescript type alias declaration + * @param node the node to be validated. + * @returns true if the node grandparent is a Typescript type alias declaration + * @private + */ +function isGrandparentTSTypeAliasDeclaration(node) { + return node.parent?.parent?.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration; +} +/** + * Checks if the node grandparent is a Typescript union type and its parent is a type alias declaration + * @param node the node to be validated. + * @returns true if the node grandparent is a Typescript union type and its parent is a type alias declaration + * @private + */ +function isGrandparentTSUnionType(node) { + if (node.parent?.parent?.type === utils_1.AST_NODE_TYPES.TSUnionType) { + return isGrandparentTSTypeAliasDeclaration(node.parent); + } + return false; +} +/** + * Checks if the node parent is a Typescript enum member + * @param node the node to be validated. + * @returns true if the node parent is a Typescript enum member + * @private + */ +function isParentTSEnumDeclaration(node) { + const parent = getLiteralParent(node); + return parent?.type === utils_1.AST_NODE_TYPES.TSEnumMember; +} +/** + * Checks if the node parent is a Typescript literal type + * @param node the node to be validated. + * @returns true if the node parent is a Typescript literal type + * @private + */ +function isParentTSLiteralType(node) { + return node.parent?.type === utils_1.AST_NODE_TYPES.TSLiteralType; +} +/** + * Checks if the node is a valid TypeScript numeric literal type. + * @param node the node to be validated. + * @returns true if the node is a TypeScript numeric literal type. + * @private + */ +function isTSNumericLiteralType(node) { + // For negative numbers, use the parent node + if (node.parent?.type === utils_1.AST_NODE_TYPES.UnaryExpression && + node.parent.operator === '-') { + node = node.parent; + } + // If the parent node is not a TSLiteralType, early return + if (!isParentTSLiteralType(node)) { + return false; + } + // If the grandparent is a TSTypeAliasDeclaration, ignore + if (isGrandparentTSTypeAliasDeclaration(node)) { + return true; + } + // If the grandparent is a TSUnionType and it's parent is a TSTypeAliasDeclaration, ignore + if (isGrandparentTSUnionType(node)) { + return true; + } + return false; +} +/** + * Checks if the node parent is a readonly class property + * @param node the node to be validated. + * @returns true if the node parent is a readonly class property + * @private + */ +function isParentTSReadonlyPropertyDefinition(node) { + const parent = getLiteralParent(node); + if (parent?.type === utils_1.AST_NODE_TYPES.PropertyDefinition && parent.readonly) { + return true; + } + return false; +} +/** + * Checks if the node is part of a type indexed access (eg. Foo[4]) + * @param node the node to be validated. + * @returns true if the node is part of an indexed access + * @private + */ +function isAncestorTSIndexedAccessType(node) { + // Handle unary expressions (eg. -4) + let ancestor = getLiteralParent(node); + // Go up another level while we’re part of a type union (eg. 1 | 2) or + // intersection (eg. 1 & 2) + while (ancestor?.parent?.type === utils_1.AST_NODE_TYPES.TSUnionType || + ancestor?.parent?.type === utils_1.AST_NODE_TYPES.TSIntersectionType) { + ancestor = ancestor.parent; + } + return ancestor?.parent?.type === utils_1.AST_NODE_TYPES.TSIndexedAccessType; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..88534747278271b3fa3cb6e4a27da131e7416843 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.d.ts @@ -0,0 +1,10 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type Options = [ + { + checkNever: boolean; + } +]; +declare const _default: TSESLint.RuleModule<"meaninglessVoidOperator" | "removeVoid", Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js new file mode 100644 index 0000000000000000000000000000000000000000..a0ff0c9b70c12afb4ae70242a18e403bb7af1b1b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-meaningless-void-operator.js @@ -0,0 +1,102 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-meaningless-void-operator', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow the `void` operator except when used to discard a value', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + hasSuggestions: true, + messages: { + meaninglessVoidOperator: "void operator shouldn't be used on {{type}}; it should convey that a return value is being ignored", + removeVoid: "Remove 'void'", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + checkNever: { + type: 'boolean', + description: 'Whether to suggest removing `void` when the argument has type `never`.', + }, + }, + }, + ], + }, + defaultOptions: [{ checkNever: false }], + create(context, [{ checkNever }]) { + const services = utils_1.ESLintUtils.getParserServices(context); + const checker = services.program.getTypeChecker(); + return { + 'UnaryExpression[operator="void"]'(node) { + const fix = (fixer) => { + return fixer.removeRange([ + context.sourceCode.getTokens(node)[0].range[0], + context.sourceCode.getTokens(node)[1].range[0], + ]); + }; + const argType = services.getTypeAtLocation(node.argument); + const unionParts = tsutils.unionConstituents(argType); + if (unionParts.every(part => tsutils.isTypeFlagSet(part, ts.TypeFlags.Void | ts.TypeFlags.Undefined))) { + context.report({ + node, + messageId: 'meaninglessVoidOperator', + data: { type: checker.typeToString(argType) }, + fix, + }); + } + else if (checkNever && + unionParts.every(part => tsutils.isTypeFlagSet(part, ts.TypeFlags.Void | ts.TypeFlags.Undefined | ts.TypeFlags.Never))) { + context.report({ + node, + messageId: 'meaninglessVoidOperator', + data: { type: checker.typeToString(argType) }, + suggest: [{ messageId: 'removeVoid', fix }], + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..541f8bf2680e08e1d87426d397c68ac238c5e0b2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"errorMessageClass" | "errorMessageInterface", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js new file mode 100644 index 0000000000000000000000000000000000000000..2cbc61170d8ecca28e70a1018e42dc8e720569b8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-new.js @@ -0,0 +1,81 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-misused-new', + meta: { + type: 'problem', + docs: { + description: 'Enforce valid definition of `new` and `constructor`', + recommended: 'recommended', + }, + messages: { + errorMessageClass: 'Class cannot have method named `new`.', + errorMessageInterface: 'Interfaces cannot be constructed, only classes.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + /** + * @param node type to be inspected. + * @returns name of simple type or null + */ + function getTypeReferenceName(node) { + if (node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSTypeAnnotation: + return getTypeReferenceName(node.typeAnnotation); + case utils_1.AST_NODE_TYPES.TSTypeReference: + return getTypeReferenceName(node.typeName); + case utils_1.AST_NODE_TYPES.Identifier: + return node.name; + default: + break; + } + } + return null; + } + /** + * @param parent parent node. + * @param returnType type to be compared + */ + function isMatchingParentType(parent, returnType) { + if (parent && + (parent.type === utils_1.AST_NODE_TYPES.ClassDeclaration || + parent.type === utils_1.AST_NODE_TYPES.ClassExpression || + parent.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration) && + parent.id) { + return getTypeReferenceName(returnType) === parent.id.name; + } + return false; + } + return { + "ClassBody > MethodDefinition[key.name='new']"(node) { + if (node.value.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression && + isMatchingParentType(node.parent.parent, node.value.returnType)) { + context.report({ + node, + messageId: 'errorMessageClass', + }); + } + }, + 'TSInterfaceBody > TSConstructSignatureDeclaration'(node) { + if (isMatchingParentType(node.parent.parent, node.returnType)) { + // constructor + context.report({ + node, + messageId: 'errorMessageInterface', + }); + } + }, + "TSMethodSignature[key.name='constructor']"(node) { + context.report({ + node, + messageId: 'errorMessageInterface', + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..537b7aeeab56169d503e1ca30542d7fc2a5ff7c4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.d.ts @@ -0,0 +1,21 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type Options = [ + { + checksConditionals?: boolean; + checksSpreads?: boolean; + checksVoidReturn?: boolean | ChecksVoidReturnOptions; + } +]; +export interface ChecksVoidReturnOptions { + arguments?: boolean; + attributes?: boolean; + inheritedMethods?: boolean; + properties?: boolean; + returns?: boolean; + variables?: boolean; +} +export type MessageId = 'conditional' | 'predicate' | 'spread' | 'voidReturnArgument' | 'voidReturnAttribute' | 'voidReturnInheritedMethod' | 'voidReturnProperty' | 'voidReturnReturnValue' | 'voidReturnVariable'; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js new file mode 100644 index 0000000000000000000000000000000000000000..ba6af968b8feb60847a1d2cf4132df2ca9115f76 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js @@ -0,0 +1,765 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const promiseUtils_1 = require("../util/promiseUtils"); +function parseChecksVoidReturn(checksVoidReturn) { + switch (checksVoidReturn) { + case false: + return false; + case true: + case undefined: + return { + arguments: true, + attributes: true, + inheritedMethods: true, + properties: true, + returns: true, + variables: true, + }; + default: + return { + arguments: checksVoidReturn.arguments ?? true, + attributes: checksVoidReturn.attributes ?? true, + inheritedMethods: checksVoidReturn.inheritedMethods ?? true, + properties: checksVoidReturn.properties ?? true, + returns: checksVoidReturn.returns ?? true, + variables: checksVoidReturn.variables ?? true, + }; + } +} +exports.default = (0, util_1.createRule)({ + name: 'no-misused-promises', + meta: { + type: 'problem', + docs: { + description: 'Disallow Promises in places not designed to handle them', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + conditional: 'Expected non-Promise value in a boolean conditional.', + predicate: 'Expected a non-Promise value to be returned.', + spread: 'Expected a non-Promise value to be spread in an object.', + voidReturnArgument: 'Promise returned in function argument where a void return was expected.', + voidReturnAttribute: 'Promise-returning function provided to attribute where a void return was expected.', + voidReturnInheritedMethod: "Promise-returning method provided where a void return was expected by extended/implemented type '{{ heritageTypeName }}'.", + voidReturnProperty: 'Promise-returning function provided to property where a void return was expected.', + voidReturnReturnValue: 'Promise-returning function provided to return value where a void return was expected.', + voidReturnVariable: 'Promise-returning function provided to variable where a void return was expected.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + checksConditionals: { + type: 'boolean', + description: 'Whether to warn when a Promise is provided to conditional statements.', + }, + checksSpreads: { + type: 'boolean', + description: 'Whether to warn when `...` spreading a `Promise`.', + }, + checksVoidReturn: { + description: 'Whether to warn when a Promise is returned from a function typed as returning `void`.', + oneOf: [ + { + type: 'boolean', + description: 'Whether to disable checking all asynchronous functions.', + }, + { + type: 'object', + additionalProperties: false, + description: 'Which forms of functions may have checking disabled.', + properties: { + arguments: { + type: 'boolean', + description: 'Disables checking an asynchronous function passed as argument where the parameter type expects a function that returns `void`.', + }, + attributes: { + type: 'boolean', + description: 'Disables checking an asynchronous function passed as a JSX attribute expected to be a function that returns `void`.', + }, + inheritedMethods: { + type: 'boolean', + description: 'Disables checking an asynchronous method in a type that extends or implements another type expecting that method to return `void`.', + }, + properties: { + type: 'boolean', + description: 'Disables checking an asynchronous function passed as an object property expected to be a function that returns `void`.', + }, + returns: { + type: 'boolean', + description: 'Disables checking an asynchronous function returned in a function whose return type is a function that returns `void`.', + }, + variables: { + type: 'boolean', + description: 'Disables checking an asynchronous function used as a variable whose return type is a function that returns `void`.', + }, + }, + }, + ], + }, + }, + }, + ], + }, + defaultOptions: [ + { + checksConditionals: true, + checksSpreads: true, + checksVoidReturn: true, + }, + ], + create(context, [{ checksConditionals, checksSpreads, checksVoidReturn }]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const checkedNodes = new Set(); + const conditionalChecks = { + 'CallExpression > MemberExpression': checkArrayPredicates, + ConditionalExpression: checkTestConditional, + DoWhileStatement: checkTestConditional, + ForStatement: checkTestConditional, + IfStatement: checkTestConditional, + LogicalExpression: checkConditional, + 'UnaryExpression[operator="!"]'(node) { + checkConditional(node.argument, true); + }, + WhileStatement: checkTestConditional, + }; + checksVoidReturn = parseChecksVoidReturn(checksVoidReturn); + const voidReturnChecks = checksVoidReturn + ? { + ...(checksVoidReturn.arguments && { + CallExpression: checkArguments, + NewExpression: checkArguments, + }), + ...(checksVoidReturn.attributes && { + JSXAttribute: checkJSXAttribute, + }), + ...(checksVoidReturn.inheritedMethods && { + ClassDeclaration: checkClassLikeOrInterfaceNode, + ClassExpression: checkClassLikeOrInterfaceNode, + TSInterfaceDeclaration: checkClassLikeOrInterfaceNode, + }), + ...(checksVoidReturn.properties && { + Property: checkProperty, + }), + ...(checksVoidReturn.returns && { + ReturnStatement: checkReturnStatement, + }), + ...(checksVoidReturn.variables && { + AssignmentExpression: checkAssignment, + VariableDeclarator: checkVariableDeclaration, + }), + } + : {}; + const spreadChecks = { + SpreadElement: checkSpread, + }; + /** + * A syntactic check to see if an annotated type is maybe a function type. + * This is a perf optimization to help avoid requesting types where possible + */ + function isPossiblyFunctionType(node) { + switch (node.typeAnnotation.type) { + case utils_1.AST_NODE_TYPES.TSConditionalType: + case utils_1.AST_NODE_TYPES.TSConstructorType: + case utils_1.AST_NODE_TYPES.TSFunctionType: + case utils_1.AST_NODE_TYPES.TSImportType: + case utils_1.AST_NODE_TYPES.TSIndexedAccessType: + case utils_1.AST_NODE_TYPES.TSInferType: + case utils_1.AST_NODE_TYPES.TSIntersectionType: + case utils_1.AST_NODE_TYPES.TSQualifiedName: + case utils_1.AST_NODE_TYPES.TSThisType: + case utils_1.AST_NODE_TYPES.TSTypeOperator: + case utils_1.AST_NODE_TYPES.TSTypeQuery: + case utils_1.AST_NODE_TYPES.TSTypeReference: + case utils_1.AST_NODE_TYPES.TSUnionType: + return true; + case utils_1.AST_NODE_TYPES.TSTypeLiteral: + return node.typeAnnotation.members.some(member => member.type === utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration || + member.type === utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration); + case utils_1.AST_NODE_TYPES.TSAbstractKeyword: + case utils_1.AST_NODE_TYPES.TSAnyKeyword: + case utils_1.AST_NODE_TYPES.TSArrayType: + case utils_1.AST_NODE_TYPES.TSAsyncKeyword: + case utils_1.AST_NODE_TYPES.TSBigIntKeyword: + case utils_1.AST_NODE_TYPES.TSBooleanKeyword: + case utils_1.AST_NODE_TYPES.TSDeclareKeyword: + case utils_1.AST_NODE_TYPES.TSExportKeyword: + case utils_1.AST_NODE_TYPES.TSIntrinsicKeyword: + case utils_1.AST_NODE_TYPES.TSLiteralType: + case utils_1.AST_NODE_TYPES.TSMappedType: + case utils_1.AST_NODE_TYPES.TSNamedTupleMember: + case utils_1.AST_NODE_TYPES.TSNeverKeyword: + case utils_1.AST_NODE_TYPES.TSNullKeyword: + case utils_1.AST_NODE_TYPES.TSNumberKeyword: + case utils_1.AST_NODE_TYPES.TSObjectKeyword: + case utils_1.AST_NODE_TYPES.TSOptionalType: + case utils_1.AST_NODE_TYPES.TSPrivateKeyword: + case utils_1.AST_NODE_TYPES.TSProtectedKeyword: + case utils_1.AST_NODE_TYPES.TSPublicKeyword: + case utils_1.AST_NODE_TYPES.TSReadonlyKeyword: + case utils_1.AST_NODE_TYPES.TSRestType: + case utils_1.AST_NODE_TYPES.TSStaticKeyword: + case utils_1.AST_NODE_TYPES.TSStringKeyword: + case utils_1.AST_NODE_TYPES.TSSymbolKeyword: + case utils_1.AST_NODE_TYPES.TSTemplateLiteralType: + case utils_1.AST_NODE_TYPES.TSTupleType: + case utils_1.AST_NODE_TYPES.TSTypePredicate: + case utils_1.AST_NODE_TYPES.TSUndefinedKeyword: + case utils_1.AST_NODE_TYPES.TSUnknownKeyword: + case utils_1.AST_NODE_TYPES.TSVoidKeyword: + return false; + } + } + function checkTestConditional(node) { + if (node.test) { + checkConditional(node.test, true); + } + } + /** + * This function analyzes the type of a node and checks if it is a Promise in a boolean conditional. + * It uses recursion when checking nested logical operators. + * @param node The AST node to check. + * @param isTestExpr Whether the node is a descendant of a test expression. + */ + function checkConditional(node, isTestExpr = false) { + // prevent checking the same node multiple times + if (checkedNodes.has(node)) { + return; + } + checkedNodes.add(node); + if (node.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + // ignore the left operand for nullish coalescing expressions not in a context of a test expression + if (node.operator !== '??' || isTestExpr) { + checkConditional(node.left, isTestExpr); + } + // we ignore the right operand when not in a context of a test expression + if (isTestExpr) { + checkConditional(node.right, isTestExpr); + } + return; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (isAlwaysThenable(checker, tsNode)) { + context.report({ + node, + messageId: 'conditional', + }); + } + } + function checkArrayPredicates(node) { + const parent = node.parent; + if (parent.type === utils_1.AST_NODE_TYPES.CallExpression) { + const callback = parent.arguments.at(0); + if (callback && + (0, util_1.isArrayMethodCallWithPredicate)(context, services, parent)) { + const type = services.esTreeNodeToTSNodeMap.get(callback); + if (returnsThenable(checker, type)) { + context.report({ + node: callback, + messageId: 'predicate', + }); + } + } + } + } + function checkArguments(node) { + if (node.type === utils_1.AST_NODE_TYPES.CallExpression && + isPromiseFinallyMethod(node)) { + return; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const voidArgs = voidFunctionArguments(checker, tsNode); + if (voidArgs.size === 0) { + return; + } + for (const [index, argument] of node.arguments.entries()) { + if (!voidArgs.has(index)) { + continue; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(argument); + if (returnsThenable(checker, tsNode)) { + context.report({ + node: argument, + messageId: 'voidReturnArgument', + }); + } + } + } + function checkAssignment(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const varType = services.getTypeAtLocation(node.left); + if (!isVoidReturningFunctionType(checker, tsNode.left, varType)) { + return; + } + if (returnsThenable(checker, tsNode.right)) { + context.report({ + node: node.right, + messageId: 'voidReturnVariable', + }); + } + } + function checkVariableDeclaration(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (tsNode.initializer == null || + node.init == null || + node.id.typeAnnotation == null) { + return; + } + // syntactically ignore some known-good cases to avoid touching type info + if (!isPossiblyFunctionType(node.id.typeAnnotation)) { + return; + } + const varType = services.getTypeAtLocation(node.id); + if (!isVoidReturningFunctionType(checker, tsNode.initializer, varType)) { + return; + } + if (returnsThenable(checker, tsNode.initializer)) { + context.report({ + node: node.init, + messageId: 'voidReturnVariable', + }); + } + } + function checkProperty(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (ts.isPropertyAssignment(tsNode)) { + const contextualType = checker.getContextualType(tsNode.initializer); + if (contextualType != null && + isVoidReturningFunctionType(checker, tsNode.initializer, contextualType) && + returnsThenable(checker, tsNode.initializer)) { + if ((0, util_1.isFunction)(node.value)) { + const functionNode = node.value; + if (functionNode.returnType) { + context.report({ + node: functionNode.returnType.typeAnnotation, + messageId: 'voidReturnProperty', + }); + } + else { + context.report({ + loc: (0, util_1.getFunctionHeadLoc)(functionNode, context.sourceCode), + messageId: 'voidReturnProperty', + }); + } + } + else { + context.report({ + node: node.value, + messageId: 'voidReturnProperty', + }); + } + } + } + else if (ts.isShorthandPropertyAssignment(tsNode)) { + const contextualType = checker.getContextualType(tsNode.name); + if (contextualType != null && + isVoidReturningFunctionType(checker, tsNode.name, contextualType) && + returnsThenable(checker, tsNode.name)) { + context.report({ + node: node.value, + messageId: 'voidReturnProperty', + }); + } + } + else if (ts.isMethodDeclaration(tsNode)) { + if (ts.isComputedPropertyName(tsNode.name)) { + return; + } + const obj = tsNode.parent; + // Below condition isn't satisfied unless something goes wrong, + // but is needed for type checking. + // 'node' does not include class method declaration so 'obj' is + // always an object literal expression, but after converting 'node' + // to TypeScript AST, its type includes MethodDeclaration which + // does include the case of class method declaration. + if (!ts.isObjectLiteralExpression(obj)) { + return; + } + if (!returnsThenable(checker, tsNode)) { + return; + } + const objType = checker.getContextualType(obj); + if (objType == null) { + return; + } + const propertySymbol = tsutils + .unionConstituents(objType) + .map(t => checker.getPropertyOfType(t, tsNode.name.getText())) + .find(p => p); + if (propertySymbol == null) { + return; + } + const contextualType = checker.getTypeOfSymbolAtLocation(propertySymbol, tsNode.name); + if (isVoidReturningFunctionType(checker, tsNode.name, contextualType)) { + const functionNode = node.value; + if (functionNode.returnType) { + context.report({ + node: functionNode.returnType.typeAnnotation, + messageId: 'voidReturnProperty', + }); + } + else { + context.report({ + loc: (0, util_1.getFunctionHeadLoc)(functionNode, context.sourceCode), + messageId: 'voidReturnProperty', + }); + } + } + return; + } + } + function checkReturnStatement(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (tsNode.expression == null || node.argument == null) { + return; + } + // syntactically ignore some known-good cases to avoid touching type info + const functionNode = (() => { + let current = node.parent; + while (current && !(0, util_1.isFunction)(current)) { + current = current.parent; + } + return (0, util_1.nullThrows)(current, util_1.NullThrowsReasons.MissingParent); + })(); + if (functionNode.returnType && + !isPossiblyFunctionType(functionNode.returnType)) { + return; + } + const contextualType = checker.getContextualType(tsNode.expression); + if (contextualType != null && + isVoidReturningFunctionType(checker, tsNode.expression, contextualType) && + returnsThenable(checker, tsNode.expression)) { + context.report({ + node: node.argument, + messageId: 'voidReturnReturnValue', + }); + } + } + function isPromiseFinallyMethod(node) { + const promiseFinallyCall = (0, promiseUtils_1.parseFinallyCall)(node, context); + return (promiseFinallyCall != null && + (0, util_1.isPromiseLike)(services.program, (0, util_1.getConstrainedTypeAtLocation)(services, promiseFinallyCall.object))); + } + function checkClassLikeOrInterfaceNode(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const heritageTypes = getHeritageTypes(checker, tsNode); + if (!heritageTypes?.length) { + return; + } + for (const nodeMember of tsNode.members) { + const memberName = nodeMember.name?.getText(); + if (memberName == null) { + // Call/construct/index signatures don't have names. TS allows call signatures to mismatch, + // and construct signatures can't be async. + // TODO - Once we're able to use `checker.isTypeAssignableTo` (v8), we can check an index + // signature here against its compatible index signatures in `heritageTypes` + continue; + } + if (!returnsThenable(checker, nodeMember)) { + continue; + } + const node = services.tsNodeToESTreeNodeMap.get(nodeMember); + if (isStaticMember(node)) { + continue; + } + for (const heritageType of heritageTypes) { + checkHeritageTypeForMemberReturningVoid(nodeMember, heritageType, memberName); + } + } + } + /** + * Checks `heritageType` for a member named `memberName` that returns void; reports the + * 'voidReturnInheritedMethod' message if found. + * @param nodeMember Node member that returns a Promise + * @param heritageType Heritage type to check against + * @param memberName Name of the member to check for + */ + function checkHeritageTypeForMemberReturningVoid(nodeMember, heritageType, memberName) { + const heritageMember = getMemberIfExists(heritageType, memberName); + if (heritageMember == null) { + return; + } + const memberType = checker.getTypeOfSymbolAtLocation(heritageMember, nodeMember); + if (!isVoidReturningFunctionType(checker, nodeMember, memberType)) { + return; + } + context.report({ + node: services.tsNodeToESTreeNodeMap.get(nodeMember), + messageId: 'voidReturnInheritedMethod', + data: { heritageTypeName: checker.typeToString(heritageType) }, + }); + } + function checkJSXAttribute(node) { + if (node.value?.type !== utils_1.AST_NODE_TYPES.JSXExpressionContainer) { + return; + } + const expressionContainer = services.esTreeNodeToTSNodeMap.get(node.value); + const expression = services.esTreeNodeToTSNodeMap.get(node.value.expression); + const contextualType = checker.getContextualType(expressionContainer); + if (contextualType != null && + isVoidReturningFunctionType(checker, expressionContainer, contextualType) && + returnsThenable(checker, expression)) { + context.report({ + node: node.value, + messageId: 'voidReturnAttribute', + }); + } + } + function checkSpread(node) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (isSometimesThenable(checker, tsNode.expression)) { + context.report({ + node: node.argument, + messageId: 'spread', + }); + } + } + return { + ...(checksConditionals ? conditionalChecks : {}), + ...(checksVoidReturn ? voidReturnChecks : {}), + ...(checksSpreads ? spreadChecks : {}), + }; + }, +}); +function isSometimesThenable(checker, node) { + const type = checker.getTypeAtLocation(node); + for (const subType of tsutils.unionConstituents(checker.getApparentType(type))) { + if (tsutils.isThenableType(checker, node, subType)) { + return true; + } + } + return false; +} +// Variation on the thenable check which requires all forms of the type (read: +// alternates in a union) to be thenable. Otherwise, you might be trying to +// check if something is defined or undefined and get caught because one of the +// branches is thenable. +function isAlwaysThenable(checker, node) { + const type = checker.getTypeAtLocation(node); + for (const subType of tsutils.unionConstituents(checker.getApparentType(type))) { + const thenProp = subType.getProperty('then'); + // If one of the alternates has no then property, it is not thenable in all + // cases. + if (thenProp == null) { + return false; + } + // We walk through each variation of the then property. Since we know it + // exists at this point, we just need at least one of the alternates to + // be of the right form to consider it thenable. + const thenType = checker.getTypeOfSymbolAtLocation(thenProp, node); + let hasThenableSignature = false; + for (const subType of tsutils.unionConstituents(thenType)) { + for (const signature of subType.getCallSignatures()) { + if (signature.parameters.length !== 0 && + isFunctionParam(checker, signature.parameters[0], node)) { + hasThenableSignature = true; + break; + } + } + // We only need to find one variant of the then property that has a + // function signature for it to be thenable. + if (hasThenableSignature) { + break; + } + } + // If no flavors of the then property are thenable, we don't consider the + // overall type to be thenable + if (!hasThenableSignature) { + return false; + } + } + // If all variants are considered thenable (i.e. haven't returned false), we + // consider the overall type thenable + return true; +} +function isFunctionParam(checker, param, node) { + const type = checker.getApparentType(checker.getTypeOfSymbolAtLocation(param, node)); + for (const subType of tsutils.unionConstituents(type)) { + if (subType.getCallSignatures().length !== 0) { + return true; + } + } + return false; +} +function checkThenableOrVoidArgument(checker, node, type, index, thenableReturnIndices, voidReturnIndices) { + if (isThenableReturningFunctionType(checker, node.expression, type)) { + thenableReturnIndices.add(index); + } + else if (isVoidReturningFunctionType(checker, node.expression, type) && + // If a certain argument accepts both thenable and void returns, + // a promise-returning function is valid + !thenableReturnIndices.has(index)) { + voidReturnIndices.add(index); + } + const contextualType = checker.getContextualTypeForArgumentAtIndex(node, index); + if (contextualType !== type) { + checkThenableOrVoidArgument(checker, node, contextualType, index, thenableReturnIndices, voidReturnIndices); + } +} +// Get the positions of arguments which are void functions (and not also +// thenable functions). These are the candidates for the void-return check at +// the current call site. +// If the function parameters end with a 'rest' parameter, then we consider +// the array type parameter (e.g. '...args:Array') when determining +// if trailing arguments are candidates. +function voidFunctionArguments(checker, node) { + // 'new' can be used without any arguments, as in 'let b = new Object;' + // In this case, there are no argument positions to check, so return early. + if (!node.arguments) { + return new Set(); + } + const thenableReturnIndices = new Set(); + const voidReturnIndices = new Set(); + const type = checker.getTypeAtLocation(node.expression); + // We can't use checker.getResolvedSignature because it prefers an early '() => void' over a later '() => Promise' + // See https://github.com/microsoft/TypeScript/issues/48077 + for (const subType of tsutils.unionConstituents(type)) { + // Standard function calls and `new` have two different types of signatures + const signatures = ts.isCallExpression(node) + ? subType.getCallSignatures() + : subType.getConstructSignatures(); + for (const signature of signatures) { + for (const [index, parameter] of signature.parameters.entries()) { + const decl = parameter.valueDeclaration; + let type = checker.getTypeOfSymbolAtLocation(parameter, node.expression); + // If this is a array 'rest' parameter, check all of the argument indices + // from the current argument to the end. + if (decl && (0, util_1.isRestParameterDeclaration)(decl)) { + if (checker.isArrayType(type)) { + // Unwrap 'Array' to 'MaybeVoidFunction', + // so that we'll handle it in the same way as a non-rest + // 'param: MaybeVoidFunction' + type = checker.getTypeArguments(type)[0]; + for (let i = index; i < node.arguments.length; i++) { + checkThenableOrVoidArgument(checker, node, type, i, thenableReturnIndices, voidReturnIndices); + } + } + else if (checker.isTupleType(type)) { + // Check each type in the tuple - for example, [boolean, () => void] would + // add the index of the second tuple parameter to 'voidReturnIndices' + const typeArgs = checker.getTypeArguments(type); + for (let i = index; i < node.arguments.length && i - index < typeArgs.length; i++) { + checkThenableOrVoidArgument(checker, node, typeArgs[i - index], i, thenableReturnIndices, voidReturnIndices); + } + } + } + else { + checkThenableOrVoidArgument(checker, node, type, index, thenableReturnIndices, voidReturnIndices); + } + } + } + } + for (const index of thenableReturnIndices) { + voidReturnIndices.delete(index); + } + return voidReturnIndices; +} +/** + * @returns Whether any call signature of the type has a thenable return type. + */ +function anySignatureIsThenableType(checker, node, type) { + for (const signature of type.getCallSignatures()) { + const returnType = signature.getReturnType(); + if (tsutils.isThenableType(checker, node, returnType)) { + return true; + } + } + return false; +} +/** + * @returns Whether type is a thenable-returning function. + */ +function isThenableReturningFunctionType(checker, node, type) { + for (const subType of tsutils.unionConstituents(type)) { + if (anySignatureIsThenableType(checker, node, subType)) { + return true; + } + } + return false; +} +/** + * @returns Whether type is a void-returning function. + */ +function isVoidReturningFunctionType(checker, node, type) { + let hadVoidReturn = false; + for (const subType of tsutils.unionConstituents(type)) { + for (const signature of subType.getCallSignatures()) { + const returnType = signature.getReturnType(); + // If a certain positional argument accepts both thenable and void returns, + // a promise-returning function is valid + if (tsutils.isThenableType(checker, node, returnType)) { + return false; + } + hadVoidReturn ||= tsutils.isTypeFlagSet(returnType, ts.TypeFlags.Void); + } + } + return hadVoidReturn; +} +/** + * @returns Whether expression is a function that returns a thenable. + */ +function returnsThenable(checker, node) { + const type = checker.getApparentType(checker.getTypeAtLocation(node)); + return tsutils + .unionConstituents(type) + .some(t => anySignatureIsThenableType(checker, node, t)); +} +function getHeritageTypes(checker, tsNode) { + return tsNode.heritageClauses + ?.flatMap(clause => clause.types) + .map(typeExpression => checker.getTypeAtLocation(typeExpression)); +} +/** + * @returns The member with the given name in `type`, if it exists. + */ +function getMemberIfExists(type, memberName) { + const escapedMemberName = ts.escapeLeadingUnderscores(memberName); + const symbolMemberMatch = type.getSymbol()?.members?.get(escapedMemberName); + return (symbolMemberMatch ?? tsutils.getPropertyOfType(type, escapedMemberName)); +} +function isStaticMember(node) { + return ((node.type === utils_1.AST_NODE_TYPES.MethodDefinition || + node.type === utils_1.AST_NODE_TYPES.PropertyDefinition || + node.type === utils_1.AST_NODE_TYPES.AccessorProperty) && + node.static); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6b963466bc0c04eaa01833a2b2073dd8a7475d72 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.d.ts @@ -0,0 +1,12 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +import type { TypeOrValueSpecifier } from '../util'; +type Options = [ + { + allow?: TypeOrValueSpecifier[]; + } +]; +type MessageIds = 'addAwait' | 'noArraySpreadInObject' | 'noClassDeclarationSpreadInObject' | 'noClassInstanceSpreadInObject' | 'noFunctionSpreadInObject' | 'noIterableSpreadInObject' | 'noMapSpreadInObject' | 'noPromiseSpreadInObject' | 'noStringSpread' | 'replaceMapSpreadInObject'; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.js new file mode 100644 index 0000000000000000000000000000000000000000..638418766c60682ebf047bd017777c2358441350 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-spread.js @@ -0,0 +1,260 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-misused-spread', + meta: { + type: 'problem', + docs: { + description: 'Disallow using the spread operator when it might cause unexpected behavior', + recommended: 'strict', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + addAwait: 'Add await operator.', + noArraySpreadInObject: 'Using the spread operator on an array in an object will result in a list of indices.', + noClassDeclarationSpreadInObject: 'Using the spread operator on class declarations will spread only their static properties, and will lose their class prototype.', + noClassInstanceSpreadInObject: 'Using the spread operator on class instances will lose their class prototype.', + noFunctionSpreadInObject: 'Using the spread operator on a function without additional properties can cause unexpected behavior. Did you forget to call the function?', + noIterableSpreadInObject: 'Using the spread operator on an Iterable in an object can cause unexpected behavior.', + noMapSpreadInObject: 'Using the spread operator on a Map in an object will result in an empty object. Did you mean to use `Object.fromEntries(map)` instead?', + noPromiseSpreadInObject: 'Using the spread operator on Promise in an object can cause unexpected behavior. Did you forget to await the promise?', + noStringSpread: [ + 'Using the spread operator on a string can mishandle special characters, as can `.split("")`.', + '- `...` produces Unicode code points, which will decompose complex emojis into individual emojis', + '- .split("") produces UTF-16 code units, which breaks rich characters in many languages', + 'Consider using `Intl.Segmenter` for locale-aware string decomposition.', + "Otherwise, if you don't need to preserve emojis or other non-Ascii characters, disable this lint rule on this line or configure the 'allow' rule option.", + ].join('\n'), + replaceMapSpreadInObject: 'Replace map spread in object with `Object.fromEntries()`', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + ...util_1.readonlynessOptionsSchema.properties.allow, + description: 'An array of type specifiers that are known to be safe to spread.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [], + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function checkArrayOrCallSpread(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node.argument); + if (!(0, util_1.typeMatchesSomeSpecifier)(type, options.allow, services.program) && + isString(type)) { + context.report({ + node, + messageId: 'noStringSpread', + }); + } + } + function getMapSpreadSuggestions(node, type) { + const types = tsutils.unionConstituents(type); + if (types.some(t => !isMap(services.program, t))) { + return null; + } + if (node.parent.type === utils_1.AST_NODE_TYPES.ObjectExpression && + node.parent.properties.length === 1) { + return [ + { + messageId: 'replaceMapSpreadInObject', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node.argument, + sourceCode: context.sourceCode, + wrap: code => `Object.fromEntries(${code})`, + }), + }, + ]; + } + return [ + { + messageId: 'replaceMapSpreadInObject', + fix: (0, util_1.getWrappingFixer)({ + node: node.argument, + sourceCode: context.sourceCode, + wrap: code => `Object.fromEntries(${code})`, + }), + }, + ]; + } + function getPromiseSpreadSuggestions(node) { + const isHighPrecedence = (0, util_1.isHigherPrecedenceThanAwait)(services.esTreeNodeToTSNodeMap.get(node)); + return [ + { + messageId: 'addAwait', + fix: fixer => isHighPrecedence + ? fixer.insertTextBefore(node, 'await ') + : [ + fixer.insertTextBefore(node, 'await ('), + fixer.insertTextAfter(node, ')'), + ], + }, + ]; + } + function checkObjectSpread(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node.argument); + if ((0, util_1.typeMatchesSomeSpecifier)(type, options.allow, services.program)) { + return; + } + if (isPromise(services.program, type)) { + context.report({ + node, + messageId: 'noPromiseSpreadInObject', + suggest: getPromiseSpreadSuggestions(node.argument), + }); + return; + } + if (isFunctionWithoutProps(type)) { + context.report({ + node, + messageId: 'noFunctionSpreadInObject', + }); + return; + } + if (isMap(services.program, type)) { + context.report({ + node, + messageId: 'noMapSpreadInObject', + suggest: getMapSpreadSuggestions(node, type), + }); + return; + } + if (isArray(checker, type)) { + context.report({ + node, + messageId: 'noArraySpreadInObject', + }); + return; + } + if (isIterable(type, checker) && + // Don't report when the type is string, since TS will flag it already + !isString(type)) { + context.report({ + node, + messageId: 'noIterableSpreadInObject', + }); + return; + } + if (isClassInstance(checker, type)) { + context.report({ + node, + messageId: 'noClassInstanceSpreadInObject', + }); + return; + } + if (isClassDeclaration(type)) { + context.report({ + node, + messageId: 'noClassDeclarationSpreadInObject', + }); + } + } + return { + 'ArrayExpression > SpreadElement': checkArrayOrCallSpread, + 'CallExpression > SpreadElement': checkArrayOrCallSpread, + JSXSpreadAttribute: checkObjectSpread, + 'ObjectExpression > SpreadElement': checkObjectSpread, + }; + }, +}); +function isIterable(type, checker) { + return tsutils + .typeConstituents(type) + .some(t => !!tsutils.getWellKnownSymbolPropertyOfType(t, 'iterator', checker)); +} +function isArray(checker, type) { + return isTypeRecurser(type, t => checker.isArrayType(t) || checker.isTupleType(t)); +} +function isString(type) { + return isTypeRecurser(type, t => (0, util_1.isTypeFlagSet)(t, ts.TypeFlags.StringLike)); +} +function isFunctionWithoutProps(type) { + return isTypeRecurser(type, t => t.getCallSignatures().length > 0 && t.getProperties().length === 0); +} +function isPromise(program, type) { + return isTypeRecurser(type, t => (0, util_1.isPromiseLike)(program, t)); +} +function isClassInstance(checker, type) { + return isTypeRecurser(type, t => { + // If the type itself has a construct signature, it's a class(-like) + if (t.getConstructSignatures().length) { + return false; + } + const symbol = t.getSymbol(); + // If the type's symbol has a construct signature, the type is an instance + return !!symbol + ?.getDeclarations() + ?.some(declaration => checker + .getTypeOfSymbolAtLocation(symbol, declaration) + .getConstructSignatures().length); + }); +} +function isClassDeclaration(type) { + return isTypeRecurser(type, t => { + if (tsutils.isObjectType(t) && + tsutils.isObjectFlagSet(t, ts.ObjectFlags.InstantiationExpressionType)) { + return true; + } + const kind = t.getSymbol()?.valueDeclaration?.kind; + return (kind === ts.SyntaxKind.ClassDeclaration || + kind === ts.SyntaxKind.ClassExpression); + }); +} +function isMap(program, type) { + return isTypeRecurser(type, t => (0, util_1.isBuiltinSymbolLike)(program, t, ['Map', 'ReadonlyMap', 'WeakMap'])); +} +function isTypeRecurser(type, predicate) { + if (type.isUnionOrIntersection()) { + return type.types.some(t => isTypeRecurser(t, predicate)); + } + return predicate(type); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1695393b678ffa2bbf0c31e005438afddda06e2e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"mixed", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.js new file mode 100644 index 0000000000000000000000000000000000000000..91e064a8efeb1c8396835eaeea07d2d6ca3e8568 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-mixed-enums.js @@ -0,0 +1,200 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +var AllowedType; +(function (AllowedType) { + AllowedType[AllowedType["Number"] = 0] = "Number"; + AllowedType[AllowedType["String"] = 1] = "String"; + AllowedType[AllowedType["Unknown"] = 2] = "Unknown"; +})(AllowedType || (AllowedType = {})); +exports.default = (0, util_1.createRule)({ + name: 'no-mixed-enums', + meta: { + type: 'problem', + docs: { + description: 'Disallow enums from having both number and string members', + recommended: 'strict', + requiresTypeChecking: true, + }, + messages: { + mixed: `Mixing number and string enums can be confusing.`, + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const parserServices = (0, util_1.getParserServices)(context); + const typeChecker = parserServices.program.getTypeChecker(); + function collectNodeDefinitions(node) { + const { name } = node.id; + const found = { + imports: [], + previousSibling: undefined, + }; + let scope = context.sourceCode.getScope(node); + for (const definition of scope.upper?.set.get(name)?.defs ?? []) { + if (definition.node.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration && + definition.node.range[0] < node.range[0] && + definition.node.body.members.length > 0) { + found.previousSibling = definition.node; + break; + } + } + while (scope) { + scope.set.get(name)?.defs.forEach(definition => { + if (definition.type === scope_manager_1.DefinitionType.ImportBinding) { + found.imports.push(definition.node); + } + }); + scope = scope.upper; + } + return found; + } + function getAllowedTypeForNode(node) { + return tsutils.isTypeFlagSet(typeChecker.getTypeAtLocation(node), ts.TypeFlags.StringLike) + ? AllowedType.String + : AllowedType.Number; + } + function getTypeFromImported(imported) { + const type = typeChecker.getTypeAtLocation(parserServices.esTreeNodeToTSNodeMap.get(imported)); + const valueDeclaration = type.getSymbol()?.valueDeclaration; + if (!valueDeclaration || + !ts.isEnumDeclaration(valueDeclaration) || + valueDeclaration.members.length === 0) { + return undefined; + } + return getAllowedTypeForNode(valueDeclaration.members[0]); + } + function getMemberType(member) { + if (!member.initializer) { + return AllowedType.Number; + } + switch (member.initializer.type) { + case utils_1.AST_NODE_TYPES.Literal: + switch (typeof member.initializer.value) { + case 'number': + return AllowedType.Number; + case 'string': + return AllowedType.String; + default: + return AllowedType.Unknown; + } + case utils_1.AST_NODE_TYPES.TemplateLiteral: + return AllowedType.String; + default: + return getAllowedTypeForNode(parserServices.esTreeNodeToTSNodeMap.get(member.initializer)); + } + } + function getDesiredTypeForDefinition(node) { + const { imports, previousSibling } = collectNodeDefinitions(node); + // Case: Merged ambiently via module augmentation + // import { MyEnum } from 'other-module'; + // declare module 'other-module' { + // enum MyEnum { A } + // } + for (const imported of imports) { + const typeFromImported = getTypeFromImported(imported); + if (typeFromImported != null) { + return typeFromImported; + } + } + // Case: Multiple enum declarations in the same file + // enum MyEnum { A } + // enum MyEnum { B } + if (previousSibling) { + return getMemberType(previousSibling.body.members[0]); + } + // Case: Namespace declaration merging + // namespace MyNamespace { + // export enum MyEnum { A } + // } + // namespace MyNamespace { + // export enum MyEnum { B } + // } + if (node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration && + node.parent.parent.type === utils_1.AST_NODE_TYPES.TSModuleBlock) { + // https://github.com/typescript-eslint/typescript-eslint/issues/8352 + // TODO: We don't need to dip into the TypeScript type checker here! + // Merged namespaces must all exist in the same file. + // We could instead compare this file's nodes to find the merges. + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.id); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const declarations = typeChecker + .getSymbolAtLocation(tsNode) + .getDeclarations(); + const [{ initializer }] = declarations[0] + .members; + return initializer && + tsutils.isTypeFlagSet(typeChecker.getTypeAtLocation(initializer), ts.TypeFlags.StringLike) + ? AllowedType.String + : AllowedType.Number; + } + // Finally, we default to the type of the first enum member + return getMemberType(node.body.members[0]); + } + return { + TSEnumDeclaration(node) { + if (!node.body.members.length) { + return; + } + let desiredType = getDesiredTypeForDefinition(node); + if (desiredType === ts.TypeFlags.Unknown) { + return; + } + for (const member of node.body.members) { + const currentType = getMemberType(member); + if (currentType === AllowedType.Unknown) { + return; + } + if (currentType === AllowedType.Number) { + desiredType ??= currentType; + } + if (currentType !== desiredType) { + context.report({ + node: member.initializer ?? member, + messageId: 'mixed', + }); + return; + } + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d85a5842da5f4cb0730bea595c6cd84163a50557 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.d.ts @@ -0,0 +1,11 @@ +export type Options = [ + { + allowDeclarations?: boolean; + allowDefinitionFiles?: boolean; + } +]; +export type MessageIds = 'moduleSyntaxIsPreferred'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"moduleSyntaxIsPreferred", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js new file mode 100644 index 0000000000000000000000000000000000000000..c0035138ab1eb9fe6feb4e708a1b33de92d3fee4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-namespace.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-namespace', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow TypeScript namespaces', + recommended: 'recommended', + }, + messages: { + moduleSyntaxIsPreferred: 'ES2015 module syntax is preferred over namespaces.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowDeclarations: { + type: 'boolean', + description: 'Whether to allow `declare` with custom TypeScript namespaces.', + }, + allowDefinitionFiles: { + type: 'boolean', + description: 'Whether to allow `declare` with custom TypeScript namespaces inside definition files.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowDeclarations: false, + allowDefinitionFiles: true, + }, + ], + create(context, [{ allowDeclarations, allowDefinitionFiles }]) { + function isDeclaration(node) { + if (node.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration && node.declare) { + return true; + } + return node.parent != null && isDeclaration(node.parent); + } + return { + "TSModuleDeclaration[global!=true][id.type!='Literal']"(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration || + (allowDefinitionFiles && (0, util_1.isDefinitionFile)(context.filename)) || + (allowDeclarations && isDeclaration(node))) { + return; + } + context.report({ + node, + messageId: 'moduleSyntaxIsPreferred', + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..951ca072ef210848e09eb6ce00c105e04ec1f940 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"noNonNullAssertedNullishCoalescing" | "suggestRemovingNonNull", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.js new file mode 100644 index 0000000000000000000000000000000000000000..c37f52fda393951dc286d913fef28dd14968e0a2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-nullish-coalescing.js @@ -0,0 +1,73 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +function hasAssignmentBeforeNode(variable, node) { + return (variable.references.some(ref => ref.isWrite() && ref.identifier.range[1] < node.range[1]) || + variable.defs.some(def => isDefinitionWithAssignment(def) && def.node.range[1] < node.range[1])); +} +function isDefinitionWithAssignment(definition) { + if (definition.type !== scope_manager_1.DefinitionType.Variable) { + return false; + } + const variableDeclarator = definition.node; + return variableDeclarator.definite || variableDeclarator.init != null; +} +exports.default = (0, util_1.createRule)({ + name: 'no-non-null-asserted-nullish-coalescing', + meta: { + type: 'problem', + docs: { + description: 'Disallow non-null assertions in the left operand of a nullish coalescing operator', + recommended: 'strict', + }, + hasSuggestions: true, + messages: { + noNonNullAssertedNullishCoalescing: 'The nullish coalescing operator is designed to handle undefined and null - using a non-null assertion is not needed.', + suggestRemovingNonNull: 'Remove the non-null assertion.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + 'LogicalExpression[operator = "??"] > TSNonNullExpression.left'(node) { + if (node.expression.type === utils_1.TSESTree.AST_NODE_TYPES.Identifier) { + const scope = context.sourceCode.getScope(node); + const identifier = node.expression; + const variable = utils_1.ASTUtils.findVariable(scope, identifier.name); + if (variable && !hasAssignmentBeforeNode(variable, node)) { + return; + } + } + context.report({ + node, + messageId: 'noNonNullAssertedNullishCoalescing', + /* + Use a suggestion instead of a fixer, because this can break type checks. + The resulting type of the nullish coalesce is only influenced by the right operand if the left operand can be `null` or `undefined`. + After removing the non-null assertion the type of the left operand might contain `null` or `undefined` and then the type of the right operand + might change the resulting type of the nullish coalesce. + See the following example: + + function test(x?: string): string { + const bar = x! ?? false; // type analysis reports `bar` has type `string` + // x ?? false; // type analysis reports `bar` has type `string | false` + return bar; + } + */ + suggest: [ + { + messageId: 'suggestRemovingNonNull', + fix(fixer) { + const exclamationMark = (0, util_1.nullThrows)(context.sourceCode.getLastToken(node, utils_1.ASTUtils.isNonNullAssertionPunctuator), util_1.NullThrowsReasons.MissingToken('!', 'Non-null Assertion')); + return fixer.remove(exclamationMark); + }, + }, + ], + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5473dc88186b129a4731a06c5d792b135a77b41a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"suggestRemovingNonNull" | "noNonNullOptionalChain", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js new file mode 100644 index 0000000000000000000000000000000000000000..58e41c153a83853e3a95a1f99c396ca15343431b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-asserted-optional-chain.js @@ -0,0 +1,65 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-non-null-asserted-optional-chain', + meta: { + type: 'problem', + docs: { + description: 'Disallow non-null assertions after an optional chain expression', + recommended: 'recommended', + }, + hasSuggestions: true, + messages: { + noNonNullOptionalChain: 'Optional chain expressions can return undefined by design - using a non-null assertion is unsafe and wrong.', + suggestRemovingNonNull: 'You should remove the non-null assertion.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + // non-nulling a wrapped chain will scrub all nulls introduced by the chain + // (x?.y)! + // (x?.())! + 'TSNonNullExpression > ChainExpression'(node) { + // selector guarantees this assertion + const parent = node.parent; + context.report({ + node, + messageId: 'noNonNullOptionalChain', + // use a suggestion instead of a fixer, because this can obviously break type checks + suggest: [ + { + messageId: 'suggestRemovingNonNull', + fix(fixer) { + return fixer.removeRange([ + parent.range[1] - 1, + parent.range[1], + ]); + }, + }, + ], + }); + }, + // non-nulling at the end of a chain will scrub all nulls introduced by the chain + // x?.y! + // x?.()! + 'ChainExpression > TSNonNullExpression'(node) { + context.report({ + node, + messageId: 'noNonNullOptionalChain', + // use a suggestion instead of a fixer, because this can obviously break type checks + suggest: [ + { + messageId: 'suggestRemovingNonNull', + fix(fixer) { + return fixer.removeRange([node.range[1] - 1, node.range[1]]); + }, + }, + ], + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5667a19ee0f25985bc80261d88f130a4136bf126 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.d.ts @@ -0,0 +1,6 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type MessageIds = 'noNonNull' | 'suggestOptionalChain'; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js new file mode 100644 index 0000000000000000000000000000000000000000..67883758a9b5f3b4be31ad5d699270011262e9ab --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-non-null-assertion.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-non-null-assertion', + meta: { + type: 'problem', + docs: { + description: 'Disallow non-null assertions using the `!` postfix operator', + recommended: 'strict', + }, + hasSuggestions: true, + messages: { + noNonNull: 'Forbidden non-null assertion.', + suggestOptionalChain: 'Consider using the optional chain operator `?.` instead. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + TSNonNullExpression(node) { + const suggest = []; + // it always exists in non-null assertion + const nonNullOperator = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.expression, util_1.isNonNullAssertionPunctuator), util_1.NullThrowsReasons.MissingToken('!', 'expression')); + function replaceTokenWithOptional() { + return fixer => fixer.replaceText(nonNullOperator, '?.'); + } + function removeToken() { + return fixer => fixer.remove(nonNullOperator); + } + if (node.parent.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.parent.object === node && + !(0, util_1.isAssignee)(node.parent)) { + if (!node.parent.optional) { + if (node.parent.computed) { + // it is x![y]?.z + suggest.push({ + messageId: 'suggestOptionalChain', + fix: replaceTokenWithOptional(), + }); + } + else { + // it is x!.y?.z + suggest.push({ + messageId: 'suggestOptionalChain', + fix(fixer) { + // x!.y?.z + // ^ punctuator + const punctuator = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(nonNullOperator), util_1.NullThrowsReasons.MissingToken('.', '!')); + return [ + fixer.remove(nonNullOperator), + fixer.insertTextBefore(punctuator, '?'), + ]; + }, + }); + } + } + else { + // it is x!?.[y].z or x!?.y.z + suggest.push({ + messageId: 'suggestOptionalChain', + fix: removeToken(), + }); + } + } + else if (node.parent.type === utils_1.AST_NODE_TYPES.CallExpression && + node.parent.callee === node) { + if (!node.parent.optional) { + // it is x.y?.z!() + suggest.push({ + messageId: 'suggestOptionalChain', + fix: replaceTokenWithOptional(), + }); + } + else { + // it is x.y.z!?.() + suggest.push({ + messageId: 'suggestOptionalChain', + fix: removeToken(), + }); + } + } + context.report({ + node, + messageId: 'noNonNull', + suggest, + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0d9c7adf535983734d5404c18fba23263282ee38 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.d.ts @@ -0,0 +1,12 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type MessageIds = 'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax'; +export type Options = [ + { + builtinGlobals?: boolean; + ignoreDeclarationMerge?: boolean; + } +]; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js new file mode 100644 index 0000000000000000000000000000000000000000..f2e32ad8815245b261bf6a2a3b885948623cbdf7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redeclare.js @@ -0,0 +1,199 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-redeclare', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow variable redeclaration', + extendsBaseRule: true, + }, + messages: { + redeclared: "'{{id}}' is already defined.", + redeclaredAsBuiltin: "'{{id}}' is already defined as a built-in global variable.", + redeclaredBySyntax: "'{{id}}' is already defined by a variable declaration.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + builtinGlobals: { + type: 'boolean', + description: 'Whether to report shadowing of built-in global variables.', + }, + ignoreDeclarationMerge: { + type: 'boolean', + description: 'Whether to ignore declaration merges between certain TypeScript declaration types.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + builtinGlobals: true, + ignoreDeclarationMerge: true, + }, + ], + create(context, [options]) { + const CLASS_DECLARATION_MERGE_NODES = new Set([ + utils_1.AST_NODE_TYPES.ClassDeclaration, + utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + ]); + const FUNCTION_DECLARATION_MERGE_NODES = new Set([ + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + ]); + const ENUM_DECLARATION_MERGE_NODES = new Set([ + utils_1.AST_NODE_TYPES.TSEnumDeclaration, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + ]); + function* iterateDeclarations(variable) { + if (options.builtinGlobals && + 'eslintImplicitGlobalSetting' in variable && + (variable.eslintImplicitGlobalSetting === 'readonly' || + variable.eslintImplicitGlobalSetting === 'writable')) { + yield { type: 'builtin' }; + } + if ('eslintExplicitGlobalComments' in variable && + variable.eslintExplicitGlobalComments) { + for (const comment of variable.eslintExplicitGlobalComments) { + yield { + loc: (0, util_1.getNameLocationInGlobalDirectiveComment)(context.sourceCode, comment, variable.name), + node: comment, + type: 'comment', + }; + } + } + const identifiers = variable.identifiers + .map(id => ({ + identifier: id, + parent: id.parent, + })) + // ignore function declarations because TS will treat them as an overload + .filter(({ parent }) => parent.type !== utils_1.AST_NODE_TYPES.TSDeclareFunction); + if (options.ignoreDeclarationMerge && identifiers.length > 1) { + if ( + // interfaces merging + identifiers.every(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration)) { + return; + } + if ( + // namespace/module merging + identifiers.every(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration)) { + return; + } + if ( + // class + interface/namespace merging + identifiers.every(({ parent }) => CLASS_DECLARATION_MERGE_NODES.has(parent.type))) { + const classDecls = identifiers.filter(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.ClassDeclaration); + if (classDecls.length === 1) { + // safe declaration merging + return; + } + // there's more than one class declaration, which needs to be reported + for (const { identifier } of classDecls) { + yield { loc: identifier.loc, node: identifier, type: 'syntax' }; + } + return; + } + if ( + // class + interface/namespace merging + identifiers.every(({ parent }) => FUNCTION_DECLARATION_MERGE_NODES.has(parent.type))) { + const functionDecls = identifiers.filter(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.FunctionDeclaration); + if (functionDecls.length === 1) { + // safe declaration merging + return; + } + // there's more than one function declaration, which needs to be reported + for (const { identifier } of functionDecls) { + yield { loc: identifier.loc, node: identifier, type: 'syntax' }; + } + return; + } + if ( + // enum + namespace merging + identifiers.every(({ parent }) => ENUM_DECLARATION_MERGE_NODES.has(parent.type))) { + const enumDecls = identifiers.filter(({ parent }) => parent.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration); + if (enumDecls.length === 1) { + // safe declaration merging + return; + } + // there's more than one enum declaration, which needs to be reported + for (const { identifier } of enumDecls) { + yield { loc: identifier.loc, node: identifier, type: 'syntax' }; + } + return; + } + } + for (const { identifier } of identifiers) { + yield { loc: identifier.loc, node: identifier, type: 'syntax' }; + } + } + function findVariablesInScope(scope) { + for (const variable of scope.variables) { + const [declaration, ...extraDeclarations] = iterateDeclarations(variable); + if (extraDeclarations.length === 0) { + continue; + } + /* + * If the type of a declaration is different from the type of + * the first declaration, it shows the location of the first + * declaration. + */ + const detailMessageId = declaration.type === 'builtin' + ? 'redeclaredAsBuiltin' + : 'redeclaredBySyntax'; + const data = { id: variable.name }; + // Report extra declarations. + for (const { loc, node, type } of extraDeclarations) { + const messageId = type === declaration.type ? 'redeclared' : detailMessageId; + if (node) { + context.report({ loc, node, messageId, data }); + } + else if (loc) { + context.report({ loc, messageId, data }); + } + } + } + } + /** + * Find variables in the current scope. + */ + function checkForBlock(node) { + const scope = context.sourceCode.getScope(node); + /* + * In ES5, some node type such as `BlockStatement` doesn't have that scope. + * `scope.block` is a different node in such a case. + */ + if (scope.block === node) { + findVariablesInScope(scope); + } + } + return { + ArrowFunctionExpression: checkForBlock, + BlockStatement: checkForBlock, + ForInStatement: checkForBlock, + ForOfStatement: checkForBlock, + ForStatement: checkForBlock, + FunctionDeclaration: checkForBlock, + FunctionExpression: checkForBlock, + Program(node) { + const scope = context.sourceCode.getScope(node); + findVariablesInScope(scope); + // Node.js or ES modules has a special scope. + if (scope.type === scope_manager_1.ScopeType.global && + // The special scope's block is the Program node. + scope.block === scope.childScopes[0]?.block) { + findVariablesInScope(scope.childScopes[0]); + } + }, + SwitchStatement: checkForBlock, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..04b91482dcf4de7a1be2124ca3e9d3fb8890e797 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"overrides" | "errorTypeOverrides" | "literalOverridden" | "overridden" | "primitiveOverridden", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.js new file mode 100644 index 0000000000000000000000000000000000000000..8e14210d7af962a09926f5ce2bb2c98c0ccc3766 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-redundant-type-constituents.js @@ -0,0 +1,431 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const literalToPrimitiveTypeFlags = { + [ts.TypeFlags.BigIntLiteral]: ts.TypeFlags.BigInt, + [ts.TypeFlags.BooleanLiteral]: ts.TypeFlags.Boolean, + [ts.TypeFlags.NumberLiteral]: ts.TypeFlags.Number, + [ts.TypeFlags.StringLiteral]: ts.TypeFlags.String, + [ts.TypeFlags.TemplateLiteral]: ts.TypeFlags.String, +}; +const literalTypeFlags = [ + ts.TypeFlags.BigIntLiteral, + ts.TypeFlags.BooleanLiteral, + ts.TypeFlags.NumberLiteral, + ts.TypeFlags.StringLiteral, + ts.TypeFlags.TemplateLiteral, +]; +const primitiveTypeFlags = [ + ts.TypeFlags.BigInt, + ts.TypeFlags.Boolean, + ts.TypeFlags.Number, + ts.TypeFlags.String, +]; +const primitiveTypeFlagNames = { + [ts.TypeFlags.BigInt]: 'bigint', + [ts.TypeFlags.Boolean]: 'boolean', + [ts.TypeFlags.Number]: 'number', + [ts.TypeFlags.String]: 'string', +}; +const primitiveTypeFlagTypes = { + bigint: ts.TypeFlags.BigIntLiteral, + boolean: ts.TypeFlags.BooleanLiteral, + number: ts.TypeFlags.NumberLiteral, + string: ts.TypeFlags.StringLiteral, +}; +const keywordNodeTypesToTsTypes = new Map([ + [utils_1.TSESTree.AST_NODE_TYPES.TSAnyKeyword, ts.TypeFlags.Any], + [utils_1.TSESTree.AST_NODE_TYPES.TSBigIntKeyword, ts.TypeFlags.BigInt], + [utils_1.TSESTree.AST_NODE_TYPES.TSBooleanKeyword, ts.TypeFlags.Boolean], + [utils_1.TSESTree.AST_NODE_TYPES.TSNeverKeyword, ts.TypeFlags.Never], + [utils_1.TSESTree.AST_NODE_TYPES.TSNumberKeyword, ts.TypeFlags.Number], + [utils_1.TSESTree.AST_NODE_TYPES.TSStringKeyword, ts.TypeFlags.String], + [utils_1.TSESTree.AST_NODE_TYPES.TSUnknownKeyword, ts.TypeFlags.Unknown], +]); +function addToMapGroup(map, key, value) { + const existing = map.get(key); + if (existing) { + existing.push(value); + } + else { + map.set(key, [value]); + } +} +function describeLiteralType(type) { + if (type.isStringLiteral()) { + return JSON.stringify(type.value); + } + if ((0, util_1.isTypeBigIntLiteralType)(type)) { + return `${type.value.negative ? '-' : ''}${type.value.base10Value}n`; + } + if (type.isLiteral()) { + // eslint-disable-next-line @typescript-eslint/no-base-to-string + return type.value.toString(); + } + if (tsutils.isIntrinsicErrorType(type) && type.aliasSymbol) { + return type.aliasSymbol.escapedName.toString(); + } + if ((0, util_1.isTypeAnyType)(type)) { + return 'any'; + } + if ((0, util_1.isTypeNeverType)(type)) { + return 'never'; + } + if ((0, util_1.isTypeUnknownType)(type)) { + return 'unknown'; + } + if ((0, util_1.isTypeTemplateLiteralType)(type)) { + return 'template literal type'; + } + if ((0, util_1.isTypeBigIntLiteralType)(type)) { + return `${type.value.negative ? '-' : ''}${type.value.base10Value}n`; + } + if (tsutils.isTrueLiteralType(type)) { + return 'true'; + } + if (tsutils.isFalseLiteralType(type)) { + return 'false'; + } + return 'literal type'; +} +function describeLiteralTypeNode(typeNode) { + switch (typeNode.type) { + case utils_1.AST_NODE_TYPES.TSAnyKeyword: + return 'any'; + case utils_1.AST_NODE_TYPES.TSBooleanKeyword: + return 'boolean'; + case utils_1.AST_NODE_TYPES.TSNeverKeyword: + return 'never'; + case utils_1.AST_NODE_TYPES.TSNumberKeyword: + return 'number'; + case utils_1.AST_NODE_TYPES.TSStringKeyword: + return 'string'; + case utils_1.AST_NODE_TYPES.TSUnknownKeyword: + return 'unknown'; + case utils_1.AST_NODE_TYPES.TSLiteralType: + switch (typeNode.literal.type) { + case utils_1.TSESTree.AST_NODE_TYPES.Literal: + switch (typeof typeNode.literal.value) { + case 'bigint': + return `${typeNode.literal.value < 0 ? '-' : ''}${typeNode.literal.value}n`; + case 'string': + return JSON.stringify(typeNode.literal.value); + default: + return `${typeNode.literal.value}`; + } + case utils_1.TSESTree.AST_NODE_TYPES.TemplateLiteral: + return 'template literal type'; + } + } + return 'literal type'; +} +function isNodeInsideReturnType(node) { + return (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAnnotation && + (0, util_1.isFunctionOrFunctionType)(node.parent.parent)); +} +/** + * @remarks TypeScript stores boolean types as the union false | true, always. + */ +function unionTypePartsUnlessBoolean(type) { + return type.isUnion() && + type.types.length === 2 && + tsutils.isFalseLiteralType(type.types[0]) && + tsutils.isTrueLiteralType(type.types[1]) + ? [type] + : tsutils.unionConstituents(type); +} +exports.default = (0, util_1.createRule)({ + name: 'no-redundant-type-constituents', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow members of unions and intersections that do nothing or override type information', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + errorTypeOverrides: `'{{typeName}}' is an 'error' type that acts as 'any' and overrides all other types in this {{container}} type.`, + literalOverridden: `{{literal}} is overridden by {{primitive}} in this union type.`, + overridden: `'{{typeName}}' is overridden by other types in this {{container}} type.`, + overrides: `'{{typeName}}' overrides all other types in this {{container}} type.`, + primitiveOverridden: `{{primitive}} is overridden by the {{literal}} in this intersection type.`, + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const typesCache = new Map(); + function getTypeNodeTypePartFlags(typeNode) { + const keywordTypeFlags = keywordNodeTypesToTsTypes.get(typeNode.type); + if (keywordTypeFlags) { + return [ + { + typeFlags: keywordTypeFlags, + typeName: describeLiteralTypeNode(typeNode), + }, + ]; + } + if (typeNode.type === utils_1.AST_NODE_TYPES.TSLiteralType && + typeNode.literal.type === utils_1.AST_NODE_TYPES.Literal) { + return [ + { + typeFlags: primitiveTypeFlagTypes[typeof typeNode.literal + .value], + typeName: describeLiteralTypeNode(typeNode), + }, + ]; + } + if (typeNode.type === utils_1.AST_NODE_TYPES.TSUnionType) { + return typeNode.types.flatMap(getTypeNodeTypePartFlags); + } + const nodeType = services.getTypeAtLocation(typeNode); + const typeParts = unionTypePartsUnlessBoolean(nodeType); + return typeParts.map(typePart => ({ + typeFlags: typePart.flags, + typeName: describeLiteralType(typePart), + })); + } + function getTypeNodeTypePartFlagsCached(typeNode) { + const existing = typesCache.get(typeNode); + if (existing) { + return existing; + } + const created = getTypeNodeTypePartFlags(typeNode); + typesCache.set(typeNode, created); + return created; + } + return { + 'TSIntersectionType:exit'(node) { + const seenLiteralTypes = new Map(); + const seenPrimitiveTypes = new Map(); + const seenUnionTypes = new Map(); + function checkIntersectionBottomAndTopTypes({ typeFlags, typeName }, typeNode) { + for (const [messageId, checkFlag] of [ + ['overrides', ts.TypeFlags.Any], + ['overrides', ts.TypeFlags.Never], + ['overridden', ts.TypeFlags.Unknown], + ]) { + if (typeFlags === checkFlag) { + context.report({ + node: typeNode, + messageId: typeFlags === ts.TypeFlags.Any && typeName !== 'any' + ? 'errorTypeOverrides' + : messageId, + data: { + container: 'intersection', + typeName, + }, + }); + return true; + } + } + return false; + } + for (const typeNode of node.types) { + const typePartFlags = getTypeNodeTypePartFlagsCached(typeNode); + for (const typePart of typePartFlags) { + if (checkIntersectionBottomAndTopTypes(typePart, typeNode)) { + continue; + } + for (const literalTypeFlag of literalTypeFlags) { + if (typePart.typeFlags === literalTypeFlag) { + addToMapGroup(seenLiteralTypes, literalToPrimitiveTypeFlags[literalTypeFlag], typePart.typeName); + break; + } + } + for (const primitiveTypeFlag of primitiveTypeFlags) { + if (typePart.typeFlags === primitiveTypeFlag) { + addToMapGroup(seenPrimitiveTypes, primitiveTypeFlag, typeNode); + } + } + } + // if any typeNode is TSTypeReference and typePartFlags have more than 1 element, than the referenced type is definitely a union. + if (typePartFlags.length >= 2) { + seenUnionTypes.set(typeNode, typePartFlags); + } + } + /** + * @example + * ```ts + * type F = "a"|2|"b"; + * type I = F & string; + * ``` + * This function checks if all the union members of `F` are assignable to the other member of `I`. If every member is assignable, then its reported else not. + */ + const checkIfUnionsAreAssignable = () => { + for (const [typeRef, typeValues] of seenUnionTypes) { + let primitive = undefined; + for (const { typeFlags } of typeValues) { + if (seenPrimitiveTypes.has(literalToPrimitiveTypeFlags[typeFlags])) { + primitive = + literalToPrimitiveTypeFlags[typeFlags]; + } + else { + primitive = undefined; + break; + } + } + if (Number.isInteger(primitive)) { + context.report({ + node: typeRef, + messageId: 'primitiveOverridden', + data: { + literal: typeValues.map(name => name.typeName).join(' | '), + primitive: primitiveTypeFlagNames[primitive], + }, + }); + } + } + }; + if (seenUnionTypes.size > 0) { + checkIfUnionsAreAssignable(); + return; + } + // For each primitive type of all the seen primitive types, + // if there was a literal type seen that overrides it, + // report each of the primitive type's type nodes + for (const [primitiveTypeFlag, typeNodes] of seenPrimitiveTypes) { + const matchedLiteralTypes = seenLiteralTypes.get(primitiveTypeFlag); + if (matchedLiteralTypes) { + for (const typeNode of typeNodes) { + context.report({ + node: typeNode, + messageId: 'primitiveOverridden', + data: { + literal: matchedLiteralTypes.join(' | '), + primitive: primitiveTypeFlagNames[primitiveTypeFlag], + }, + }); + } + } + } + }, + 'TSUnionType:exit'(node) { + const seenLiteralTypes = new Map(); + const seenPrimitiveTypes = new Set(); + function checkUnionBottomAndTopTypes({ typeFlags, typeName }, typeNode) { + for (const checkFlag of [ + ts.TypeFlags.Any, + ts.TypeFlags.Unknown, + ]) { + if (typeFlags === checkFlag) { + context.report({ + node: typeNode, + messageId: typeFlags === ts.TypeFlags.Any && typeName !== 'any' + ? 'errorTypeOverrides' + : 'overrides', + data: { + container: 'union', + typeName, + }, + }); + return true; + } + } + if (typeFlags === ts.TypeFlags.Never && + !isNodeInsideReturnType(node)) { + context.report({ + node: typeNode, + messageId: 'overridden', + data: { + container: 'union', + typeName: 'never', + }, + }); + return true; + } + return false; + } + for (const typeNode of node.types) { + const typePartFlags = getTypeNodeTypePartFlagsCached(typeNode); + for (const typePart of typePartFlags) { + if (checkUnionBottomAndTopTypes(typePart, typeNode)) { + continue; + } + for (const literalTypeFlag of literalTypeFlags) { + if (typePart.typeFlags === literalTypeFlag) { + addToMapGroup(seenLiteralTypes, literalToPrimitiveTypeFlags[literalTypeFlag], { + literalValue: typePart.typeName, + typeNode, + }); + break; + } + } + for (const primitiveTypeFlag of primitiveTypeFlags) { + if ((typePart.typeFlags & primitiveTypeFlag) !== 0) { + seenPrimitiveTypes.add(primitiveTypeFlag); + } + } + } + } + const overriddenTypeNodes = new Map(); + // For each primitive type of all the seen literal types, + // if there was a primitive type seen that overrides it, + // upsert the literal text and primitive type under the backing type node + for (const [primitiveTypeFlag, typeNodesWithText] of seenLiteralTypes) { + if (seenPrimitiveTypes.has(primitiveTypeFlag)) { + for (const { literalValue, typeNode } of typeNodesWithText) { + addToMapGroup(overriddenTypeNodes, typeNode, { + literalValue, + primitiveTypeFlag, + }); + } + } + } + // For each type node that had at least one overridden literal, + // group those literals by their primitive type, + // then report each primitive type with all its literals + for (const [typeNode, typeFlagsWithText] of overriddenTypeNodes) { + const grouped = (0, util_1.arrayGroupByToMap)(typeFlagsWithText, pair => pair.primitiveTypeFlag); + for (const [primitiveTypeFlag, pairs] of grouped) { + context.report({ + node: typeNode, + messageId: 'literalOverridden', + data: { + literal: pairs.map(pair => pair.literalValue).join(' | '), + primitive: primitiveTypeFlagNames[primitiveTypeFlag], + }, + }); + } + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9207b5a11bc8f9f1d00f201e1be6065e3cbfc239 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.d.ts @@ -0,0 +1,11 @@ +export type Options = [ + { + allow?: string[]; + allowAsImport?: boolean; + } +]; +export type MessageIds = 'noRequireImports'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noRequireImports", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js new file mode 100644 index 0000000000000000000000000000000000000000..a3bc4840367698a82cd999f391318fd3e588b5f5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-require-imports.js @@ -0,0 +1,115 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-require-imports', + meta: { + type: 'problem', + docs: { + description: 'Disallow invocation of `require()`', + recommended: 'recommended', + }, + messages: { + noRequireImports: 'A `require()` style import is forbidden.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + type: 'array', + description: 'Patterns of import paths to allow requiring from.', + items: { type: 'string' }, + }, + allowAsImport: { + type: 'boolean', + description: 'Allows `require` statements in import declarations.', + }, + }, + }, + ], + }, + defaultOptions: [{ allow: [], allowAsImport: false }], + create(context, options) { + const allowAsImport = options[0].allowAsImport; + const allowPatterns = options[0].allow?.map(pattern => new RegExp(pattern, 'u')); + function isImportPathAllowed(importPath) { + return allowPatterns?.some(pattern => importPath.match(pattern)); + } + function isStringOrTemplateLiteral(node) { + return ((node.type === utils_1.AST_NODE_TYPES.Literal && + typeof node.value === 'string') || + node.type === utils_1.AST_NODE_TYPES.TemplateLiteral); + } + return { + 'CallExpression[callee.name="require"]'(node) { + if (node.arguments[0] && isStringOrTemplateLiteral(node.arguments[0])) { + const argValue = util.getStaticStringValue(node.arguments[0]); + if (typeof argValue === 'string' && isImportPathAllowed(argValue)) { + return; + } + } + const variable = utils_1.ASTUtils.findVariable(context.sourceCode.getScope(node), 'require'); + // ignore non-global require usage as it's something user-land custom instead + // of the commonjs standard + if (!variable?.identifiers.length) { + context.report({ + node, + messageId: 'noRequireImports', + }); + } + }, + TSExternalModuleReference(node) { + if (isStringOrTemplateLiteral(node.expression)) { + const argValue = util.getStaticStringValue(node.expression); + if (typeof argValue === 'string' && isImportPathAllowed(argValue)) { + return; + } + } + if (allowAsImport && + node.parent.type === utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration) { + return; + } + context.report({ + node, + messageId: 'noRequireImports', + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea1d32cef42e979dbf7f026a57c0dbbccf51b48f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.d.ts @@ -0,0 +1,9 @@ +import type { ArrayOfStringOrObject, RuleListener } from 'eslint/lib/rules/no-restricted-imports'; +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util'; +declare const baseRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"everything" | "everythingWithCustomMessage" | "importName" | "importNameWithCustomMessage" | "path" | "pathWithCustomMessage" | "patterns" | "patternWithCustomMessage", [import("eslint/lib/rules/no-restricted-imports").ObjectOfPathsAndPatterns] | ArrayOfStringOrObject, unknown, RuleListener>; +export type Options = InferOptionsTypeFromRule; +export type MessageIds = InferMessageIdsTypeFromRule; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"everything" | "everythingWithCustomMessage" | "importName" | "importNameWithCustomMessage" | "path" | "pathWithCustomMessage" | "patterns" | "patternWithCustomMessage", [import("eslint/lib/rules/no-restricted-imports").ObjectOfPathsAndPatterns] | ArrayOfStringOrObject, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js new file mode 100644 index 0000000000000000000000000000000000000000..83755e3d6ac8ac382ab60d010d233970aa6b5cf6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js @@ -0,0 +1,243 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const ignore_1 = __importDefault(require("ignore")); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-restricted-imports'); +// In some versions of eslint, the base rule has a completely incompatible schema +// This helper function is to safely try to get parts of the schema. If it's not +// possible, we'll fallback to less strict checks. +const tryAccess = (getter, fallback) => { + try { + return getter(); + } + catch { + return fallback; + } +}; +const baseSchema = baseRule.meta.schema; +const allowTypeImportsOptionSchema = { + allowTypeImports: { + type: 'boolean', + description: 'Whether to allow type-only imports for a path.', + }, +}; +const arrayOfStringsOrObjects = { + type: 'array', + items: { + anyOf: [ + { type: 'string' }, + { + type: 'object', + additionalProperties: false, + properties: { + ...tryAccess(() => baseSchema.anyOf[1].items[0].properties.paths.items.anyOf[1] + .properties, undefined), + ...allowTypeImportsOptionSchema, + }, + required: tryAccess(() => baseSchema.anyOf[1].items[0].properties.paths.items.anyOf[1] + .required, undefined), + }, + ], + }, + uniqueItems: true, +}; +const arrayOfStringsOrObjectPatterns = { + anyOf: [ + { + type: 'array', + items: { + type: 'string', + }, + uniqueItems: true, + }, + { + type: 'array', + items: { + type: 'object', + additionalProperties: false, + properties: { + ...tryAccess(() => baseSchema.anyOf[1].items[0].properties.patterns.anyOf[1].items + .properties, undefined), + ...allowTypeImportsOptionSchema, + }, + required: tryAccess(() => baseSchema.anyOf[1].items[0].properties.patterns.anyOf[1].items + .required, []), + }, + uniqueItems: true, + }, + ], +}; +const schema = { + anyOf: [ + arrayOfStringsOrObjects, + { + type: 'array', + additionalItems: false, + items: [ + { + type: 'object', + additionalProperties: false, + properties: { + paths: arrayOfStringsOrObjects, + patterns: arrayOfStringsOrObjectPatterns, + }, + }, + ], + }, + ], +}; +function isObjectOfPaths(obj) { + return !!obj && Object.hasOwn(obj, 'paths'); +} +function isObjectOfPatterns(obj) { + return !!obj && Object.hasOwn(obj, 'patterns'); +} +function isOptionsArrayOfStringOrObject(options) { + if (isObjectOfPaths(options[0])) { + return false; + } + if (isObjectOfPatterns(options[0])) { + return false; + } + return true; +} +function getRestrictedPaths(options) { + if (isOptionsArrayOfStringOrObject(options)) { + return options; + } + if (isObjectOfPaths(options[0])) { + return options[0].paths; + } + return []; +} +function getRestrictedPatterns(options) { + if (isObjectOfPatterns(options[0])) { + return options[0].patterns; + } + return []; +} +function shouldCreateRule(baseRules, options) { + if (Object.keys(baseRules).length === 0 || options.length === 0) { + return false; + } + if (!isOptionsArrayOfStringOrObject(options)) { + return !!(options[0].paths?.length || options[0].patterns?.length); + } + return true; +} +exports.default = (0, util_1.createRule)({ + name: 'no-restricted-imports', + meta: { + type: 'suggestion', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Disallow specified modules when loaded by `import`', + extendsBaseRule: true, + }, + fixable: baseRule.meta.fixable, + messages: baseRule.meta.messages, + schema, + }, + defaultOptions: [], + create(context) { + const rules = baseRule.create(context); + const { options } = context; + if (!shouldCreateRule(rules, options)) { + return {}; + } + const restrictedPaths = getRestrictedPaths(options); + const allowedTypeImportPathNameSet = new Set(); + for (const restrictedPath of restrictedPaths) { + if (typeof restrictedPath === 'object' && + restrictedPath.allowTypeImports) { + allowedTypeImportPathNameSet.add(restrictedPath.name); + } + } + function isAllowedTypeImportPath(importSource) { + return allowedTypeImportPathNameSet.has(importSource); + } + const restrictedPatterns = getRestrictedPatterns(options); + const allowedImportTypeMatchers = []; + const allowedImportTypeRegexMatchers = []; + for (const restrictedPattern of restrictedPatterns) { + if (typeof restrictedPattern === 'object' && + restrictedPattern.allowTypeImports) { + // Following how ignore is configured in the base rule + if (restrictedPattern.group) { + allowedImportTypeMatchers.push((0, ignore_1.default)({ + allowRelativePaths: true, + ignoreCase: !restrictedPattern.caseSensitive, + }).add(restrictedPattern.group)); + } + if (restrictedPattern.regex) { + allowedImportTypeRegexMatchers.push(new RegExp(restrictedPattern.regex, restrictedPattern.caseSensitive ? 'u' : 'iu')); + } + } + } + function isAllowedTypeImportPattern(importSource) { + return ( + // As long as there's one matching pattern that allows type import + allowedImportTypeMatchers.some(matcher => matcher.ignores(importSource)) || + allowedImportTypeRegexMatchers.some(regex => regex.test(importSource))); + } + function checkImportNode(node) { + if (node.importKind === 'type' || + (node.specifiers.length > 0 && + node.specifiers.every(specifier => specifier.type === utils_1.AST_NODE_TYPES.ImportSpecifier && + specifier.importKind === 'type'))) { + const importSource = node.source.value.trim(); + if (!isAllowedTypeImportPath(importSource) && + !isAllowedTypeImportPattern(importSource)) { + return rules.ImportDeclaration(node); + } + } + else { + return rules.ImportDeclaration(node); + } + } + return { + ExportAllDeclaration: rules.ExportAllDeclaration, + 'ExportNamedDeclaration[source]'(node) { + if (node.exportKind === 'type' || + (node.specifiers.length > 0 && + node.specifiers.every(specifier => specifier.exportKind === 'type'))) { + const importSource = node.source.value.trim(); + if (!isAllowedTypeImportPath(importSource) && + !isAllowedTypeImportPattern(importSource)) { + return rules.ExportNamedDeclaration(node); + } + } + else { + return rules.ExportNamedDeclaration(node); + } + }, + ImportDeclaration: checkImportNode, + TSImportEqualsDeclaration(node) { + if (node.moduleReference.type === utils_1.AST_NODE_TYPES.TSExternalModuleReference) { + const synthesizedImport = { + ...node, + type: utils_1.AST_NODE_TYPES.ImportDeclaration, + assertions: [], + attributes: [], + source: node.moduleReference.expression, + specifiers: [ + { + ...node.id, + type: utils_1.AST_NODE_TYPES.ImportDefaultSpecifier, + local: node.id, + // @ts-expect-error -- parent types are incompatible but it's fine for the purposes of this extension + parent: node.id.parent, + }, + ], + }; + return checkImportNode(synthesizedImport); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..63e9b40cb68a91c60afc731d88ed985cdc28fac6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.d.ts @@ -0,0 +1,16 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +type Types = Record; +export type Options = [ + { + types?: Types; + } +]; +export type MessageIds = 'bannedTypeMessage' | 'bannedTypeReplacement'; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.js new file mode 100644 index 0000000000000000000000000000000000000000..cc9b8c7714749d7fb125b7e8ab0bf0a33ab9bf19 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-types.js @@ -0,0 +1,171 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +function removeSpaces(str) { + return str.replaceAll(/\s/g, ''); +} +function stringifyNode(node, sourceCode) { + return removeSpaces(sourceCode.getText(node)); +} +function getCustomMessage(bannedType) { + if (!bannedType || bannedType === true) { + return ''; + } + if (typeof bannedType === 'string') { + return ` ${bannedType}`; + } + if (bannedType.message) { + return ` ${bannedType.message}`; + } + return ''; +} +const TYPE_KEYWORDS = { + bigint: utils_1.AST_NODE_TYPES.TSBigIntKeyword, + boolean: utils_1.AST_NODE_TYPES.TSBooleanKeyword, + never: utils_1.AST_NODE_TYPES.TSNeverKeyword, + null: utils_1.AST_NODE_TYPES.TSNullKeyword, + number: utils_1.AST_NODE_TYPES.TSNumberKeyword, + object: utils_1.AST_NODE_TYPES.TSObjectKeyword, + string: utils_1.AST_NODE_TYPES.TSStringKeyword, + symbol: utils_1.AST_NODE_TYPES.TSSymbolKeyword, + undefined: utils_1.AST_NODE_TYPES.TSUndefinedKeyword, + unknown: utils_1.AST_NODE_TYPES.TSUnknownKeyword, + void: utils_1.AST_NODE_TYPES.TSVoidKeyword, +}; +exports.default = (0, util_1.createRule)({ + name: 'no-restricted-types', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow certain types', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + bannedTypeMessage: "Don't use `{{name}}` as a type.{{customMessage}}", + bannedTypeReplacement: 'Replace `{{name}}` with `{{replacement}}`.', + }, + schema: [ + { + type: 'object', + $defs: { + banConfig: { + oneOf: [ + { + type: 'boolean', + description: 'Bans the type with the default message.', + enum: [true], + }, + { + type: 'string', + description: 'Bans the type with a custom message.', + }, + { + type: 'object', + additionalProperties: false, + description: 'Bans a type.', + properties: { + fixWith: { + type: 'string', + description: 'Type to autofix replace with. Note that autofixers can be applied automatically - so you need to be careful with this option.', + }, + message: { + type: 'string', + description: 'Custom error message.', + }, + suggest: { + type: 'array', + description: 'Types to suggest replacing with.', + items: { type: 'string' }, + }, + }, + }, + ], + }, + }, + additionalProperties: false, + properties: { + types: { + type: 'object', + additionalProperties: { + $ref: '#/items/0/$defs/banConfig', + }, + description: 'An object whose keys are the types you want to ban, and the values are error messages.', + }, + }, + }, + ], + }, + defaultOptions: [{}], + create(context, [{ types = {} }]) { + const bannedTypes = new Map(Object.entries(types).map(([type, data]) => [removeSpaces(type), data])); + function checkBannedTypes(typeNode, name = stringifyNode(typeNode, context.sourceCode)) { + const bannedType = bannedTypes.get(name); + if (bannedType == null || bannedType === false) { + return; + } + const customMessage = getCustomMessage(bannedType); + const fixWith = bannedType && typeof bannedType === 'object' && bannedType.fixWith; + const suggest = bannedType && typeof bannedType === 'object' + ? bannedType.suggest + : undefined; + context.report({ + node: typeNode, + messageId: 'bannedTypeMessage', + data: { + name, + customMessage, + }, + fix: fixWith + ? (fixer) => fixer.replaceText(typeNode, fixWith) + : null, + suggest: suggest?.map(replacement => ({ + messageId: 'bannedTypeReplacement', + data: { + name, + replacement, + }, + fix: (fixer) => fixer.replaceText(typeNode, replacement), + })), + }); + } + const keywordSelectors = (0, util_1.objectReduceKey)(TYPE_KEYWORDS, (acc, keyword) => { + if (bannedTypes.has(keyword)) { + acc[TYPE_KEYWORDS[keyword]] = (node) => checkBannedTypes(node, keyword); + } + return acc; + }, {}); + return { + ...keywordSelectors, + TSClassImplements(node) { + checkBannedTypes(node.expression); + if (node.typeArguments) { + checkBannedTypes(node); + } + }, + TSInterfaceHeritage(node) { + checkBannedTypes(node.expression); + if (node.typeArguments) { + checkBannedTypes(node); + } + }, + TSTupleType(node) { + if (!node.elementTypes.length) { + checkBannedTypes(node); + } + }, + TSTypeLiteral(node) { + if (!node.members.length) { + checkBannedTypes(node); + } + }, + TSTypeReference(node) { + checkBannedTypes(node.typeName); + if (node.typeArguments) { + checkBannedTypes(node); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ccd6b4f6f958afd1619d5e624aea46c07c7ca880 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.d.ts @@ -0,0 +1,16 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type MessageIds = 'noShadow' | 'noShadowGlobal'; +export type Options = [ + { + allow?: string[]; + builtinGlobals?: boolean; + hoist?: 'all' | 'functions' | 'functions-and-types' | 'never' | 'types'; + ignoreFunctionTypeParameterNameValueShadow?: boolean; + ignoreOnInitialization?: boolean; + ignoreTypeValueShadow?: boolean; + } +]; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js new file mode 100644 index 0000000000000000000000000000000000000000..578925946d77f780134b9fdb59b54d6e0366ec9a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-shadow.js @@ -0,0 +1,551 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const isTypeImport_1 = require("../util/isTypeImport"); +const allowedFunctionVariableDefTypes = new Set([ + utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + utils_1.AST_NODE_TYPES.TSFunctionType, + utils_1.AST_NODE_TYPES.TSMethodSignature, + utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + utils_1.AST_NODE_TYPES.TSDeclareFunction, + utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + utils_1.AST_NODE_TYPES.TSConstructorType, +]); +const functionsHoistedNodes = new Set([utils_1.AST_NODE_TYPES.FunctionDeclaration]); +const typesHoistedNodes = new Set([ + utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration, +]); +exports.default = (0, util_1.createRule)({ + name: 'no-shadow', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow variable declarations from shadowing variables declared in the outer scope', + extendsBaseRule: true, + }, + messages: { + noShadow: "'{{name}}' is already declared in the upper scope on line {{shadowedLine}} column {{shadowedColumn}}.", + noShadowGlobal: "'{{name}}' is already a global variable.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + type: 'array', + description: 'Identifier names for which shadowing is allowed.', + items: { + type: 'string', + }, + }, + builtinGlobals: { + type: 'boolean', + description: 'Whether to report shadowing of built-in global variables.', + }, + hoist: { + type: 'string', + description: 'Whether to report shadowing before outer functions or variables are defined.', + enum: ['all', 'functions', 'functions-and-types', 'never', 'types'], + }, + ignoreFunctionTypeParameterNameValueShadow: { + type: 'boolean', + description: 'Whether to ignore function parameters named the same as a variable.', + }, + ignoreOnInitialization: { + type: 'boolean', + description: 'Whether to ignore the variable initializers when the shadowed variable is presumably still unitialized.', + }, + ignoreTypeValueShadow: { + type: 'boolean', + description: 'Whether to ignore types named the same as a variable.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [], + builtinGlobals: false, + hoist: 'functions-and-types', + ignoreFunctionTypeParameterNameValueShadow: true, + ignoreOnInitialization: false, + ignoreTypeValueShadow: true, + }, + ], + create(context, [options]) { + /** + * Check if a scope is a TypeScript module augmenting the global namespace. + */ + function isGlobalAugmentation(scope) { + return ((scope.type === scope_manager_1.ScopeType.tsModule && scope.block.kind === 'global') || + (!!scope.upper && isGlobalAugmentation(scope.upper))); + } + /** + * Check if variable is a `this` parameter. + */ + function isThisParam(variable) { + return (variable.defs[0].type === scope_manager_1.DefinitionType.Parameter && + variable.name === 'this'); + } + function isTypeValueShadow(variable, shadowed) { + if (options.ignoreTypeValueShadow !== true) { + return false; + } + if (!('isValueVariable' in variable)) { + // this shouldn't happen... + return false; + } + const firstDefinition = shadowed.defs.at(0); + const isShadowedValue = !('isValueVariable' in shadowed) || + !firstDefinition || + (!(0, isTypeImport_1.isTypeImport)(firstDefinition) && shadowed.isValueVariable); + return variable.isValueVariable !== isShadowedValue; + } + function isFunctionTypeParameterNameValueShadow(variable, shadowed) { + if (options.ignoreFunctionTypeParameterNameValueShadow !== true) { + return false; + } + if (!('isValueVariable' in variable)) { + // this shouldn't happen... + return false; + } + const isShadowedValue = 'isValueVariable' in shadowed ? shadowed.isValueVariable : true; + if (!isShadowedValue) { + return false; + } + return variable.defs.every(def => allowedFunctionVariableDefTypes.has(def.node.type)); + } + function isGenericOfStaticMethod(variable) { + if (!('isTypeVariable' in variable)) { + // this shouldn't happen... + return false; + } + if (!variable.isTypeVariable) { + return false; + } + if (variable.identifiers.length === 0) { + return false; + } + const typeParameter = variable.identifiers[0].parent; + if (typeParameter.type !== utils_1.AST_NODE_TYPES.TSTypeParameter) { + return false; + } + const typeParameterDecl = typeParameter.parent; + if (typeParameterDecl.type !== utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration) { + return false; + } + const functionExpr = typeParameterDecl.parent; + if (functionExpr.type !== utils_1.AST_NODE_TYPES.FunctionExpression && + functionExpr.type !== utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + return false; + } + const methodDefinition = functionExpr.parent; + if (methodDefinition.type !== utils_1.AST_NODE_TYPES.MethodDefinition) { + return false; + } + return methodDefinition.static; + } + function isGenericOfClass(variable) { + if (!('isTypeVariable' in variable)) { + // this shouldn't happen... + return false; + } + if (!variable.isTypeVariable) { + return false; + } + if (variable.identifiers.length === 0) { + return false; + } + const typeParameter = variable.identifiers[0].parent; + if (typeParameter.type !== utils_1.AST_NODE_TYPES.TSTypeParameter) { + return false; + } + const typeParameterDecl = typeParameter.parent; + if (typeParameterDecl.type !== utils_1.AST_NODE_TYPES.TSTypeParameterDeclaration) { + return false; + } + const classDecl = typeParameterDecl.parent; + return (classDecl.type === utils_1.AST_NODE_TYPES.ClassDeclaration || + classDecl.type === utils_1.AST_NODE_TYPES.ClassExpression); + } + function isGenericOfAStaticMethodShadow(variable, shadowed) { + return isGenericOfStaticMethod(variable) && isGenericOfClass(shadowed); + } + function isImportDeclaration(definition) { + return definition.type === utils_1.AST_NODE_TYPES.ImportDeclaration; + } + function isExternalModuleDeclarationWithName(scope, name) { + return (scope.type === scope_manager_1.ScopeType.tsModule && + scope.block.id.type === utils_1.AST_NODE_TYPES.Literal && + scope.block.id.value === name); + } + function isExternalDeclarationMerging(scope, variable, shadowed) { + const [firstDefinition] = shadowed.defs; + const [secondDefinition] = variable.defs; + return ((0, isTypeImport_1.isTypeImport)(firstDefinition) && + isImportDeclaration(firstDefinition.parent) && + isExternalModuleDeclarationWithName(scope, firstDefinition.parent.source.value) && + (secondDefinition.node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration || + secondDefinition.node.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration)); + } + /** + * Check if variable name is allowed. + * @param variable The variable to check. + * @returns Whether or not the variable name is allowed. + */ + function isAllowed(variable) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return options.allow.includes(variable.name); + } + /** + * Checks if a variable of the class name in the class scope of ClassDeclaration. + * + * ClassDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param variable The variable to check. + * @returns Whether or not the variable of the class name in the class scope of ClassDeclaration. + */ + function isDuplicatedClassNameVariable(variable) { + const block = variable.scope.block; + return (block.type === utils_1.AST_NODE_TYPES.ClassDeclaration && + block.id === variable.identifiers[0]); + } + /** + * Checks if a variable of the class name in the class scope of TSEnumDeclaration. + * + * TSEnumDeclaration creates two variables of its name into its outer scope and its class scope. + * So we should ignore the variable in the class scope. + * @param variable The variable to check. + * @returns Whether or not the variable of the class name in the class scope of TSEnumDeclaration. + */ + function isDuplicatedEnumNameVariable(variable) { + const block = variable.scope.block; + return (block.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration && + block.id === variable.identifiers[0]); + } + /** + * Checks whether or not a given location is inside of the range of a given node. + * @param node An node to check. + * @param location A location to check. + * @returns `true` if the location is inside of the range of the node. + */ + function isInRange(node, location) { + return node && node.range[0] <= location && location <= node.range[1]; + } + /** + * Searches from the current node through its ancestry to find a matching node. + * @param node a node to get. + * @param match a callback that checks whether or not the node verifies its condition or not. + * @returns the matching node. + */ + function findSelfOrAncestor(node, match) { + let currentNode = node; + while (currentNode && !match(currentNode)) { + currentNode = currentNode.parent; + } + return currentNode; + } + /** + * Finds function's outer scope. + * @param scope Function's own scope. + * @returns Function's outer scope. + */ + function getOuterScope(scope) { + const upper = scope.upper; + if (upper?.type === scope_manager_1.ScopeType.functionExpressionName) { + return upper.upper; + } + return upper; + } + /** + * Checks if a variable and a shadowedVariable have the same init pattern ancestor. + * @param variable a variable to check. + * @param shadowedVariable a shadowedVariable to check. + * @returns Whether or not the variable and the shadowedVariable have the same init pattern ancestor. + */ + function isInitPatternNode(variable, shadowedVariable) { + const outerDef = shadowedVariable.defs.at(0); + if (!outerDef) { + return false; + } + const { variableScope } = variable.scope; + if (!((variableScope.block.type === + utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + variableScope.block.type === utils_1.AST_NODE_TYPES.FunctionExpression) && + getOuterScope(variableScope) === shadowedVariable.scope)) { + return false; + } + const fun = variableScope.block; + const { parent } = fun; + const callExpression = findSelfOrAncestor(parent, node => node.type === utils_1.AST_NODE_TYPES.CallExpression); + if (!callExpression) { + return false; + } + let node = outerDef.name; + const location = callExpression.range[1]; + while (node) { + if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) { + if (isInRange(node.init, location)) { + return true; + } + if ((node.parent.parent.type === utils_1.AST_NODE_TYPES.ForInStatement || + node.parent.parent.type === utils_1.AST_NODE_TYPES.ForOfStatement) && + isInRange(node.parent.parent.right, location)) { + return true; + } + break; + } + else if (node.type === utils_1.AST_NODE_TYPES.AssignmentPattern) { + if (isInRange(node.right, location)) { + return true; + } + } + else if ([ + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + utils_1.AST_NODE_TYPES.CatchClause, + utils_1.AST_NODE_TYPES.ClassDeclaration, + utils_1.AST_NODE_TYPES.ClassExpression, + utils_1.AST_NODE_TYPES.ExportNamedDeclaration, + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.FunctionExpression, + utils_1.AST_NODE_TYPES.ImportDeclaration, + ].includes(node.type)) { + break; + } + node = node.parent; + } + return false; + } + /** + * Finds the uppermost expression node that can evaluate to the given one, + * unwrapping through LogicalExpression and non-test ConditionalExpression branches. + * @param node The node to unwrap. + * @returns The topmost unwrapped node. + */ + function unwrapExpression(node) { + const { parent } = node; + if (parent?.type === utils_1.AST_NODE_TYPES.LogicalExpression || + (parent?.type === utils_1.AST_NODE_TYPES.ConditionalExpression && + parent.test !== node)) { + return unwrapExpression(parent); + } + return node; + } + /** + * Checks if a variable is the name of a function or class expression that is + * directly assigned (or transparently through `||`/`?:`) as the initializer + * of scopeVar. + * + * Allows `var a = function a() {}` but reports `var a = wrap(function a() {})`. + * @param variable The variable to check. + * @param scopeVar The scope variable to look for. + * @returns Whether or not the variable is the direct initializer name of scopeVar. + */ + function isOnInitializer(variable, scopeVar) { + const outerDef = scopeVar.defs.at(0); + const innerDef = variable.defs.at(0); + if (!outerDef || !innerDef) { + return false; + } + if (!((innerDef.type === scope_manager_1.DefinitionType.FunctionName && + innerDef.node.type === utils_1.AST_NODE_TYPES.FunctionExpression) || + (innerDef.type === scope_manager_1.DefinitionType.ClassName && + innerDef.node.type === utils_1.AST_NODE_TYPES.ClassExpression))) { + return false; + } + const outerIdentifier = outerDef.name; + let initializerNode; + if (outerIdentifier.parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator) { + initializerNode = outerIdentifier.parent.init; + } + else if (outerIdentifier.parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern) { + initializerNode = outerIdentifier.parent.right; + } + if (!initializerNode) { + return false; + } + const nodeToCheck = innerDef.node; + if (!(initializerNode.range[0] <= nodeToCheck.range[0] && + nodeToCheck.range[1] <= initializerNode.range[1])) { + return false; + } + return initializerNode === unwrapExpression(nodeToCheck); + } + /** + * Get a range of a variable's identifier node. + * @param variable The variable to get. + * @returns The range of the variable's identifier node. + */ + function getNameRange(variable) { + const def = variable.defs.at(0); + return def?.name.range; + } + /** + * Checks if a variable is in TDZ of scopeVar. + * @param variable The variable to check. + * @param scopeVar The variable of TDZ. + * @returns Whether or not the variable is in TDZ of scopeVar. + */ + function isInTdz(variable, scopeVar) { + const outerDef = scopeVar.defs.at(0); + const inner = getNameRange(variable); + const outer = getNameRange(scopeVar); + if (!inner || !outer || inner[1] >= outer[0]) { + return false; + } + if (!outerDef) { + return true; + } + if (options.hoist === 'functions') { + return !functionsHoistedNodes.has(outerDef.node.type); + } + if (options.hoist === 'types') { + return !typesHoistedNodes.has(outerDef.node.type); + } + if (options.hoist === 'functions-and-types') { + return (!functionsHoistedNodes.has(outerDef.node.type) && + !typesHoistedNodes.has(outerDef.node.type)); + } + return true; + } + /** + * Get declared line and column of a variable. + * @param variable The variable to get. + * @returns The declared line and column of the variable. + */ + function getDeclaredLocation(variable) { + const identifier = variable.identifiers.at(0); + if (identifier) { + return { + column: identifier.loc.start.column + 1, + global: false, + line: identifier.loc.start.line, + }; + } + return { + global: true, + }; + } + /** + * Checks if the initialization of a variable has the declare modifier in a + * definition file. + */ + function isDeclareInDTSFile(variable) { + const fileName = context.filename; + if (!(0, util_1.isDefinitionFile)(fileName)) { + return false; + } + return variable.defs.some(def => { + return ((def.type === scope_manager_1.DefinitionType.Variable && def.parent.declare) || + (def.type === scope_manager_1.DefinitionType.ClassName && def.node.declare) || + (def.type === scope_manager_1.DefinitionType.TSEnumName && def.node.declare) || + (def.type === scope_manager_1.DefinitionType.TSModuleName && def.node.declare)); + }); + } + /** + * Checks the current context for shadowed variables. + * @param scope Fixme + */ + function checkForShadows(scope) { + // ignore global augmentation + if (isGlobalAugmentation(scope)) { + return; + } + const variables = scope.variables; + for (const variable of variables) { + // ignore "arguments" + if (variable.identifiers.length === 0) { + continue; + } + // this params are pseudo-params that cannot be shadowed + if (isThisParam(variable)) { + continue; + } + // ignore variables of a class name in the class scope of ClassDeclaration + if (isDuplicatedClassNameVariable(variable)) { + continue; + } + // ignore variables of a class name in the class scope of ClassDeclaration + if (isDuplicatedEnumNameVariable(variable)) { + continue; + } + // ignore configured allowed names + if (isAllowed(variable)) { + continue; + } + // ignore variables with the declare keyword in .d.ts files + if (isDeclareInDTSFile(variable)) { + continue; + } + // Gets shadowed variable. + const shadowed = scope.upper + ? utils_1.ASTUtils.findVariable(scope.upper, variable.name) + : null; + if (!shadowed) { + continue; + } + // ignore type value variable shadowing if configured + if (isTypeValueShadow(variable, shadowed)) { + continue; + } + // ignore function type parameter name shadowing if configured + if (isFunctionTypeParameterNameValueShadow(variable, shadowed)) { + continue; + } + // ignore static class method generic shadowing class generic + // this is impossible for the scope analyser to understand + // so we have to handle this manually in this rule + if (isGenericOfAStaticMethodShadow(variable, shadowed)) { + continue; + } + if (isExternalDeclarationMerging(scope, variable, shadowed)) { + continue; + } + const isESLintGlobal = 'writeable' in shadowed; + if ((shadowed.identifiers.length > 0 || + (options.builtinGlobals && isESLintGlobal)) && + !isOnInitializer(variable, shadowed) && + !(options.ignoreOnInitialization && + isInitPatternNode(variable, shadowed)) && + !(options.hoist !== 'all' && isInTdz(variable, shadowed))) { + const location = getDeclaredLocation(shadowed); + context.report({ + node: variable.identifiers[0], + ...(location.global + ? { + messageId: 'noShadowGlobal', + data: { + name: variable.name, + }, + } + : { + messageId: 'noShadow', + data: { + name: variable.name, + shadowedColumn: location.column, + shadowedLine: location.line, + }, + }), + }); + } + } + } + return { + 'Program:exit'(node) { + const globalScope = context.sourceCode.getScope(node); + const stack = [...globalScope.childScopes]; + while (stack.length) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const scope = stack.pop(); + stack.push(...scope.childScopes); + checkForShadows(scope); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b583e528820746fb3a09cef2be816bb94c3ce10b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.d.ts @@ -0,0 +1,11 @@ +export type Options = [ + { + allowDestructuring?: boolean; + allowedNames?: string[]; + } +]; +export type MessageIds = 'thisAssignment' | 'thisDestructure'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js new file mode 100644 index 0000000000000000000000000000000000000000..f63fa3c68822a1d1d9b9a34aa421d87f5cc6dd88 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-this-alias.js @@ -0,0 +1,66 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-this-alias', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow aliasing `this`', + recommended: 'recommended', + }, + messages: { + thisAssignment: "Unexpected aliasing of 'this' to local variable.", + thisDestructure: "Unexpected aliasing of members of 'this' to local variables.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowDestructuring: { + type: 'boolean', + description: 'Whether to ignore destructurings, such as `const { props, state } = this`.', + }, + allowedNames: { + type: 'array', + description: 'Names to ignore, such as ["self"] for `const self = this;`.', + items: { + type: 'string', + }, + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowDestructuring: true, + allowedNames: [], + }, + ], + create(context, [{ allowDestructuring, allowedNames }]) { + return { + "VariableDeclarator[init.type='ThisExpression'], AssignmentExpression[right.type='ThisExpression']"(node) { + const id = node.type === utils_1.AST_NODE_TYPES.VariableDeclarator ? node.id : node.left; + if (allowDestructuring && id.type !== utils_1.AST_NODE_TYPES.Identifier) { + return; + } + const hasAllowedName = id.type === utils_1.AST_NODE_TYPES.Identifier + ? // https://github.com/typescript-eslint/typescript-eslint/issues/5439 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + allowedNames.includes(id.name) + : false; + if (!hasAllowedName) { + context.report({ + node: id, + messageId: id.type === utils_1.AST_NODE_TYPES.Identifier + ? 'thisAssignment' + : 'thisDestructure', + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bed9f0e20e22166def4bb78ba9b519f594be7620 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.d.ts @@ -0,0 +1,18 @@ +type Values = 'always' | 'in-intersections' | 'in-unions' | 'in-unions-and-intersections' | 'never'; +export type Options = [ + { + allowAliases?: Values; + allowCallbacks?: 'always' | 'never'; + allowConditionalTypes?: 'always' | 'never'; + allowConstructors?: 'always' | 'never'; + allowGenerics?: 'always' | 'never'; + allowLiterals?: Values; + allowMappedTypes?: Values; + allowTupleTypes?: Values; + } +]; +export type MessageIds = 'noCompositionAlias' | 'noTypeAlias'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js new file mode 100644 index 0000000000000000000000000000000000000000..63c39ee5e8b2f876ed80112b5923a5e6c9186ba3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-type-alias.js @@ -0,0 +1,268 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-type-alias', + meta: { + type: 'suggestion', + deprecated: { + deprecatedSince: '6.0.0', + replacedBy: [ + { + rule: { + name: '@typescript-eslint/consistent-type-definitions', + url: 'https://typescript-eslint.io/rules/consistent-type-definitions', + }, + }, + ], + url: 'https://github.com/typescript-eslint/typescript-eslint/pull/6229', + }, + docs: { + description: 'Disallow type aliases', + // too opinionated to be recommended + }, + messages: { + noCompositionAlias: '{{typeName}} in {{compositionType}} types are not allowed.', + noTypeAlias: 'Type {{alias}} are not allowed.', + }, + schema: [ + { + type: 'object', + $defs: { + expandedOptions: { + type: 'string', + enum: [ + 'always', + 'never', + 'in-unions', + 'in-intersections', + 'in-unions-and-intersections', + ], + }, + simpleOptions: { + type: 'string', + enum: ['always', 'never'], + }, + }, + additionalProperties: false, + properties: { + allowAliases: { + $ref: '#/items/0/$defs/expandedOptions', + description: 'Whether to allow direct one-to-one type aliases.', + }, + allowCallbacks: { + $ref: '#/items/0/$defs/simpleOptions', + description: 'Whether to allow type aliases for callbacks.', + }, + allowConditionalTypes: { + $ref: '#/items/0/$defs/simpleOptions', + description: 'Whether to allow type aliases for conditional types.', + }, + allowConstructors: { + $ref: '#/items/0/$defs/simpleOptions', + description: 'Whether to allow type aliases with constructors.', + }, + allowGenerics: { + $ref: '#/items/0/$defs/simpleOptions', + description: 'Whether to allow type aliases with generic types.', + }, + allowLiterals: { + $ref: '#/items/0/$defs/expandedOptions', + description: 'Whether to allow type aliases with object literal types.', + }, + allowMappedTypes: { + $ref: '#/items/0/$defs/expandedOptions', + description: 'Whether to allow type aliases with mapped types.', + }, + allowTupleTypes: { + $ref: '#/items/0/$defs/expandedOptions', + description: 'Whether to allow type aliases with tuple types.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowAliases: 'never', + allowCallbacks: 'never', + allowConditionalTypes: 'never', + allowConstructors: 'never', + allowGenerics: 'never', + allowLiterals: 'never', + allowMappedTypes: 'never', + allowTupleTypes: 'never', + }, + ], + create(context, [{ allowAliases, allowCallbacks, allowConditionalTypes, allowConstructors, allowGenerics, allowLiterals, allowMappedTypes, allowTupleTypes, },]) { + const unions = ['always', 'in-unions', 'in-unions-and-intersections']; + const intersections = [ + 'always', + 'in-intersections', + 'in-unions-and-intersections', + ]; + const compositions = [ + 'in-unions', + 'in-intersections', + 'in-unions-and-intersections', + ]; + const aliasTypes = new Set([ + utils_1.AST_NODE_TYPES.TSArrayType, + utils_1.AST_NODE_TYPES.TSImportType, + utils_1.AST_NODE_TYPES.TSIndexedAccessType, + utils_1.AST_NODE_TYPES.TSLiteralType, + utils_1.AST_NODE_TYPES.TSTemplateLiteralType, + utils_1.AST_NODE_TYPES.TSTypeQuery, + utils_1.AST_NODE_TYPES.TSTypeReference, + ]); + /** + * Determines if the composition type is supported by the allowed flags. + * @param isTopLevel a flag indicating this is the top level node. + * @param compositionType the composition type (either TSUnionType or TSIntersectionType) + * @param allowed the currently allowed flags. + */ + function isSupportedComposition(isTopLevel, compositionType, allowed) { + return (!compositions.includes(allowed) || + (!isTopLevel && + ((compositionType === utils_1.AST_NODE_TYPES.TSUnionType && + unions.includes(allowed)) || + (compositionType === utils_1.AST_NODE_TYPES.TSIntersectionType && + intersections.includes(allowed))))); + } + /** + * Gets the message to be displayed based on the node type and whether the node is a top level declaration. + * @param node the location + * @param compositionType the type of composition this alias is part of (undefined if not + * part of a composition) + * @param isRoot a flag indicating we are dealing with the top level declaration. + * @param type the kind of type alias being validated. + */ + function reportError(node, compositionType, isRoot, type) { + if (isRoot) { + return context.report({ + node, + messageId: 'noTypeAlias', + data: { + alias: type.toLowerCase(), + }, + }); + } + return context.report({ + node, + messageId: 'noCompositionAlias', + data: { + compositionType: compositionType === utils_1.AST_NODE_TYPES.TSUnionType + ? 'union' + : 'intersection', + typeName: type, + }, + }); + } + const isValidTupleType = (type) => { + if (type.node.type === utils_1.AST_NODE_TYPES.TSTupleType) { + return true; + } + if (type.node.type === utils_1.AST_NODE_TYPES.TSTypeOperator && + ['keyof', 'readonly'].includes(type.node.operator) && + type.node.typeAnnotation?.type === utils_1.AST_NODE_TYPES.TSTupleType) { + return true; + } + return false; + }; + const isValidGeneric = (type) => { + return (type.node.type === utils_1.AST_NODE_TYPES.TSTypeReference && + type.node.typeArguments != null); + }; + const checkAndReport = (optionValue, isTopLevel, type, label) => { + if (optionValue === 'never' || + !isSupportedComposition(isTopLevel, type.compositionType, optionValue)) { + reportError(type.node, type.compositionType, isTopLevel, label); + } + }; + /** + * Validates the node looking for aliases, callbacks and literals. + * @param type the type of composition this alias is part of (null if not + * part of a composition) + * @param isTopLevel a flag indicating this is the top level node. + */ + function validateTypeAliases(type, isTopLevel = false) { + // https://github.com/typescript-eslint/typescript-eslint/issues/5439 + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + if (type.node.type === utils_1.AST_NODE_TYPES.TSFunctionType) { + // callback + if (allowCallbacks === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Callbacks'); + } + } + else if (type.node.type === utils_1.AST_NODE_TYPES.TSConditionalType) { + // conditional type + if (allowConditionalTypes === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Conditional types'); + } + } + else if (type.node.type === utils_1.AST_NODE_TYPES.TSConstructorType) { + if (allowConstructors === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Constructors'); + } + } + else if (type.node.type === utils_1.AST_NODE_TYPES.TSTypeLiteral) { + // literal object type + checkAndReport(allowLiterals, isTopLevel, type, 'Literals'); + } + else if (type.node.type === utils_1.AST_NODE_TYPES.TSMappedType) { + // mapped type + checkAndReport(allowMappedTypes, isTopLevel, type, 'Mapped types'); + } + else if (isValidTupleType(type)) { + // tuple types + checkAndReport(allowTupleTypes, isTopLevel, type, 'Tuple Types'); + } + else if (isValidGeneric(type)) { + if (allowGenerics === 'never') { + reportError(type.node, type.compositionType, isTopLevel, 'Generics'); + } + } + else if (type.node.type.endsWith(utils_1.AST_TOKEN_TYPES.Keyword) || + aliasTypes.has(type.node.type) || + (type.node.type === utils_1.AST_NODE_TYPES.TSTypeOperator && + (type.node.operator === 'keyof' || + (type.node.operator === 'readonly' && + type.node.typeAnnotation && + aliasTypes.has(type.node.typeAnnotation.type))))) { + // alias / keyword + checkAndReport(allowAliases, isTopLevel, type, 'Aliases'); + } + else { + // unhandled type - shouldn't happen + reportError(type.node, type.compositionType, isTopLevel, 'Unhandled'); + } + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + } + /** + * Flatten the given type into an array of its dependencies + */ + function getTypes(node, compositionType = null) { + if (node.type === utils_1.AST_NODE_TYPES.TSUnionType || + node.type === utils_1.AST_NODE_TYPES.TSIntersectionType) { + return node.types.flatMap(type => getTypes(type, node.type)); + } + return [{ node, compositionType }]; + } + return { + TSTypeAliasDeclaration(node) { + const types = getTypes(node.typeAnnotation); + if (types.length === 1) { + // is a top level type annotation + validateTypeAliases(types[0], true); + } + else { + // is a composition type + types.forEach(type => { + validateTypeAliases(type); + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2ea3109a04ad9b5068a55c9f8e69cf981cb22b39 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.d.ts @@ -0,0 +1,12 @@ +export type MessageIds = 'comparingNullableToFalse' | 'comparingNullableToTrueDirect' | 'comparingNullableToTrueNegated' | 'direct' | 'negated' | 'noStrictNullCheck'; +export type Options = [ + { + allowComparingNullableBooleansToFalse?: boolean; + allowComparingNullableBooleansToTrue?: boolean; + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean; + } +]; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js new file mode 100644 index 0000000000000000000000000000000000000000..f2db70ac2dfdc440a20c30233c13c65e38bcffa5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-boolean-literal-compare.js @@ -0,0 +1,263 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-boolean-literal-compare', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unnecessary equality comparisons against boolean literals', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + comparingNullableToFalse: 'This expression unnecessarily compares a nullable boolean value to false instead of using the ?? operator to provide a default.', + comparingNullableToTrueDirect: 'This expression unnecessarily compares a nullable boolean value to true instead of using it directly.', + comparingNullableToTrueNegated: 'This expression unnecessarily compares a nullable boolean value to true instead of negating it.', + direct: 'This expression unnecessarily compares a boolean value to a boolean instead of using it directly.', + negated: 'This expression unnecessarily compares a boolean value to a boolean instead of negating it.', + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowComparingNullableBooleansToFalse: { + type: 'boolean', + description: 'Whether to allow comparisons between nullable boolean variables and `false`.', + }, + allowComparingNullableBooleansToTrue: { + type: 'boolean', + description: 'Whether to allow comparisons between nullable boolean variables and `true`.', + }, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + description: 'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowComparingNullableBooleansToFalse: true, + allowComparingNullableBooleansToTrue: true, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + if (!isStrictNullChecks && + options.allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { column: 0, line: 0 }, + end: { column: 0, line: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + function getBooleanComparison(node) { + const comparison = deconstructComparison(node); + if (!comparison) { + return undefined; + } + const { constraintType, isTypeParameter } = (0, util_1.getConstraintInfo)(checker, services.getTypeAtLocation(comparison.expression)); + if (isTypeParameter && constraintType == null) { + return undefined; + } + if (isBooleanType(constraintType)) { + return { + ...comparison, + expressionIsNullableBoolean: false, + }; + } + if (isNullableBoolean(constraintType)) { + return { + ...comparison, + expressionIsNullableBoolean: true, + }; + } + return undefined; + } + function isBooleanType(expressionType) { + return tsutils.isTypeFlagSet(expressionType, ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral); + } + /** + * checks if the expressionType is a union that + * 1) contains at least one nullish type (null or undefined) + * 2) contains at least once boolean type (true or false or boolean) + * 3) does not contain any types besides nullish and boolean types + */ + function isNullableBoolean(expressionType) { + if (!expressionType.isUnion()) { + return false; + } + const { types } = expressionType; + const nonNullishTypes = types.filter(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Undefined | ts.TypeFlags.Null)); + const hasNonNullishType = nonNullishTypes.length > 0; + if (!hasNonNullishType) { + return false; + } + const hasNullableType = nonNullishTypes.length < types.length; + if (!hasNullableType) { + return false; + } + const allNonNullishTypesAreBoolean = nonNullishTypes.every(isBooleanType); + if (!allNonNullishTypesAreBoolean) { + return false; + } + return true; + } + function deconstructComparison(node) { + const comparisonType = getEqualsKind(node.operator); + if (!comparisonType) { + return undefined; + } + for (const [against, expression] of [ + [node.right, node.left], + [node.left, node.right], + ]) { + if (against.type !== utils_1.AST_NODE_TYPES.Literal || + typeof against.value !== 'boolean') { + continue; + } + const { value: literalBooleanInComparison } = against; + const negated = !comparisonType.isPositive; + return { + expression, + literalBooleanInComparison, + negated, + }; + } + return undefined; + } + function nodeIsUnaryNegation(node) { + return (node.type === utils_1.AST_NODE_TYPES.UnaryExpression && + node.prefix && + node.operator === '!'); + } + return { + BinaryExpression(node) { + const comparison = getBooleanComparison(node); + if (comparison == null) { + return; + } + if (comparison.expressionIsNullableBoolean) { + if (comparison.literalBooleanInComparison && + options.allowComparingNullableBooleansToTrue) { + return; + } + if (!comparison.literalBooleanInComparison && + options.allowComparingNullableBooleansToFalse) { + return; + } + } + context.report({ + node, + messageId: comparison.expressionIsNullableBoolean + ? comparison.literalBooleanInComparison + ? comparison.negated + ? 'comparingNullableToTrueNegated' + : 'comparingNullableToTrueDirect' + : 'comparingNullableToFalse' + : comparison.negated + ? 'negated' + : 'direct', + *fix(fixer) { + // 1. isUnaryNegation - parent negation + // 2. literalBooleanInComparison - is compared to literal boolean + // 3. negated - is expression negated + const isUnaryNegation = nodeIsUnaryNegation(node.parent); + const shouldNegate = comparison.negated !== comparison.literalBooleanInComparison; + const mutatedNode = isUnaryNegation ? node.parent : node; + yield fixer.replaceText(mutatedNode, context.sourceCode.getText(comparison.expression)); + // if `isUnaryNegation === literalBooleanInComparison === !negated` is true - negate the expression + if (shouldNegate === isUnaryNegation) { + yield fixer.insertTextBefore(mutatedNode, '!'); + // if the expression `exp` is not a strong precedence node, wrap it in parentheses + if (!(0, util_1.isStrongPrecedenceNode)(comparison.expression)) { + yield fixer.insertTextBefore(mutatedNode, '('); + yield fixer.insertTextAfter(mutatedNode, ')'); + } + } + // if the expression `exp` is nullable, and we're not comparing to `true`, insert `?? true` + if (comparison.expressionIsNullableBoolean && + !comparison.literalBooleanInComparison) { + // provide the default `true` + yield fixer.insertTextBefore(mutatedNode, '('); + yield fixer.insertTextAfter(mutatedNode, ' ?? true)'); + } + }, + }); + }, + }; + }, +}); +function getEqualsKind(operator) { + switch (operator) { + case '!=': + return { + isPositive: false, + isStrict: false, + }; + case '!==': + return { + isPositive: false, + isStrict: true, + }; + case '==': + return { + isPositive: true, + isStrict: false, + }; + case '===': + return { + isPositive: true, + isStrict: true, + }; + default: + return undefined; + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..925abd15e141578b9882f22194feb134aa3166b4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.d.ts @@ -0,0 +1,14 @@ +type LegacyAllowConstantLoopConditions = boolean; +type AllowConstantLoopConditions = 'always' | 'never' | 'only-allowed-literals'; +export type Options = [ + { + allowConstantLoopConditions?: AllowConstantLoopConditions | LegacyAllowConstantLoopConditions; + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean; + checkTypePredicates?: boolean; + } +]; +export type MessageId = 'alwaysFalsy' | 'alwaysFalsyFunc' | 'alwaysNullish' | 'alwaysTruthy' | 'alwaysTruthyFunc' | 'comparisonBetweenLiteralTypes' | 'never' | 'neverNullish' | 'neverOptionalChain' | 'noOverlapBooleanExpression' | 'noStrictNullCheck' | 'suggestRemoveOptionalChain' | 'typeGuardAlreadyIsType'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js new file mode 100644 index 0000000000000000000000000000000000000000..4735eb7c305e00bb6a9a59bb0c0a947c45c4aeaa --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-condition.js @@ -0,0 +1,689 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const assertionFunctionUtils_1 = require("../util/assertionFunctionUtils"); +// #region +const nullishFlag = ts.TypeFlags.Undefined | ts.TypeFlags.Null; +function isNullishType(type) { + return tsutils.isTypeFlagSet(type, nullishFlag); +} +function isAlwaysNullish(type) { + return tsutils.unionConstituents(type).every(isNullishType); +} +/** + * Note that this differs from {@link isNullableType} in that it doesn't consider + * `any` or `unknown` to be nullable. + */ +function isPossiblyNullish(type) { + return tsutils + .unionConstituents(type) + .some(t => isNullishType(t) || (0, util_1.isTypeFlagSet)(t, ts.TypeFlags.Void)); +} +function toStaticValue(type) { + // type.isLiteral() only covers numbers/bigints and strings, hence the rest of the branches. + if (tsutils.isBooleanLiteralType(type)) { + return { value: tsutils.isTrueLiteralType(type) }; + } + if (type.flags === ts.TypeFlags.Undefined) { + return { value: undefined }; + } + if (type.flags === ts.TypeFlags.Null) { + return { value: null }; + } + if (type.isLiteral()) { + return { value: (0, util_1.getValueOfLiteralType)(type) }; + } + return undefined; +} +const BOOL_OPERATORS = new Set([ + '<', + '>', + '<=', + '>=', + '==', + '===', + '!=', + '!==', +]); +function isBoolOperator(operator) { + return BOOL_OPERATORS.has(operator); +} +function booleanComparison(left, operator, right) { + switch (operator) { + case '!=': + // eslint-disable-next-line eqeqeq -- intentionally comparing with loose equality + return left != right; + case '!==': + return left !== right; + case '<': + // @ts-expect-error: we don't care if the comparison seems unintentional. + return left < right; + case '<=': + // @ts-expect-error: we don't care if the comparison seems unintentional. + return left <= right; + case '==': + // eslint-disable-next-line eqeqeq -- intentionally comparing with loose equality + return left == right; + case '===': + return left === right; + case '>': + // @ts-expect-error: we don't care if the comparison seems unintentional. + return left > right; + case '>=': + // @ts-expect-error: we don't care if the comparison seems unintentional. + return left >= right; + } +} +const constantLoopConditionsAllowedLiterals = new Set([ + true, + false, + 1, + 0, +]); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-condition', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow conditionals where the type is always truthy or always falsy', + recommended: 'strict', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + alwaysFalsy: 'Unnecessary conditional, value is always falsy.', + alwaysFalsyFunc: 'This callback should return a conditional, but return is always falsy.', + alwaysNullish: 'Unnecessary conditional, left-hand side of `??` operator is always `null` or `undefined`.', + alwaysTruthy: 'Unnecessary conditional, value is always truthy.', + alwaysTruthyFunc: 'This callback should return a conditional, but return is always truthy.', + comparisonBetweenLiteralTypes: 'Unnecessary conditional, comparison is always {{trueOrFalse}}, since `{{left}} {{operator}} {{right}}` is {{trueOrFalse}}.', + never: 'Unnecessary conditional, value is `never`.', + neverNullish: 'Unnecessary conditional, expected left-hand side of `??` operator to be possibly null or undefined.', + neverOptionalChain: 'Unnecessary optional chain on a non-nullish value.', + noOverlapBooleanExpression: 'Unnecessary conditional, the types have no overlap.', + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + suggestRemoveOptionalChain: 'Remove unnecessary optional chain', + typeGuardAlreadyIsType: 'Unnecessary conditional, expression already has the type being checked by the {{typeGuardOrAssertionFunction}}.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowConstantLoopConditions: { + description: 'Whether to ignore constant loop conditions, such as `while (true)`.', + oneOf: [ + { + type: 'boolean', + description: 'Always ignore or not ignore the loop conditions', + }, + { + type: 'string', + description: 'Which situations to ignore constant conditions in.', + enum: ['always', 'never', 'only-allowed-literals'], + }, + ], + }, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + description: 'Whether to not error when running with a tsconfig that has strictNullChecks turned.', + }, + checkTypePredicates: { + type: 'boolean', + description: 'Whether to check the asserted argument of a type predicate function for unnecessary conditions', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowConstantLoopConditions: 'never', + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + checkTypePredicates: false, + }, + ], + create(context, [{ allowConstantLoopConditions, allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing, checkTypePredicates, },]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + const isNoUncheckedIndexedAccess = tsutils.isCompilerOptionEnabled(compilerOptions, 'noUncheckedIndexedAccess'); + const allowConstantLoopConditionsOption = normalizeAllowConstantLoopConditions( + // https://github.com/typescript-eslint/typescript-eslint/issues/5439 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + allowConstantLoopConditions); + if (!isStrictNullChecks && + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { column: 0, line: 0 }, + end: { column: 0, line: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + function nodeIsArrayType(node) { + const nodeType = (0, util_1.getConstrainedTypeAtLocation)(services, node); + return tsutils + .unionConstituents(nodeType) + .some(part => checker.isArrayType(part)); + } + function nodeIsTupleType(node) { + const nodeType = (0, util_1.getConstrainedTypeAtLocation)(services, node); + return tsutils + .unionConstituents(nodeType) + .some(part => checker.isTupleType(part)); + } + function isArrayIndexExpression(node) { + return ( + // Is an index signature + node.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.computed && + // ...into an array type + (nodeIsArrayType(node.object) || + // ... or a tuple type + (nodeIsTupleType(node.object) && + // Exception: literal index into a tuple - will have a sound type + node.property.type !== utils_1.AST_NODE_TYPES.Literal))); + } + // Conditional is always necessary if it involves: + // `any` or `unknown` or a naked type variable + function isConditionalAlwaysNecessary(type) { + return tsutils + .unionConstituents(type) + .some(part => (0, util_1.isTypeAnyType)(part) || + (0, util_1.isTypeUnknownType)(part) || + (0, util_1.isTypeFlagSet)(part, ts.TypeFlags.TypeVariable)); + } + function isNullableMemberExpression(node) { + const objectType = services.getTypeAtLocation(node.object); + if (node.computed) { + const propertyType = services.getTypeAtLocation(node.property); + return isNullablePropertyType(objectType, propertyType); + } + const property = node.property; + // Get the actual property name, to account for private properties (this.#prop). + const propertyName = context.sourceCode.getText(property); + const propertyType = objectType + .getProperties() + .find(prop => prop.name === propertyName); + if (propertyType && + tsutils.isSymbolFlagSet(propertyType, ts.SymbolFlags.Optional)) { + return true; + } + return false; + } + /** + * Checks if a conditional node is necessary: + * if the type of the node is always true or always false, it's not necessary. + */ + function checkNode(expression, isUnaryNotArgument = false, node = expression) { + // Check if the node is Unary Negation expression and handle it + if (expression.type === utils_1.AST_NODE_TYPES.UnaryExpression && + expression.operator === '!') { + return checkNode(expression.argument, !isUnaryNotArgument, node); + } + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (!isNoUncheckedIndexedAccess && isArrayIndexExpression(expression)) { + return; + } + // When checking logical expressions, only check the right side + // as the left side has been checked by checkLogicalExpressionForUnnecessaryConditionals + // + // Unless the node is nullish coalescing, as it's common to use patterns like `nullBool ?? true` to to strict + // boolean checks if we inspect the right here, it'll usually be a constant condition on purpose. + // In this case it's better to inspect the type of the expression as a whole. + if (expression.type === utils_1.AST_NODE_TYPES.LogicalExpression && + expression.operator !== '??') { + return checkNode(expression.right); + } + const type = (0, util_1.getConstrainedTypeAtLocation)(services, expression); + if (isConditionalAlwaysNecessary(type)) { + return; + } + let messageId = null; + if ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Never)) { + messageId = 'never'; + } + else if (!(0, util_1.isPossiblyTruthy)(type)) { + messageId = !isUnaryNotArgument ? 'alwaysFalsy' : 'alwaysTruthy'; + } + else if (!(0, util_1.isPossiblyFalsy)(type)) { + messageId = !isUnaryNotArgument ? 'alwaysTruthy' : 'alwaysFalsy'; + } + if (messageId) { + context.report({ node, messageId }); + } + } + function checkNodeForNullish(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + // Conditional is always necessary if it involves `any`, `unknown` or a naked type parameter + if ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.TypeParameter | + ts.TypeFlags.TypeVariable)) { + return; + } + let messageId = null; + if ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Never)) { + messageId = 'never'; + } + else if (!isPossiblyNullish(type) && + !(node.type === utils_1.AST_NODE_TYPES.MemberExpression && + isNullableMemberExpression(node))) { + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (isNoUncheckedIndexedAccess || + (!isArrayIndexExpression(node) && + !(node.type === utils_1.AST_NODE_TYPES.ChainExpression && + node.expression.type !== utils_1.AST_NODE_TYPES.TSNonNullExpression && + optionChainContainsOptionArrayIndex(node.expression)))) { + messageId = 'neverNullish'; + } + } + else if (isAlwaysNullish(type)) { + messageId = 'alwaysNullish'; + } + if (messageId) { + context.report({ node, messageId }); + } + } + /** + * Checks that a binary expression is necessarily conditional, reports otherwise. + * If both sides of the binary expression are literal values, it's not a necessary condition. + * + * NOTE: It's also unnecessary if the types that don't overlap at all + * but that case is handled by the Typescript compiler itself. + * Known exceptions: + * - https://github.com/microsoft/TypeScript/issues/32627 + * - https://github.com/microsoft/TypeScript/issues/37160 (handled) + */ + function checkIfBoolExpressionIsNecessaryConditional(node, left, right, operator) { + const leftType = (0, util_1.getConstrainedTypeAtLocation)(services, left); + const rightType = (0, util_1.getConstrainedTypeAtLocation)(services, right); + const leftStaticValue = toStaticValue(leftType); + const rightStaticValue = toStaticValue(rightType); + if (leftStaticValue != null && rightStaticValue != null) { + const conditionIsTrue = booleanComparison(leftStaticValue.value, operator, rightStaticValue.value); + context.report({ + node, + messageId: 'comparisonBetweenLiteralTypes', + data: { + left: checker.typeToString(leftType), + operator, + right: checker.typeToString(rightType), + trueOrFalse: conditionIsTrue ? 'true' : 'false', + }, + }); + return; + } + // Workaround for https://github.com/microsoft/TypeScript/issues/37160 + if (isStrictNullChecks) { + const UNDEFINED = ts.TypeFlags.Undefined; + const NULL = ts.TypeFlags.Null; + const VOID = ts.TypeFlags.Void; + const isComparable = (type, flag) => { + // Allow comparison to `any`, `unknown` or a naked type parameter. + flag |= + ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.TypeParameter | + ts.TypeFlags.TypeVariable; + // Allow loose comparison to nullish values. + if (operator === '==' || operator === '!=') { + flag |= NULL | UNDEFINED | VOID; + } + return (0, util_1.isTypeFlagSet)(type, flag); + }; + if ((leftType.flags === UNDEFINED && + !isComparable(rightType, UNDEFINED | VOID)) || + (rightType.flags === UNDEFINED && + !isComparable(leftType, UNDEFINED | VOID)) || + (leftType.flags === NULL && !isComparable(rightType, NULL)) || + (rightType.flags === NULL && !isComparable(leftType, NULL))) { + context.report({ node, messageId: 'noOverlapBooleanExpression' }); + return; + } + } + } + /** + * Checks that a logical expression contains a boolean, reports otherwise. + */ + function checkLogicalExpressionForUnnecessaryConditionals(node) { + if (node.operator === '??') { + checkNodeForNullish(node.left); + return; + } + // Only checks the left side, since the right side might not be "conditional" at all. + // The right side will be checked if the LogicalExpression is used in a conditional context + checkNode(node.left); + } + /** + * Checks that a testable expression of a loop is necessarily conditional, reports otherwise. + */ + function checkIfLoopIsNecessaryConditional(node) { + if (node.test == null) { + // e.g. `for(;;)` + return; + } + if (allowConstantLoopConditionsOption === 'only-allowed-literals' && + node.test.type === utils_1.AST_NODE_TYPES.Literal && + constantLoopConditionsAllowedLiterals.has(node.test.value)) { + return; + } + if (allowConstantLoopConditionsOption === 'always' && + tsutils.isTrueLiteralType((0, util_1.getConstrainedTypeAtLocation)(services, node.test))) { + return; + } + checkNode(node.test); + } + function checkCallExpression(node) { + if (checkTypePredicates) { + const truthinessAssertedArgument = (0, assertionFunctionUtils_1.findTruthinessAssertedArgument)(services, node); + if (truthinessAssertedArgument != null) { + checkNode(truthinessAssertedArgument); + } + const typeGuardAssertedArgument = (0, assertionFunctionUtils_1.findTypeGuardAssertedArgument)(services, node); + if (typeGuardAssertedArgument != null) { + const typeOfArgument = (0, util_1.getConstrainedTypeAtLocation)(services, typeGuardAssertedArgument.argument); + if ( + // Skip `any` — it is assignable to everything, producing + // false positives for meaningful runtime type guards. + !tsutils.isTypeFlagSet(typeOfArgument, ts.TypeFlags.Any | ts.TypeFlags.Unknown) && + checker.isTypeAssignableTo(typeOfArgument, typeGuardAssertedArgument.type) && + // Only flag if the types are mutually assignable (i.e. equivalent, + // like Narrower ↔ Wider with optional props) or the predicate type + // is a union that the argument is a strict subtype of. This avoids + // false positives with structural subtypes whose extra members are + // all optional in the *predicate* type (e.g. custom MappedType + // interfaces extending ts.Type). + (checker.isTypeAssignableTo(typeGuardAssertedArgument.type, typeOfArgument) || + typeGuardAssertedArgument.type.isUnion())) { + context.report({ + node: typeGuardAssertedArgument.argument, + messageId: 'typeGuardAlreadyIsType', + data: { + typeGuardOrAssertionFunction: typeGuardAssertedArgument.asserts + ? 'assertion function' + : 'type guard', + }, + }); + } + } + } + // If this is something like arr.filter(x => /*condition*/), check `condition` + if ((0, util_1.isArrayMethodCallWithPredicate)(context, services, node) && + node.arguments.length) { + const callback = node.arguments[0]; + // Inline defined functions + if (callback.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + callback.type === utils_1.AST_NODE_TYPES.FunctionExpression) { + // Two special cases, where we can directly check the node that's returned: + // () => something + if (callback.body.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + return checkNode(callback.body); + } + // () => { return something; } + const callbackBody = callback.body.body; + if (callbackBody.length === 1 && + callbackBody[0].type === utils_1.AST_NODE_TYPES.ReturnStatement && + callbackBody[0].argument) { + return checkNode(callbackBody[0].argument); + } + // Potential enhancement: could use code-path analysis to check + // any function with a single return statement + // (Value to complexity ratio is dubious however) + } + // Otherwise just do type analysis on the function as a whole. + const returnTypes = tsutils + .getCallSignaturesOfType((0, util_1.getConstrainedTypeAtLocation)(services, callback)) + .map(sig => sig.getReturnType()); + if (returnTypes.length === 0) { + // Not a callable function, e.g. `any` + return; + } + let hasFalsyReturnTypes = false; + let hasTruthyReturnTypes = false; + for (const type of returnTypes) { + const { constraintType } = (0, util_1.getConstraintInfo)(checker, type); + // Predicate is always necessary if it involves `any` or `unknown` + if (!constraintType || + (0, util_1.isTypeAnyType)(constraintType) || + (0, util_1.isTypeUnknownType)(constraintType)) { + return; + } + if ((0, util_1.isPossiblyFalsy)(constraintType)) { + hasFalsyReturnTypes = true; + } + if ((0, util_1.isPossiblyTruthy)(constraintType)) { + hasTruthyReturnTypes = true; + } + // bail early if both a possibly-truthy and a possibly-falsy have been detected + if (hasFalsyReturnTypes && hasTruthyReturnTypes) { + return; + } + } + if (!hasFalsyReturnTypes) { + return context.report({ + node: callback, + messageId: 'alwaysTruthyFunc', + }); + } + if (!hasTruthyReturnTypes) { + return context.report({ + node: callback, + messageId: 'alwaysFalsyFunc', + }); + } + } + } + // Recursively searches an optional chain for an array index expression + // Has to search the entire chain, because an array index will "infect" the rest of the types + // Example: + // ``` + // [{x: {y: "z"} }][n] // type is {x: {y: "z"}} + // ?.x // type is {y: "z"} + // ?.y // This access is considered "unnecessary" according to the types + // ``` + function optionChainContainsOptionArrayIndex(node) { + const lhsNode = node.type === utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node.object; + if (node.optional && isArrayIndexExpression(lhsNode)) { + return true; + } + if (lhsNode.type === utils_1.AST_NODE_TYPES.MemberExpression || + lhsNode.type === utils_1.AST_NODE_TYPES.CallExpression) { + return optionChainContainsOptionArrayIndex(lhsNode); + } + return false; + } + function isNullablePropertyType(objType, propertyType) { + if (propertyType.isUnion()) { + return propertyType.types.some(type => isNullablePropertyType(objType, type)); + } + if (propertyType.isNumberLiteral() || propertyType.isStringLiteral()) { + const propType = (0, util_1.getTypeOfPropertyOfName)(checker, objType, propertyType.value.toString()); + if (propType) { + return (0, util_1.isNullableType)(propType); + } + } + const typeName = (0, util_1.getTypeName)(checker, propertyType); + return checker + .getIndexInfosOfType(objType) + .some(info => (0, util_1.getTypeName)(checker, info.keyType) === typeName); + } + // Checks whether a member expression is nullable or not regardless of it's previous node. + // Example: + // ``` + // // 'bar' is nullable if 'foo' is null. + // // but this function checks regardless of 'foo' type, so returns 'true'. + // declare const foo: { bar : { baz: string } } | null + // foo?.bar; + // ``` + function isMemberExpressionNullableOriginFromObject(node) { + const prevType = (0, util_1.getConstrainedTypeAtLocation)(services, node.object); + const property = node.property; + if (prevType.isUnion() && (0, util_1.isIdentifier)(property)) { + const isOwnNullable = prevType.types.some(type => { + if (node.computed) { + const propertyType = (0, util_1.getConstrainedTypeAtLocation)(services, node.property); + return isNullablePropertyType(type, propertyType); + } + const propType = (0, util_1.getTypeOfPropertyOfName)(checker, type, property.name); + if (propType) { + return (0, util_1.isNullableType)(propType); + } + const indexInfo = checker.getIndexInfosOfType(type); + return indexInfo.some(info => { + const isStringTypeName = (0, util_1.getTypeName)(checker, info.keyType) === 'string'; + return (isStringTypeName && + (isNoUncheckedIndexedAccess || (0, util_1.isNullableType)(info.type))); + }); + }); + return !isOwnNullable && (0, util_1.isNullableType)(prevType); + } + return false; + } + function isCallExpressionNullableOriginFromCallee(node) { + const prevType = (0, util_1.getConstrainedTypeAtLocation)(services, node.callee); + if (prevType.isUnion()) { + const isOwnNullable = prevType.types.some(type => { + const signatures = type.getCallSignatures(); + return signatures.some(sig => (0, util_1.isNullableType)(sig.getReturnType())); + }); + return !isOwnNullable && (0, util_1.isNullableType)(prevType); + } + return false; + } + function isOptionableExpression(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + const isOwnNullable = node.type === utils_1.AST_NODE_TYPES.MemberExpression + ? !isMemberExpressionNullableOriginFromObject(node) + : node.type === utils_1.AST_NODE_TYPES.CallExpression + ? !isCallExpressionNullableOriginFromCallee(node) + : true; + return (isConditionalAlwaysNecessary(type) || + (isOwnNullable && (0, util_1.isNullableType)(type))); + } + function checkOptionalChain(node, beforeOperator, fix) { + // We only care if this step in the chain is optional. If just descend + // from an optional chain, then that's fine. + if (!node.optional) { + return; + } + // Since typescript array index signature types don't represent the + // possibility of out-of-bounds access, if we're indexing into an array + // just skip the check, to avoid false positives + if (!isNoUncheckedIndexedAccess && + optionChainContainsOptionArrayIndex(node)) { + return; + } + const nodeToCheck = node.type === utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node.object; + if (isOptionableExpression(nodeToCheck)) { + return; + } + const questionDotOperator = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(beforeOperator, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && token.value === '?.'), util_1.NullThrowsReasons.MissingToken('operator', node.type)); + context.report({ + loc: questionDotOperator.loc, + node, + messageId: 'neverOptionalChain', + suggest: [ + { + messageId: 'suggestRemoveOptionalChain', + fix(fixer) { + return fixer.replaceText(questionDotOperator, fix); + }, + }, + ], + }); + } + function checkOptionalMemberExpression(node) { + checkOptionalChain(node, node.object, node.computed ? '' : '.'); + } + function checkOptionalCallExpression(node) { + checkOptionalChain(node, node.callee, ''); + } + function checkAssignmentExpression(node) { + // Similar to checkLogicalExpressionForUnnecessaryConditionals, since + // a ||= b is equivalent to a || (a = b) + if (['&&=', '||='].includes(node.operator)) { + checkNode(node.left); + } + else if (node.operator === '??=') { + checkNodeForNullish(node.left); + } + } + return { + AssignmentExpression: checkAssignmentExpression, + BinaryExpression(node) { + const { operator } = node; + if (isBoolOperator(operator)) { + checkIfBoolExpressionIsNecessaryConditional(node, node.left, node.right, operator); + } + }, + CallExpression: checkCallExpression, + 'CallExpression[optional = true]': checkOptionalCallExpression, + ConditionalExpression: (node) => checkNode(node.test), + DoWhileStatement: checkIfLoopIsNecessaryConditional, + ForStatement: checkIfLoopIsNecessaryConditional, + IfStatement: (node) => checkNode(node.test), + LogicalExpression: checkLogicalExpressionForUnnecessaryConditionals, + 'MemberExpression[optional = true]': checkOptionalMemberExpression, + SwitchCase({ parent, test }) { + // only check `case ...:`, not `default:` + if (test) { + checkIfBoolExpressionIsNecessaryConditional(test, parent.discriminant, test, '==='); + } + }, + WhileStatement: checkIfLoopIsNecessaryConditional, + }; + }, +}); +function normalizeAllowConstantLoopConditions(allowConstantLoopConditions) { + if (allowConstantLoopConditions === true) { + return 'always'; + } + if (allowConstantLoopConditions === false) { + return 'never'; + } + return allowConstantLoopConditions; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1d5d823134b348ba127f47c40d77328a1b25a213 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unnecessaryAssign", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.js new file mode 100644 index 0000000000000000000000000000000000000000..f4c90773b319b486f0a3ef5e7284dbda101c95bb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-parameter-property-assignment.js @@ -0,0 +1,148 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const UNNECESSARY_OPERATORS = new Set(['??=', '&&=', '=', '||=']); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-parameter-property-assignment', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unnecessary assignment of constructor property parameter', + }, + messages: { + unnecessaryAssign: 'This assignment is unnecessary since it is already assigned by a parameter property.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const reportInfoStack = []; + function isThisMemberExpression(node) { + return (node.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.object.type === utils_1.AST_NODE_TYPES.ThisExpression); + } + function getPropertyName(node) { + if (!isThisMemberExpression(node)) { + return null; + } + if (node.property.type === utils_1.AST_NODE_TYPES.Identifier) { + return node.property.name; + } + if (node.computed) { + return (0, util_1.getStaticStringValue)(node.property); + } + return null; + } + function findParentFunction(node) { + if (!node || + node.type === utils_1.AST_NODE_TYPES.FunctionDeclaration || + node.type === utils_1.AST_NODE_TYPES.FunctionExpression || + node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + return node; + } + return findParentFunction(node.parent); + } + function findParentPropertyDefinition(node) { + if (!node || node.type === utils_1.AST_NODE_TYPES.PropertyDefinition) { + return node; + } + return findParentPropertyDefinition(node.parent); + } + function isConstructorFunctionExpression(node) { + return (node?.type === utils_1.AST_NODE_TYPES.FunctionExpression && + utils_1.ASTUtils.isConstructor(node.parent)); + } + function isReferenceFromParameter(node) { + const scope = context.sourceCode.getScope(node); + const rightRef = scope.references.find(ref => ref.identifier.name === node.name); + return rightRef?.resolved?.defs.at(0)?.type === scope_manager_1.DefinitionType.Parameter; + } + function isParameterPropertyWithName(node, name) { + return (node.type === utils_1.AST_NODE_TYPES.TSParameterProperty && + ((node.parameter.type === utils_1.AST_NODE_TYPES.Identifier && // constructor (public foo) {} + node.parameter.name === name) || + (node.parameter.type === utils_1.AST_NODE_TYPES.AssignmentPattern && // constructor (public foo = 1) {} + node.parameter.left.name === name))); + } + function getIdentifier(node) { + if (node.type === utils_1.AST_NODE_TYPES.Identifier) { + return node; + } + if (node.type === utils_1.AST_NODE_TYPES.TSAsExpression || + node.type === utils_1.AST_NODE_TYPES.TSNonNullExpression) { + return getIdentifier(node.expression); + } + return null; + } + function isArrowIIFE(node) { + return (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + node.parent.type === utils_1.AST_NODE_TYPES.CallExpression); + } + return { + ClassBody() { + reportInfoStack.push({ + assignedBeforeConstructor: new Set(), + assignedBeforeUnnecessary: new Set(), + unnecessaryAssignments: [], + }); + }, + 'ClassBody:exit'() { + const { assignedBeforeConstructor, unnecessaryAssignments } = (0, util_1.nullThrows)(reportInfoStack.pop(), 'The top stack should exist'); + unnecessaryAssignments.forEach(({ name, node }) => { + if (assignedBeforeConstructor.has(name)) { + return; + } + context.report({ + node, + messageId: 'unnecessaryAssign', + }); + }); + }, + "MethodDefinition[kind='constructor'] > FunctionExpression AssignmentExpression"(node) { + const leftName = getPropertyName(node.left); + if (!leftName) { + return; + } + let functionNode = findParentFunction(node); + if (functionNode && isArrowIIFE(functionNode)) { + functionNode = findParentFunction(functionNode.parent); + } + if (!isConstructorFunctionExpression(functionNode)) { + return; + } + const { assignedBeforeUnnecessary, unnecessaryAssignments } = (0, util_1.nullThrows)(reportInfoStack.at(reportInfoStack.length - 1), 'The top of stack should exist'); + if (!UNNECESSARY_OPERATORS.has(node.operator)) { + assignedBeforeUnnecessary.add(leftName); + return; + } + const rightId = getIdentifier(node.right); + if (leftName !== rightId?.name || !isReferenceFromParameter(rightId)) { + return; + } + const hasParameterProperty = functionNode.params.some(param => isParameterPropertyWithName(param, rightId.name)); + if (hasParameterProperty && !assignedBeforeUnnecessary.has(leftName)) { + unnecessaryAssignments.push({ + name: leftName, + node, + }); + } + }, + 'PropertyDefinition AssignmentExpression'(node) { + const name = getPropertyName(node.left); + if (!name) { + return; + } + const functionNode = findParentFunction(node); + if (functionNode && + !(isArrowIIFE(functionNode) && + findParentPropertyDefinition(node)?.value === functionNode.parent)) { + return; + } + const { assignedBeforeConstructor } = (0, util_1.nullThrows)(reportInfoStack.at(-1), 'The top stack should exist'); + assignedBeforeConstructor.add(name); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc69e9075ff53b235fde37f69b40176c883ecf05 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unnecessaryQualifier", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js new file mode 100644 index 0000000000000000000000000000000000000000..bd0d2fbdf126bfd947d94b09b19487a011bdd9c2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-qualifier.js @@ -0,0 +1,156 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-qualifier', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unnecessary namespace qualifiers', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + unnecessaryQualifier: "Qualifier is unnecessary since '{{ name }}' is in scope.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const namespacesInScope = []; + let currentFailedNamespaceExpression = null; + const services = (0, util_1.getParserServices)(context); + const esTreeNodeToTSNodeMap = services.esTreeNodeToTSNodeMap; + const checker = services.program.getTypeChecker(); + function tryGetAliasedSymbol(symbol, checker) { + return tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias) + ? checker.getAliasedSymbol(symbol) + : null; + } + function symbolIsNamespaceInScope(symbol) { + const symbolDeclarations = symbol.getDeclarations() ?? []; + if (symbolDeclarations.some(decl => namespacesInScope.some(ns => ns === decl))) { + return true; + } + const alias = tryGetAliasedSymbol(symbol, checker); + return alias != null && symbolIsNamespaceInScope(alias); + } + function getSymbolInScope(node, flags, name) { + const scope = checker.getSymbolsInScope(node, flags); + return scope.find(scopeSymbol => scopeSymbol.name === name); + } + function symbolsAreEqual(accessed, inScope) { + return accessed === checker.getExportSymbolOfSymbol(inScope); + } + function qualifierIsUnnecessary(qualifier, name) { + const namespaceSymbol = services.getSymbolAtLocation(qualifier); + if (namespaceSymbol == null || + !symbolIsNamespaceInScope(namespaceSymbol)) { + return false; + } + const accessedSymbol = services.getSymbolAtLocation(name); + if (accessedSymbol == null) { + return false; + } + // If the symbol in scope is different, the qualifier is necessary. + const tsQualifier = esTreeNodeToTSNodeMap.get(qualifier); + const fromScope = getSymbolInScope(tsQualifier, accessedSymbol.flags, context.sourceCode.getText(name)); + return !!fromScope && symbolsAreEqual(accessedSymbol, fromScope); + } + function visitNamespaceAccess(node, qualifier, name) { + // Only look for nested qualifier errors if we didn't already fail on the outer qualifier. + if (!currentFailedNamespaceExpression && + qualifierIsUnnecessary(qualifier, name)) { + currentFailedNamespaceExpression = node; + context.report({ + node: qualifier, + messageId: 'unnecessaryQualifier', + data: { + name: context.sourceCode.getText(name), + }, + fix(fixer) { + return fixer.removeRange([qualifier.range[0], name.range[0]]); + }, + }); + } + } + function enterDeclaration(node) { + namespacesInScope.push(esTreeNodeToTSNodeMap.get(node)); + } + function exitDeclaration() { + namespacesInScope.pop(); + } + function resetCurrentNamespaceExpression(node) { + if (node === currentFailedNamespaceExpression) { + currentFailedNamespaceExpression = null; + } + } + function isPropertyAccessExpression(node) { + return node.type === utils_1.AST_NODE_TYPES.MemberExpression && !node.computed; + } + function isEntityNameExpression(node) { + return (node.type === utils_1.AST_NODE_TYPES.Identifier || + (isPropertyAccessExpression(node) && + isEntityNameExpression(node.object))); + } + return { + 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]': enterDeclaration, + 'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit': exitDeclaration, + 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]': enterDeclaration, + 'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit': exitDeclaration, + 'MemberExpression:exit': resetCurrentNamespaceExpression, + 'MemberExpression[computed=false]'(node) { + const property = node.property; + if (isEntityNameExpression(node.object)) { + visitNamespaceAccess(node, node.object, property); + } + }, + TSEnumDeclaration: enterDeclaration, + 'TSEnumDeclaration:exit': exitDeclaration, + 'TSModuleDeclaration:exit': exitDeclaration, + 'TSModuleDeclaration > TSModuleBlock'(node) { + enterDeclaration(node.parent); + }, + TSQualifiedName(node) { + visitNamespaceAccess(node, node.left, node.right); + }, + 'TSQualifiedName:exit': resetCurrentNamespaceExpression, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cacc754902f41afcf441ce4c9a162307468cca6a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.d.ts @@ -0,0 +1,6 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type MessageId = 'noUnnecessaryTemplateExpression'; +declare const _default: TSESLint.RuleModule<"noUnnecessaryTemplateExpression", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.js new file mode 100644 index 0000000000000000000000000000000000000000..bd7a47751bbb89b7c6c04304a2036eaeeaa86599 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-template-expression.js @@ -0,0 +1,361 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const rangeToLoc_1 = require("../util/rangeToLoc"); +const evenNumOfBackslashesRegExp = /(? { + const symbol = t.getSymbol(); + return !!(symbol?.valueDeclaration && ts.isEnumMember(symbol.valueDeclaration)); + }); + } + const isLiteral = (0, util_1.isNodeOfType)(utils_1.TSESTree.AST_NODE_TYPES.Literal); + function isTemplateLiteral(node) { + return node.type === utils_1.AST_NODE_TYPES.TemplateLiteral; + } + function isInfinityIdentifier(node) { + return (node.type === utils_1.AST_NODE_TYPES.Identifier && node.name === 'Infinity'); + } + function isNaNIdentifier(node) { + return node.type === utils_1.AST_NODE_TYPES.Identifier && node.name === 'NaN'; + } + function isFixableIdentifier(node) { + return ((0, util_1.isUndefinedIdentifier)(node) || + isInfinityIdentifier(node) || + isNaNIdentifier(node)); + } + function hasCommentsBetweenQuasi(startQuasi, endQuasi) { + const startToken = (0, util_1.nullThrows)(context.sourceCode.getTokenByRangeStart(startQuasi.range[0]), util_1.NullThrowsReasons.MissingToken('`${', 'opening template literal')); + const endToken = (0, util_1.nullThrows)(context.sourceCode.getTokenByRangeStart(endQuasi.range[0]), util_1.NullThrowsReasons.MissingToken('}', 'closing template literal')); + return context.sourceCode.commentsExistBetween(startToken, endToken); + } + function isTrivialInterpolation(node) { + return (node.quasis.length === 2 && + node.quasis[0].value.raw === '' && + node.quasis[1].value.raw === ''); + } + function getInterpolations(node) { + if (node.type === utils_1.AST_NODE_TYPES.TemplateLiteral) { + return node.expressions; + } + return node.types; + } + function getInterpolationInfos(node) { + return getInterpolations(node).map((interpolation, index) => ({ + interpolation, + nextQuasi: node.quasis[index + 1], + prevQuasi: node.quasis[index], + })); + } + function getLiteral(node) { + const maybeLiteral = node.type === utils_1.AST_NODE_TYPES.TSLiteralType ? node.literal : node; + return isLiteral(maybeLiteral) ? maybeLiteral : null; + } + function getTemplateLiteral(node) { + const maybeTemplateLiteral = node.type === utils_1.AST_NODE_TYPES.TSLiteralType ? node.literal : node; + return isTemplateLiteral(maybeTemplateLiteral) + ? maybeTemplateLiteral + : null; + } + function reportSingleInterpolation(node) { + const interpolations = getInterpolations(node); + context.report({ + loc: (0, rangeToLoc_1.rangeToLoc)(context.sourceCode, [ + interpolations[0].range[0] - 2, + interpolations[0].range[1] + 1, + ]), + messageId: 'noUnnecessaryTemplateExpression', + fix(fixer) { + const wrappingCode = (0, util_1.getMovedNodeCode)({ + destinationNode: node, + nodeToMove: interpolations[0], + sourceCode: context.sourceCode, + }); + return fixer.replaceText(node, wrappingCode); + }, + }); + } + function isUnnecessaryValueInterpolation({ interpolation, nextQuasi, prevQuasi, }) { + if (hasCommentsBetweenQuasi(prevQuasi, nextQuasi)) { + return false; + } + if (isFixableIdentifier(interpolation)) { + return true; + } + if (isLiteral(interpolation)) { + // allow trailing whitespace literal + if (startsWithNewLine(nextQuasi.value.raw)) { + return !(typeof interpolation.value === 'string' && + isWhitespace(interpolation.value)); + } + return true; + } + if (isTemplateLiteral(interpolation)) { + // allow trailing whitespace literal + if (startsWithNewLine(nextQuasi.value.raw)) { + return !(interpolation.quasis.length === 1 && + isWhitespace(interpolation.quasis[0].value.raw)); + } + return true; + } + return false; + } + function isUnncessaryTypeInterpolation({ interpolation, nextQuasi, prevQuasi, }) { + if (hasCommentsBetweenQuasi(prevQuasi, nextQuasi)) { + return false; + } + const literal = getLiteral(interpolation); + if (literal) { + // allow trailing whitespace literal + if (startsWithNewLine(nextQuasi.value.raw)) { + return !(typeof literal.value === 'string' && isWhitespace(literal.value)); + } + return true; + } + if (interpolation.type === utils_1.AST_NODE_TYPES.TSNullKeyword || + interpolation.type === utils_1.AST_NODE_TYPES.TSUndefinedKeyword) { + return true; + } + const templateLiteral = getTemplateLiteral(interpolation); + if (templateLiteral) { + // allow trailing whitespace literal + if (startsWithNewLine(nextQuasi.value.raw)) { + return !(templateLiteral.quasis.length === 1 && + isWhitespace(templateLiteral.quasis[0].value.raw)); + } + return true; + } + return false; + } + function getReportDescriptors(infos) { + let nextCharacterIsOpeningCurlyBrace = false; + const reportDescriptors = []; + const reversedInfos = [...infos].reverse(); + for (const { interpolation, nextQuasi, prevQuasi } of reversedInfos) { + const fixers = []; + if (nextQuasi.value.raw !== '') { + nextCharacterIsOpeningCurlyBrace = + nextQuasi.value.raw.startsWith('{'); + } + const literal = getLiteral(interpolation); + const templateLiteral = getTemplateLiteral(interpolation); + if (literal) { + let escapedValue = (typeof literal.value === 'string' + ? // The value is already a string, so we're removing quotes: + // "'va`lue'" -> "va`lue" + literal.raw.slice(1, -1) + : // The value may be one of number | bigint | boolean | RegExp | null. + // In regular expressions, we escape every backslash + String(literal.value).replaceAll('\\', '\\\\')) + // The string or RegExp may contain ` or ${. + // We want both of these to be escaped in the final template expression. + // + // A pair of backslashes means "escaped backslash", so backslashes + // from this pair won't escape ` or ${. Therefore, to escape these + // sequences in the resulting template expression, we need to escape + // all sequences that are preceded by an even number of backslashes. + // + // This RegExp does the following transformations: + // \` -> \` + // \\` -> \\\` + // \${ -> \${ + // \\${ -> \\\${ + .replaceAll(new RegExp(`${evenNumOfBackslashesRegExp.source}(\`|\\\${)`, 'g'), '\\$1'); + // `...${'...$'}{...` + // ^^^^ + if (nextCharacterIsOpeningCurlyBrace && + endsWithUnescapedDollarSign(escapedValue)) { + escapedValue = escapedValue.replaceAll(/\$$/g, '\\$'); + } + if (escapedValue.length !== 0) { + nextCharacterIsOpeningCurlyBrace = escapedValue.startsWith('{'); + } + fixers.push(fixer => [fixer.replaceText(literal, escapedValue)]); + } + else if (templateLiteral) { + // Since we iterate from the last expression to the first, + // a subsequent expression can tell the current expression + // that it starts with {. + // + // `... ${`... $`}${'{...'} ...` + // ^ ^ subsequent expression starts with { + // current expression ends with a dollar sign, + // so '$' + '{' === '${' (bad news for us). + // Let's escape the dollar sign at the end. + if (nextCharacterIsOpeningCurlyBrace && + endsWithUnescapedDollarSign(templateLiteral.quasis[templateLiteral.quasis.length - 1].value + .raw)) { + fixers.push(fixer => [ + fixer.replaceTextRange([templateLiteral.range[1] - 2, templateLiteral.range[1] - 2], '\\'), + ]); + } + if (templateLiteral.quasis.length === 1 && + templateLiteral.quasis[0].value.raw.length !== 0) { + nextCharacterIsOpeningCurlyBrace = + templateLiteral.quasis[0].value.raw.startsWith('{'); + } + // Remove the beginning and trailing backtick characters. + fixers.push(fixer => [ + fixer.removeRange([ + templateLiteral.range[0], + templateLiteral.range[0] + 1, + ]), + fixer.removeRange([ + templateLiteral.range[1] - 1, + templateLiteral.range[1], + ]), + ]); + } + else { + nextCharacterIsOpeningCurlyBrace = false; + } + // `... $${'{...'} ...` + // ^^^^^ + if (nextCharacterIsOpeningCurlyBrace && + endsWithUnescapedDollarSign(prevQuasi.value.raw)) { + fixers.push(fixer => [ + fixer.replaceTextRange([prevQuasi.range[1] - 3, prevQuasi.range[1] - 2], '\\$'), + ]); + } + const warnLocStart = prevQuasi.range[1] - 2; + const warnLocEnd = nextQuasi.range[0] + 1; + reportDescriptors.push({ + loc: (0, rangeToLoc_1.rangeToLoc)(context.sourceCode, [warnLocStart, warnLocEnd]), + messageId: 'noUnnecessaryTemplateExpression', + fix(fixer) { + return [ + // Remove the quasis' parts that are related to the current expression. + fixer.removeRange([warnLocStart, interpolation.range[0]]), + fixer.removeRange([interpolation.range[1], warnLocEnd]), + ...fixers.flatMap(cb => cb(fixer)), + ]; + }, + }); + } + return reportDescriptors; + } + return { + TemplateLiteral(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) { + return; + } + if (isTrivialInterpolation(node) && + !hasCommentsBetweenQuasi(node.quasis[0], node.quasis[1])) { + const { constraintType } = (0, util_1.getConstraintInfo)(checker, services.getTypeAtLocation(node.expressions[0])); + if (constraintType && isUnderlyingTypeString(constraintType)) { + reportSingleInterpolation(node); + return; + } + } + const infos = getInterpolationInfos(node).filter(isUnnecessaryValueInterpolation); + for (const reportDescriptor of getReportDescriptors(infos)) { + context.report(reportDescriptor); + } + }, + TSTemplateLiteralType(node) { + if (isTrivialInterpolation(node) && + !hasCommentsBetweenQuasi(node.quasis[0], node.quasis[1])) { + const { constraintType, isTypeParameter } = (0, util_1.getConstraintInfo)(checker, services.getTypeAtLocation(node.types[0])); + if (constraintType && + !isTypeParameter && + isUnderlyingTypeString(constraintType) && + !isEnumMemberType(constraintType)) { + reportSingleInterpolation(node); + return; + } + } + const infos = getInterpolationInfos(node).filter(isUnncessaryTypeInterpolation); + for (const reportDescriptor of getReportDescriptors(infos)) { + context.report(reportDescriptor); + } + }, + }; + }, +}); +function isWhitespace(x) { + // allow empty string too since we went to allow + // ` ${''} + // `; + // + // in addition to + // `${' '} + // `; + // + return /^\s*$/.test(x); +} +function startsWithNewLine(x) { + return x.startsWith('\n') || x.startsWith('\r\n'); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9cca9e4cdb8dc70ee76ea12b039c746c19704069 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.d.ts @@ -0,0 +1,5 @@ +export type MessageIds = 'unnecessaryTypeParameter'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unnecessaryTypeParameter", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js new file mode 100644 index 0000000000000000000000000000000000000000..905220e8d4c8db493056dd6f7c2aaa6a41b5f3f4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js @@ -0,0 +1,202 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-type-arguments', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow type arguments that are equal to the default', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + unnecessaryTypeParameter: 'This is the default value for this type parameter, so it can be omitted.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function getTypeForComparison(type) { + if ((0, util_1.isTypeReferenceType)(type)) { + return { + type: type.target, + typeArguments: checker.getTypeArguments(type), + }; + } + return { + type, + typeArguments: [], + }; + } + function checkTSArgsAndParameters(esParameters, typeParameters) { + // Just check the last one. Must specify previous type parameters if the last one is specified. + const i = esParameters.params.length - 1; + const arg = esParameters.params[i]; + const param = typeParameters.at(i); + if (!param?.default) { + return; + } + // TODO: would like checker.areTypesEquivalent. https://github.com/Microsoft/TypeScript/issues/13502 + const defaultType = checker.getTypeAtLocation(param.default); + const argType = services.getTypeAtLocation(arg); + // this check should handle some of the most simple cases of like strings, numbers, etc + if (defaultType !== argType) { + // For more complex types (like aliases to generic object types) - TS won't always create a + // global shared type object for the type - so we need to resort to manually comparing the + // reference type and the passed type arguments. + // Also - in case there are aliases - we need to resolve them before we do checks + const defaultTypeResolved = getTypeForComparison(defaultType); + const argTypeResolved = getTypeForComparison(argType); + if ( + // ensure the resolved type AND all the parameters are the same + defaultTypeResolved.type !== argTypeResolved.type || + defaultTypeResolved.typeArguments.length !== + argTypeResolved.typeArguments.length || + defaultTypeResolved.typeArguments.some((t, i) => t !== argTypeResolved.typeArguments[i])) { + return; + } + } + context.report({ + node: arg, + messageId: 'unnecessaryTypeParameter', + fix: fixer => fixer.removeRange(i === 0 + ? esParameters.range + : [esParameters.params[i - 1].range[1], arg.range[1]]), + }); + } + return { + TSTypeParameterInstantiation(node) { + // TypeScript does not apply default type parameters in instantiation + // expressions, so explicit type args here are always meaningful. + if (node.parent.type === utils_1.AST_NODE_TYPES.TSInstantiationExpression) { + return; + } + const expression = services.esTreeNodeToTSNodeMap.get(node); + const typeParameters = getTypeParametersFromNode(node, expression, checker); + if (typeParameters) { + checkTSArgsAndParameters(node, typeParameters); + } + }, + }; + }, +}); +function getTypeParametersFromNode(node, tsNode, checker) { + if (ts.isExpressionWithTypeArguments(tsNode)) { + return getTypeParametersFromType(node, tsNode.expression, checker); + } + if (ts.isTypeReferenceNode(tsNode)) { + return getTypeParametersFromType(node, tsNode.typeName, checker); + } + if (ts.isCallExpression(tsNode) || + ts.isNewExpression(tsNode) || + ts.isTaggedTemplateExpression(tsNode) || + ts.isJsxOpeningElement(tsNode) || + ts.isJsxSelfClosingElement(tsNode)) { + return getTypeParametersFromCall(node, tsNode, checker); + } + return undefined; +} +function getTypeParametersFromType(node, type, checker) { + const symAtLocation = checker.getSymbolAtLocation(type); + if (!symAtLocation) { + return undefined; + } + const sym = getAliasedSymbol(symAtLocation, checker); + const declarations = sym.getDeclarations(); + if (!declarations) { + return undefined; + } + const sortedDeclarations = sortDeclarationsByTypeValueContext(node, declarations); + return (0, util_1.findFirstResult)(sortedDeclarations, decl => { + if (ts.isTypeAliasDeclaration(decl) || + ts.isInterfaceDeclaration(decl) || + ts.isClassLike(decl)) { + return decl.typeParameters; + } + if (ts.isVariableDeclaration(decl)) { + return getConstructSignatureDeclaration(symAtLocation, checker) + ?.typeParameters; + } + return undefined; + }); +} +function getTypeParametersFromCall(node, tsNode, checker) { + const sig = checker.getResolvedSignature(tsNode); + const sigDecl = sig?.getDeclaration(); + if (!sigDecl) { + return ts.isNewExpression(tsNode) + ? getTypeParametersFromType(node, tsNode.expression, checker) + : undefined; + } + return sigDecl.typeParameters; +} +function getAliasedSymbol(symbol, checker) { + return tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias) + ? checker.getAliasedSymbol(symbol) + : symbol; +} +function isInTypeContext(node) { + return (node.parent.type === utils_1.AST_NODE_TYPES.TSInterfaceHeritage || + node.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference || + node.parent.type === utils_1.AST_NODE_TYPES.TSClassImplements); +} +function isTypeContextDeclaration(decl) { + return ts.isTypeAliasDeclaration(decl) || ts.isInterfaceDeclaration(decl); +} +function typeFirstCompare(declA, declB) { + const aIsType = isTypeContextDeclaration(declA); + const bIsType = isTypeContextDeclaration(declB); + return Number(bIsType) - Number(aIsType); +} +function sortDeclarationsByTypeValueContext(node, declarations) { + const sorted = [...declarations].sort(typeFirstCompare); + if (isInTypeContext(node)) { + return sorted; + } + return sorted.reverse(); +} +function getConstructSignatureDeclaration(symbol, checker) { + const type = checker.getTypeOfSymbol(symbol); + const sig = type.getConstructSignatures(); + return sig.at(0)?.getDeclaration(); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d627f7218a158d666d6c0105f355a2887e0b1692 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.d.ts @@ -0,0 +1,11 @@ +export type Options = [ + { + checkLiteralConstAssertions?: boolean; + typesToIgnore?: string[]; + } +]; +export type MessageIds = 'contextuallyUnnecessary' | 'unnecessaryAssertion'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js new file mode 100644 index 0000000000000000000000000000000000000000..db772c55f92115ba880b9110ebcbcc398289fd59 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-assertion.js @@ -0,0 +1,745 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-type-assertion', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow type assertions that do not change the type of an expression', + recommended: 'recommended', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + contextuallyUnnecessary: 'This assertion is unnecessary since the receiver accepts the original type of the expression.', + unnecessaryAssertion: 'This assertion is unnecessary since it does not change the type of the expression.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + checkLiteralConstAssertions: { + type: 'boolean', + description: 'Whether to check literal const assertions.', + }, + typesToIgnore: { + type: 'array', + description: 'A list of type names to ignore.', + items: { + type: 'string', + }, + }, + }, + }, + ], + }, + defaultOptions: [{}], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + /** + * Returns true if there's a chance the variable has been used before a value has been assigned to it + */ + function isPossiblyUsedBeforeAssigned(node) { + const declaration = (0, util_1.getDeclaration)(services, node); + if (!declaration) { + // don't know what the declaration is for some reason, so just assume the worst + return true; + } + if ( + // non-strict mode doesn't care about used before assigned errors + tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks') && + // ignore class properties as they are compile time guarded + // also ignore function arguments as they can't be used before defined + ts.isVariableDeclaration(declaration)) { + // For var declarations, we need to check whether the node + // is actually in a descendant of its declaration or not. If not, + // it may be used before defined. + // eg + // if (Math.random() < 0.5) { + // var x: number = 2; + // } else { + // x!.toFixed(); + // } + if (ts.isVariableDeclarationList(declaration.parent) && + // var + declaration.parent.flags === ts.NodeFlags.None && + // If they are not in the same file it will not exist. + // This situation must not occur using before defined. + services.tsNodeToESTreeNodeMap.has(declaration)) { + const declaratorNode = services.tsNodeToESTreeNodeMap.get(declaration); + const scope = context.sourceCode.getScope(node); + const declaratorScope = context.sourceCode.getScope(declaratorNode); + let parentScope = declaratorScope; + while ((parentScope = parentScope.upper)) { + if (parentScope === scope) { + return true; + } + } + } + if ( + // is it `const x!: number` + declaration.initializer == null && + declaration.exclamationToken == null && + declaration.type != null) { + // check if the defined variable type has changed since assignment + const declarationType = checker.getTypeFromTypeNode(declaration.type); + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + if (declarationType === type && + // `declare`s are never narrowed, so never skip them + !(ts.isVariableDeclarationList(declaration.parent) && + ts.isVariableStatement(declaration.parent.parent) && + tsutils.includesModifier((0, util_1.getModifiers)(declaration.parent.parent), ts.SyntaxKind.DeclareKeyword))) { + // possibly used before assigned, so just skip it + // better to false negative and skip it, than false positive and fix to compile erroring code + // + // no better way to figure this out right now + // https://github.com/Microsoft/TypeScript/issues/31124 + return true; + } + } + } + return false; + } + function isConstAssertion(node) { + return (node.type === utils_1.AST_NODE_TYPES.TSTypeReference && + node.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + node.typeName.name === 'const'); + } + function isTemplateLiteralWithExpressions(expression) { + return (expression.type === utils_1.AST_NODE_TYPES.TemplateLiteral && + expression.expressions.length !== 0); + } + function isImplicitlyNarrowedLiteralDeclaration({ expression, parent, }) { + /** + * Even on `const` variable declarations, template literals with expressions can sometimes be widened without a type assertion. + * @see https://github.com/typescript-eslint/typescript-eslint/issues/8737 + */ + if (isTemplateLiteralWithExpressions(expression)) { + return false; + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const maybeDeclarationNode = parent.parent; + return ((maybeDeclarationNode.type === utils_1.AST_NODE_TYPES.VariableDeclaration && + maybeDeclarationNode.kind === 'const') || + (parent.type === utils_1.AST_NODE_TYPES.PropertyDefinition && parent.readonly)); + } + function isTypeUnchanged(node, expression, uncast, cast) { + if (uncast === cast) { + return true; + } + if (node.typeAnnotation.type === utils_1.AST_NODE_TYPES.TSIntersectionType && + containsTypeVariable(cast)) { + return false; + } + if ((0, util_1.isTypeFlagSet)(uncast, ts.TypeFlags.Undefined) && + (0, util_1.isTypeFlagSet)(cast, ts.TypeFlags.Undefined) && + tsutils.isCompilerOptionEnabled(compilerOptions, 'exactOptionalPropertyTypes')) { + return areUnionPartsEquivalentIgnoringUndefined(uncast, cast); + } + if (((0, util_1.isTypeFlagSet)(uncast, ts.TypeFlags.NonPrimitive) && + !(0, util_1.isTypeFlagSet)(cast, ts.TypeFlags.NonPrimitive)) || + (hasIndexSignature(uncast) && !hasIndexSignature(cast)) || + containsAny(uncast) || + containsAny(cast) || + (containsTypeVariable(cast) && !containsTypeVariable(uncast))) { + return false; + } + if (isConceptuallyLiteral(expression) && + (expression.type !== utils_1.AST_NODE_TYPES.ObjectExpression || + expression.properties.length === 0 || + cast + .getProperties() + .some(p => isTypeLiteral(checker.getTypeOfSymbol(p))))) { + return false; + } + if (cast.isIntersection() && !uncast.isIntersection()) { + const castParts = cast.types; + const otherPart = castParts.find(part => part !== uncast); + if (tsutils.isTypeParameter(uncast) && + castParts.length === 2 && + castParts.some(part => part === uncast) && + otherPart != null && + isEmptyObjectType(otherPart) && + !containsTypeVariable(otherPart)) { + const constraint = checker.getBaseConstraintOfType(uncast); + if (constraint && !(0, util_1.isNullableType)(constraint)) { + return true; + } + } + return false; + } + if (!hasSameProperties(uncast, cast) || + !haveSameTypeArguments(uncast, cast)) { + return false; + } + return areMutuallyAssignable(uncast, cast); + } + function isTypeLiteral(type) { + return type.isLiteral() || tsutils.isBooleanLiteralType(type); + } + function hasIndexSignature(type) { + return tsutils + .unionConstituents(type) + .some(part => checker.getIndexInfosOfType(part).length > 0); + } + function getTypeArguments(type) { + return (type.aliasTypeArguments ?? + (tsutils.isTypeReference(type) ? checker.getTypeArguments(type) : [])); + } + function typeContains(type, predicate, seen = new Set()) { + if (seen.has(type)) { + return false; + } + seen.add(type); + if (predicate(type)) { + return true; + } + if (type.isUnionOrIntersection()) { + return type.types.some(t => typeContains(t, predicate, seen)); + } + const nestedTypes = [ + ...getTypeArguments(type), + ...type + .getCallSignatures() + .flatMap(sig => [ + sig.getReturnType(), + ...sig.getParameters().map(p => checker.getTypeOfSymbol(p)), + ]), + ]; + return nestedTypes.some(t => typeContains(t, predicate, seen)); + } + function containsAny(type) { + return typeContains(type, t => (0, util_1.isTypeFlagSet)(t, ts.TypeFlags.Any)); + } + function containsTypeVariable(type) { + return typeContains(type, t => (0, util_1.isTypeFlagSet)(t, ts.TypeFlags.TypeVariable | ts.TypeFlags.Index)); + } + function hasPhantomTypeArguments(type) { + return isEmptyObjectType(type) && getTypeArguments(type).length > 0; + } + function hasTypeParams(sig) { + return (sig.getTypeParameters()?.length ?? 0) > 0; + } + function genericsMismatch(uncast, contextual) { + return contextual.getProperties().some(prop => { + const contextualSigs = checker.getSignaturesOfType(checker.getTypeOfSymbol(prop), ts.SignatureKind.Call); + if (!contextualSigs.some(hasTypeParams)) { + return false; + } + const uncastProp = uncast.getProperty(prop.getEscapedName()); + if (!uncastProp) { + return true; + } + return !checker + .getSignaturesOfType(checker.getTypeOfSymbol(uncastProp), ts.SignatureKind.Call) + .some(hasTypeParams); + }); + } + function hasSameProperties(uncast, cast) { + const uncastProps = uncast.getProperties(); + const castProps = cast.getProperties(); + if (uncastProps.length !== castProps.length) { + return false; + } + const castPropNames = new Set(castProps.map(p => p.getEscapedName())); + return uncastProps.every(prop => { + const name = prop.getEscapedName(); + return (castPropNames.has(name) && + tsutils.isPropertyReadonlyInType(uncast, name, checker) === + tsutils.isPropertyReadonlyInType(cast, name, checker)); + }); + } + function haveSameTypeArguments(uncast, cast) { + const uncastArgs = getTypeArguments(uncast); + const castArgs = getTypeArguments(cast); + return (uncastArgs.length === castArgs.length && + uncastArgs.every((arg, i) => arg === castArgs[i])); + } + function areMutuallyAssignable(a, b) { + return (checker.isTypeAssignableTo(a, b) && checker.isTypeAssignableTo(b, a)); + } + function areUnionPartsEquivalentIgnoringUndefined(uncast, cast) { + const filterUndefined = (part) => !(0, util_1.isTypeFlagSet)(part, ts.TypeFlags.Undefined); + const uncastParts = tsutils + .unionConstituents(uncast) + .filter(filterUndefined); + const castParts = tsutils.unionConstituents(cast).filter(filterUndefined); + if (uncastParts.length !== castParts.length) { + return false; + } + const uncastPartsSet = new Set(uncastParts); + return castParts.every(part => uncastPartsSet.has(part)); + } + function getOriginalExpression(node) { + let current = node.expression; + while (current.type === utils_1.AST_NODE_TYPES.TSAsExpression || + current.type === utils_1.AST_NODE_TYPES.TSTypeAssertion) { + current = current.expression; + } + return current; + } + function isDoubleAssertionUnnecessary(node, contextualType) { + const innerExpression = node.expression; + if (innerExpression.type !== utils_1.AST_NODE_TYPES.TSAsExpression && + innerExpression.type !== utils_1.AST_NODE_TYPES.TSTypeAssertion) { + return false; + } + const originalExpr = getOriginalExpression(node); + const originalType = services.getTypeAtLocation(originalExpr); + const castType = services.getTypeAtLocation(node); + if (isTypeUnchanged(node, innerExpression, originalType, castType) && + !(0, util_1.isTypeFlagSet)(castType, ts.TypeFlags.Any)) { + return 'unnecessaryAssertion'; + } + if (contextualType) { + const intermediateType = services.getTypeAtLocation(innerExpression); + if (((0, util_1.isTypeFlagSet)(intermediateType, ts.TypeFlags.Any) || + (0, util_1.isTypeFlagSet)(intermediateType, ts.TypeFlags.Unknown)) && + checker.isTypeAssignableTo(originalType, contextualType)) { + return 'contextuallyUnnecessary'; + } + } + return false; + } + const CONCEPTUALLY_LITERAL_TYPES = new Set([ + utils_1.AST_NODE_TYPES.Literal, + utils_1.AST_NODE_TYPES.ArrayExpression, + utils_1.AST_NODE_TYPES.ObjectExpression, + utils_1.AST_NODE_TYPES.TemplateLiteral, + utils_1.AST_NODE_TYPES.ClassExpression, + utils_1.AST_NODE_TYPES.FunctionExpression, + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + utils_1.AST_NODE_TYPES.JSXElement, + utils_1.AST_NODE_TYPES.JSXFragment, + ]); + function isConceptuallyLiteral(node) { + return CONCEPTUALLY_LITERAL_TYPES.has(node.type); + } + function isIIFE(expression) { + return (expression.type === utils_1.AST_NODE_TYPES.CallExpression && + (expression.callee.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + expression.callee.type === utils_1.AST_NODE_TYPES.FunctionExpression)); + } + function isEmptyObjectType(type) { + return ((0, util_1.isTypeFlagSet)(type, ts.TypeFlags.NonPrimitive) || + (type.getProperties().length === 0 && + !type.getCallSignatures().length && + !type.getConstructSignatures().length && + !type.getStringIndexType() && + !type.getNumberIndexType())); + } + function hasGenericCallSignature(type) { + return type.getCallSignatures().some(hasTypeParams); + } + function isArgumentToOverloadedFunction(node) { + const { parent } = node; + if ((parent.type !== utils_1.AST_NODE_TYPES.CallExpression && + parent.type !== utils_1.AST_NODE_TYPES.NewExpression) || + !parent.arguments.includes(node)) { + return false; + } + const calleeType = checker.getTypeAtLocation(services.esTreeNodeToTSNodeMap.get(parent.callee)); + const signatures = calleeType.getCallSignatures(); + if (signatures.length <= 1) { + return false; + } + const argIndex = parent.arguments.indexOf(node); + const paramTypes = signatures.map(sig => { + const params = sig.getParameters(); + if (argIndex >= params.length) { + return undefined; + } + const param = params[argIndex]; + let paramType = checker.getTypeOfSymbol(param); + if (param.valueDeclaration && + ts.isParameter(param.valueDeclaration) && + param.valueDeclaration.dotDotDotToken) { + const typeArgs = getTypeArguments(paramType); + if (typeArgs.length > 0) { + paramType = typeArgs[0]; + } + } + return paramType; + }); + if (paramTypes.some(type => type == null)) { + return true; + } + const definedParamTypes = paramTypes; + const firstParamType = definedParamTypes[0]; + if (definedParamTypes.every(type => type === firstParamType)) { + return false; + } + const uncastType = services.getTypeAtLocation(node.expression); + return !definedParamTypes.every(type => checker.isTypeAssignableTo(uncastType, type)); + } + function isInDestructuringDeclaration(node) { + const { parent } = node; + return (parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator && + parent.init === node && + (parent.id.type === utils_1.AST_NODE_TYPES.ObjectPattern || + parent.id.type === utils_1.AST_NODE_TYPES.ArrayPattern)); + } + function isPropertyInProblematicContext(node) { + const { parent } = node; + if (parent.type !== utils_1.AST_NODE_TYPES.Property || parent.value !== node) { + return false; + } + const objectExpr = parent.parent; + if (objectExpr.type !== utils_1.AST_NODE_TYPES.ObjectExpression) { + return false; + } + const objectTsNode = services.esTreeNodeToTSNodeMap.get(objectExpr); + if (checker.getContextualType(objectTsNode)?.isUnion()) { + const nodeTsNode = services.esTreeNodeToTSNodeMap.get(node); + const propContextualType = checker.getContextualType(nodeTsNode); + if (propContextualType == null) { + return true; + } + const nonNullableContextualType = checker.getNonNullableType(propContextualType); + if (nonNullableContextualType.isUnion()) { + return true; + } + const uncastType = services.getTypeAtLocation(node.expression); + return !checker.isTypeAssignableTo(uncastType, nonNullableContextualType); + } + const objectParent = objectExpr.parent; + return (objectParent.type === utils_1.AST_NODE_TYPES.TSSatisfiesExpression || + (objectParent.type === utils_1.AST_NODE_TYPES.CallExpression && + objectParent.parent.type === utils_1.AST_NODE_TYPES.TSSatisfiesExpression)); + } + function isAssignmentInNonStatementContext(node) { + const { parent } = node; + if (parent.type !== utils_1.AST_NODE_TYPES.AssignmentExpression || + parent.right !== node) { + return false; + } + const assignmentParent = parent.parent; + return assignmentParent.type !== utils_1.AST_NODE_TYPES.ExpressionStatement; + } + function isRightHandSideOfLogicalAssignment(node) { + const { parent } = node; + return (parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression && + parent.right === node && + (parent.operator === '&&=' || + parent.operator === '||=' || + parent.operator === '??=')); + } + function isInGenericContext(node) { + let seenFunction = false; + for (let current = node.parent; current; current = current.parent) { + if (current.type === utils_1.AST_NODE_TYPES.FunctionDeclaration) { + return false; + } + if (current.type === utils_1.AST_NODE_TYPES.FunctionExpression || + current.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + if (current.body.type === utils_1.AST_NODE_TYPES.BlockStatement) { + return false; + } + if (seenFunction) { + return false; + } + seenFunction = true; + } + if (current.type === utils_1.AST_NODE_TYPES.CallExpression || + current.type === utils_1.AST_NODE_TYPES.NewExpression) { + if (current.typeArguments != null) { + continue; + } + if (current.type === utils_1.AST_NODE_TYPES.CallExpression && + current.callee.type === utils_1.AST_NODE_TYPES.MemberExpression && + current.arguments.includes(node)) { + continue; + } + const calleeType = checker.getTypeAtLocation(services.esTreeNodeToTSNodeMap.get(current.callee)); + if (hasGenericCallSignature(calleeType)) { + return true; + } + } + } + return false; + } + function hasPhantomTypeArgumentMismatch(node, uncastType, contextualType) { + return (isInGenericContext(node) && + (hasPhantomTypeArguments(uncastType) || + hasPhantomTypeArguments(contextualType)) && + !haveSameTypeArguments(uncastType, contextualType)); + } + const SKIP_PARENT_TYPES = new Set([ + utils_1.AST_NODE_TYPES.TSAsExpression, + utils_1.AST_NODE_TYPES.TSTypeAssertion, + utils_1.AST_NODE_TYPES.SpreadElement, + utils_1.AST_NODE_TYPES.TSSatisfiesExpression, + ]); + function shouldSkipContextualTypeFallback(node, castIsAny) { + if (castIsAny) { + return (node.parent.type === utils_1.AST_NODE_TYPES.LogicalExpression || + isInGenericContext(node)); + } + if (SKIP_PARENT_TYPES.has(node.parent.type) || + node.expression.type === utils_1.AST_NODE_TYPES.ArrayExpression || + isInDestructuringDeclaration(node) || + isPropertyInProblematicContext(node) || + isAssignmentInNonStatementContext(node) || + isRightHandSideOfLogicalAssignment(node) || + isArgumentToOverloadedFunction(node)) { + return true; + } + if (isInGenericContext(node)) { + const originalExpr = getOriginalExpression(node); + return (!isConceptuallyLiteral(originalExpr) && + node.parent.type !== utils_1.AST_NODE_TYPES.Property); + } + return false; + } + function getUncastType(node) { + // Special handling for IIFE: extract the function's return type + if (isIIFE(node.expression)) { + const callee = node.expression.callee; + const functionType = services.getTypeAtLocation(callee); + const signatures = functionType.getCallSignatures(); + if (signatures.length > 0) { + const returnType = checker.getReturnTypeOfSignature(signatures[0]); + // If the function has no explicit return type annotation and returns undefined, + // treat it as void (TypeScript infers () => {} as () => undefined, but it should be void) + if (callee.returnType == null && + (0, util_1.isTypeFlagSet)(returnType, ts.TypeFlags.Undefined)) { + return checker.getVoidType(); + } + return returnType; + } + } + return services.getTypeAtLocation(node.expression); + } + function createAssertionFixer(node) { + return fixer => { + if (node.type === utils_1.AST_NODE_TYPES.TSTypeAssertion) { + const openingAngleBracket = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(node.typeAnnotation, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === '<'), util_1.NullThrowsReasons.MissingToken('<', 'type annotation')); + const closingAngleBracket = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.typeAnnotation, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === '>'), util_1.NullThrowsReasons.MissingToken('>', 'type annotation')); + return fixer.removeRange([ + openingAngleBracket.range[0], + closingAngleBracket.range[1], + ]); + } + const asToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.expression, token => token.type === utils_1.AST_TOKEN_TYPES.Identifier && token.value === 'as'), util_1.NullThrowsReasons.MissingToken('>', 'type annotation')); + const tokenBeforeAs = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(asToken, { + includeComments: true, + }), util_1.NullThrowsReasons.MissingToken('comment', 'as')); + return fixer.removeRange([tokenBeforeAs.range[1], node.range[1]]); + }; + } + function reportDoubleAssertionIfUnnecessary(node, contextualType) { + const doubleAssertionResult = isDoubleAssertionUnnecessary(node, contextualType); + if (doubleAssertionResult) { + context.report({ + node, + messageId: doubleAssertionResult, + fix(fixer) { + const originalExpr = getOriginalExpression(node); + let text = context.sourceCode.getText(originalExpr); + if (originalExpr.type === utils_1.AST_NODE_TYPES.ObjectExpression && + node.parent.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + node.parent.body === node) { + text = `(${text})`; + } + return fixer.replaceText(node, text); + }, + }); + } + } + return { + 'TSAsExpression, TSTypeAssertion'(node) { + if (options.typesToIgnore?.includes(context.sourceCode.getText(node.typeAnnotation))) { + return; + } + const castType = services.getTypeAtLocation(node); + const castTypeIsLiteral = isTypeLiteral(castType); + const typeAnnotationIsConstAssertion = isConstAssertion(node.typeAnnotation); + if (!options.checkLiteralConstAssertions && + castTypeIsLiteral && + typeAnnotationIsConstAssertion) { + return; + } + const uncastType = getUncastType(node); + const typeIsUnchanged = isTypeUnchanged(node, node.expression, uncastType, castType); + const wouldSameTypeBeInferred = castTypeIsLiteral + ? isImplicitlyNarrowedLiteralDeclaration(node) + : !typeAnnotationIsConstAssertion; + if (typeIsUnchanged && wouldSameTypeBeInferred) { + context.report({ + node, + messageId: 'unnecessaryAssertion', + fix: createAssertionFixer(node), + }); + return; + } + const originalNode = services.esTreeNodeToTSNodeMap.get(node); + const castIsAny = (0, util_1.isTypeFlagSet)(castType, ts.TypeFlags.Any) && + !SKIP_PARENT_TYPES.has(node.parent.type); + const contextualType = shouldSkipContextualTypeFallback(node, castIsAny) + ? undefined + : checker.getContextualType(originalNode); + if (contextualType) { + const contextualTypeIsAny = (0, util_1.isTypeFlagSet)(contextualType, ts.TypeFlags.Any); + const isCallArgument = (node.parent.type === utils_1.AST_NODE_TYPES.CallExpression || + node.parent.type === utils_1.AST_NODE_TYPES.NewExpression) && + node.parent.arguments.includes(node); + const anyInvolvedInContextualCheck = contextualTypeIsAny + ? isCallArgument && !containsAny(castType) + : !containsAny(contextualType); + const isNullishLiteralToUnion = castType.isUnion() && + ((node.expression.type === utils_1.AST_NODE_TYPES.Literal && + node.expression.value == null) || + (node.expression.type === utils_1.AST_NODE_TYPES.Identifier && + node.expression.name === 'undefined')); + const isContextuallyUnnecessary = !typeAnnotationIsConstAssertion && + !containsAny(uncastType) && + anyInvolvedInContextualCheck && + !hasPhantomTypeArgumentMismatch(node, uncastType, contextualType) && + (castIsAny || !genericsMismatch(uncastType, contextualType)) && + (contextualTypeIsAny || + checker.isTypeAssignableTo(uncastType, contextualType)) && + !isNullishLiteralToUnion; + if (isContextuallyUnnecessary) { + context.report({ + node, + messageId: 'contextuallyUnnecessary', + fix: createAssertionFixer(node), + }); + return; + } + } + reportDoubleAssertionIfUnnecessary(node, contextualType); + }, + TSNonNullExpression(node) { + const removeExclamationFix = fixer => { + const exclamationToken = (0, util_1.nullThrows)(context.sourceCode.getLastToken(node, token => token.value === '!'), util_1.NullThrowsReasons.MissingToken('exclamation mark', 'non-null assertion')); + return fixer.removeRange(exclamationToken.range); + }; + if (node.parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression && + node.parent.operator === '=') { + if (node.parent.left === node) { + context.report({ + node, + messageId: 'contextuallyUnnecessary', + fix: removeExclamationFix, + }); + } + // for all other = assignments we ignore non-null checks + // this is because non-null assertions can change the type-flow of the code + // so whilst they might be unnecessary for the assignment - they are necessary + // for following code + return; + } + const originalNode = services.esTreeNodeToTSNodeMap.get(node); + const constrainedType = (0, util_1.getConstrainedTypeAtLocation)(services, node.expression); + const actualType = services.getTypeAtLocation(node.expression); + // Check both the constrained type and the actual type. + // If either is nullable, we should not report the assertion as unnecessary. + // This handles cases like generic constraints with `any` where the + // constrained type is `any` (nullable) but the actual type might be + // a type parameter that TypeScript treats nominally. + // See: https://github.com/typescript-eslint/typescript-eslint/issues/11559 + const constrainedTypeIsNullable = (0, util_1.isNullableType)(constrainedType); + const actualTypeIsNullable = (0, util_1.isNullableType)(actualType); + if (!constrainedTypeIsNullable && !actualTypeIsNullable) { + if (node.expression.type === utils_1.AST_NODE_TYPES.Identifier && + isPossiblyUsedBeforeAssigned(node.expression)) { + return; + } + context.report({ + node, + messageId: 'unnecessaryAssertion', + fix: removeExclamationFix, + }); + } + else { + // we know it's a nullable type + // so figure out if the variable is used in a place that accepts nullable types + // If the constrained type differs from the actual type (e.g., when dealing + // with unresolved generic type parameters), we should not report the assertion + // as contextually unnecessary. TypeScript may still require the assertion + // even if the constraint is nullable (like `any`). + // See: https://github.com/typescript-eslint/typescript-eslint/issues/11559 + if (constrainedType !== actualType) { + return; + } + const contextualType = (0, util_1.getContextualType)(checker, originalNode); + if (contextualType) { + if ((0, util_1.isTypeFlagSet)(constrainedType, ts.TypeFlags.Unknown) && + !(0, util_1.isTypeFlagSet)(contextualType, ts.TypeFlags.Unknown)) { + return; + } + // in strict mode you can't assign null to undefined, so we have to make sure that + // the two types share a nullable type + const typeIncludesUndefined = (0, util_1.isTypeFlagSet)(constrainedType, ts.TypeFlags.Undefined); + const typeIncludesNull = (0, util_1.isTypeFlagSet)(constrainedType, ts.TypeFlags.Null); + const typeIncludesVoid = (0, util_1.isTypeFlagSet)(constrainedType, ts.TypeFlags.Void); + const contextualTypeIncludesUndefined = (0, util_1.isTypeFlagSet)(contextualType, ts.TypeFlags.Undefined); + const contextualTypeIncludesNull = (0, util_1.isTypeFlagSet)(contextualType, ts.TypeFlags.Null); + const contextualTypeIncludesVoid = (0, util_1.isTypeFlagSet)(contextualType, ts.TypeFlags.Void); + // make sure that the parent accepts the same types + // i.e. assigning `string | null | undefined` to `string | undefined` is invalid + const isValidUndefined = typeIncludesUndefined + ? contextualTypeIncludesUndefined + : true; + const isValidNull = typeIncludesNull + ? contextualTypeIncludesNull + : true; + const isValidVoid = typeIncludesVoid + ? contextualTypeIncludesVoid + : true; + if (isValidUndefined && isValidNull && isValidVoid) { + context.report({ + node, + messageId: 'contextuallyUnnecessary', + fix: removeExclamationFix, + }); + } + } + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1094828759ac533edb4fae7e8114f1c8f31a821b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"removeUnnecessaryConstraint" | "unnecessaryConstraint", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js new file mode 100644 index 0000000000000000000000000000000000000000..adb49eee74ed8818e6a29cbabfde83aa2ce0c8d6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-constraint.js @@ -0,0 +1,119 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const node_path_1 = require("node:path"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-type-constraint', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow unnecessary constraints on generic types', + recommended: 'recommended', + }, + hasSuggestions: true, + messages: { + removeUnnecessaryConstraint: 'Remove the unnecessary `{{constraint}}` constraint.', + unnecessaryConstraint: 'Constraining the generic type `{{name}}` to `{{constraint}}` does nothing and is unnecessary.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + // In theory, we could use the type checker for more advanced constraint types... + // ...but in practice, these types are rare, and likely not worth requiring type info. + // https://github.com/typescript-eslint/typescript-eslint/pull/2516#discussion_r495731858 + const unnecessaryConstraints = new Map([ + [utils_1.AST_NODE_TYPES.TSAnyKeyword, 'any'], + [utils_1.AST_NODE_TYPES.TSUnknownKeyword, 'unknown'], + ]); + function checkRequiresGenericDeclarationDisambiguation(filename) { + const pathExt = (0, node_path_1.extname)(filename).toLocaleLowerCase(); + switch (pathExt) { + case ts.Extension.Cts: + case ts.Extension.Mts: + case ts.Extension.Tsx: + return true; + default: + return false; + } + } + const requiresGenericDeclarationDisambiguation = checkRequiresGenericDeclarationDisambiguation(context.filename); + const checkNode = (node, inArrowFunction) => { + const constraint = unnecessaryConstraints.get(node.constraint.type); + function shouldAddTrailingComma() { + if (!inArrowFunction || !requiresGenericDeclarationDisambiguation) { + return false; + } + // Only () => {} would need trailing comma + return (node.parent.params.length === + 1 && + context.sourceCode.getTokensAfter(node)[0].value !== ',' && + !node.default); + } + if (constraint) { + context.report({ + node, + messageId: 'unnecessaryConstraint', + data: { + name: node.name.name, + constraint, + }, + suggest: [ + { + messageId: 'removeUnnecessaryConstraint', + data: { + constraint, + }, + fix(fixer) { + return fixer.replaceTextRange([node.name.range[1], node.constraint.range[1]], shouldAddTrailingComma() ? ',' : ''); + }, + }, + ], + }); + } + }; + return { + ':not(ArrowFunctionExpression) > TSTypeParameterDeclaration > TSTypeParameter[constraint]'(node) { + checkNode(node, false); + }, + 'ArrowFunctionExpression > TSTypeParameterDeclaration > TSTypeParameter[constraint]'(node) { + checkNode(node, true); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-conversion.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-conversion.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39920c8498272d5e740aa5692ff558c0516d50cd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-conversion.d.ts @@ -0,0 +1,5 @@ +type MessageIds = 'suggestRemove' | 'suggestSatisfies' | 'unnecessaryTypeConversion'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-conversion.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-conversion.js new file mode 100644 index 0000000000000000000000000000000000000000..cf85311ba8ae4b4d72c9197fa966f9d717c2542b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-conversion.js @@ -0,0 +1,356 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +function isEnumType(type) { + return (type.getFlags() & ts.TypeFlags.EnumLike) !== 0; +} +function isEnumMemberType(type) { + const symbol = type.getSymbol(); + if (!symbol) { + return false; + } + return tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.EnumMember); +} +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-type-conversion', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow conversion idioms when they do not change the type or value of the expression', + recommended: 'strict', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + suggestRemove: 'Remove the type conversion.', + suggestSatisfies: 'Instead, assert that the value satisfies the {{type}} type.', + unnecessaryTypeConversion: '{{violation}} does not change the type or value of the {{type}}.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function doesUnderlyingTypeMatchFlag(type, typeFlag) { + return tsutils + .unionConstituents(type) + .every(t => (0, util_1.isTypeFlagSet)(t, typeFlag)); + } + const services = (0, util_1.getParserServices)(context); + function handleUnaryOperator(node, typeFlag, typeString, violation, isDoubleOperator) { + const outerNode = isDoubleOperator ? node.parent : node; + const type = services.getTypeAtLocation(node.argument); + if (doesUnderlyingTypeMatchFlag(type, typeFlag)) { + const wrappingFixerParams = { + node: outerNode, + innerNode: [node.argument], + sourceCode: context.sourceCode, + }; + context.report({ + loc: { + start: outerNode.loc.start, + end: { + column: node.loc.start.column + 1, + line: node.loc.start.line, + }, + }, + messageId: 'unnecessaryTypeConversion', + data: { type: typeString, violation }, + suggest: [ + { + messageId: 'suggestRemove', + fix: (0, util_1.getWrappingFixer)(wrappingFixerParams), + }, + { + messageId: 'suggestSatisfies', + data: { type: typeString }, + fix: (0, util_1.getWrappingFixer)({ + ...wrappingFixerParams, + wrap: expr => `${expr} satisfies ${typeString}`, + }), + }, + ], + }); + } + } + return { + 'AssignmentExpression[operator = "+="]'(node) { + if (node.right.type === utils_1.AST_NODE_TYPES.Literal && + node.right.value === '' && + doesUnderlyingTypeMatchFlag(services.getTypeAtLocation(node.left), ts.TypeFlags.StringLike)) { + const wrappingFixerParams = { + node, + innerNode: [node.left], + sourceCode: context.sourceCode, + }; + context.report({ + node, + messageId: 'unnecessaryTypeConversion', + data: { + type: 'string', + violation: "Concatenating a string with ''", + }, + suggest: [ + { + messageId: 'suggestRemove', + fix: node.parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement + ? (fixer) => [ + fixer.removeRange([ + node.parent.range[0], + node.parent.range[1], + ]), + ] + : (0, util_1.getWrappingFixer)(wrappingFixerParams), + }, + { + messageId: 'suggestSatisfies', + data: { type: 'string' }, + fix: (0, util_1.getWrappingFixer)({ + ...wrappingFixerParams, + wrap: expr => `${expr} satisfies string`, + }), + }, + ], + }); + } + }, + 'BinaryExpression[operator = "+"]'(node) { + if (node.right.type === utils_1.AST_NODE_TYPES.Literal && + node.right.value === '' && + doesUnderlyingTypeMatchFlag(services.getTypeAtLocation(node.left), ts.TypeFlags.StringLike)) { + const wrappingFixerParams = { + node, + innerNode: [node.left], + sourceCode: context.sourceCode, + }; + context.report({ + loc: { + start: node.left.loc.end, + end: node.loc.end, + }, + messageId: 'unnecessaryTypeConversion', + data: { + type: 'string', + violation: "Concatenating a string with ''", + }, + suggest: [ + { + messageId: 'suggestRemove', + fix: (0, util_1.getWrappingFixer)(wrappingFixerParams), + }, + { + messageId: 'suggestSatisfies', + data: { type: 'string' }, + fix: (0, util_1.getWrappingFixer)({ + ...wrappingFixerParams, + wrap: expr => `${expr} satisfies string`, + }), + }, + ], + }); + } + else if (node.left.type === utils_1.AST_NODE_TYPES.Literal && + node.left.value === '' && + doesUnderlyingTypeMatchFlag(services.getTypeAtLocation(node.right), ts.TypeFlags.StringLike)) { + const wrappingFixerParams = { + node, + innerNode: [node.right], + sourceCode: context.sourceCode, + }; + context.report({ + loc: { + start: node.loc.start, + end: node.right.loc.start, + }, + messageId: 'unnecessaryTypeConversion', + data: { + type: 'string', + violation: "Concatenating '' with a string", + }, + suggest: [ + { + messageId: 'suggestRemove', + fix: (0, util_1.getWrappingFixer)(wrappingFixerParams), + }, + { + messageId: 'suggestSatisfies', + data: { type: 'string' }, + fix: (0, util_1.getWrappingFixer)({ + ...wrappingFixerParams, + wrap: expr => `${expr} satisfies string`, + }), + }, + ], + }); + } + }, + CallExpression(node) { + const nodeCallee = node.callee; + const builtInTypeFlags = { + BigInt: ts.TypeFlags.BigIntLike, + Boolean: ts.TypeFlags.BooleanLike, + Number: ts.TypeFlags.NumberLike, + String: ts.TypeFlags.StringLike, + }; + if (nodeCallee.type !== utils_1.AST_NODE_TYPES.Identifier || + !(nodeCallee.name in builtInTypeFlags)) { + return; + } + const typeFlag = builtInTypeFlags[nodeCallee.name]; + const scope = context.sourceCode.getScope(node); + const variable = scope.set.get(nodeCallee.name); + if (!!variable?.defs.length || + !doesUnderlyingTypeMatchFlag((0, util_1.getConstrainedTypeAtLocation)(services, node.arguments[0]), typeFlag)) { + return; + } + const wrappingFixerParams = { + node, + innerNode: [node.arguments[0]], + sourceCode: context.sourceCode, + }; + const typeString = nodeCallee.name.toLowerCase(); + context.report({ + node: nodeCallee, + messageId: 'unnecessaryTypeConversion', + data: { + type: nodeCallee.name.toLowerCase(), + violation: `Passing a ${typeString} to ${nodeCallee.name}()`, + }, + suggest: [ + { + messageId: 'suggestRemove', + fix: (0, util_1.getWrappingFixer)(wrappingFixerParams), + }, + { + messageId: 'suggestSatisfies', + data: { type: typeString }, + fix: (0, util_1.getWrappingFixer)({ + ...wrappingFixerParams, + wrap: expr => `${expr} satisfies ${typeString}`, + }), + }, + ], + }); + }, + 'CallExpression > MemberExpression.callee > Identifier[name = "toString"].property'(node) { + const memberExpr = node.parent; + const type = (0, util_1.getConstrainedTypeAtLocation)(services, memberExpr.object); + if (isEnumType(type) || isEnumMemberType(type)) { + return; + } + if (doesUnderlyingTypeMatchFlag(type, ts.TypeFlags.StringLike)) { + const wrappingFixerParams = { + node: memberExpr.parent, + innerNode: [memberExpr.object], + sourceCode: context.sourceCode, + }; + context.report({ + loc: { + start: memberExpr.property.loc.start, + end: memberExpr.parent.loc.end, + }, + messageId: 'unnecessaryTypeConversion', + data: { + type: 'string', + violation: "Calling a string's .toString() method", + }, + suggest: [ + { + messageId: 'suggestRemove', + fix: (0, util_1.getWrappingFixer)(wrappingFixerParams), + }, + { + messageId: 'suggestSatisfies', + data: { type: 'string' }, + fix: (0, util_1.getWrappingFixer)({ + ...wrappingFixerParams, + wrap: expr => `${expr} satisfies string`, + }), + }, + ], + }); + } + }, + 'UnaryExpression[operator = "!"] > UnaryExpression[operator = "!"]'(node) { + handleUnaryOperator(node, ts.TypeFlags.BooleanLike, 'boolean', 'Using !! on a boolean', true); + }, + 'UnaryExpression[operator = "+"]'(node) { + handleUnaryOperator(node, ts.TypeFlags.NumberLike, 'number', 'Using the unary + operator on a number', false); + }, + 'UnaryExpression[operator = "~"] > UnaryExpression[operator = "~"]'(node) { + const outerNode = node.parent; + const type = services.getTypeAtLocation(node.argument); + if (tsutils.unionConstituents(type).every(t => { + return ((0, util_1.isTypeFlagSet)(t, ts.TypeFlags.NumberLiteral) && + Number.isInteger(t.value)); + })) { + const wrappingFixerParams = { + node: outerNode, + innerNode: [node.argument], + sourceCode: context.sourceCode, + }; + context.report({ + loc: { + start: outerNode.loc.start, + end: { + column: node.loc.start.column + 1, + line: node.loc.start.line, + }, + }, + messageId: 'unnecessaryTypeConversion', + data: { type: 'number', violation: 'Using ~~ on an integer' }, + suggest: [ + { + messageId: 'suggestRemove', + fix: (0, util_1.getWrappingFixer)(wrappingFixerParams), + }, + { + messageId: 'suggestSatisfies', + data: { type: 'number' }, + fix: (0, util_1.getWrappingFixer)({ + ...wrappingFixerParams, + wrap: expr => `${expr} satisfies number`, + }), + }, + ], + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..938c91eb78ec1d2afadad6c30d8179372649c965 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"replaceUsagesWithConstraint" | "sole", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.js new file mode 100644 index 0000000000000000000000000000000000000000..8ef5eae63b5558e28c52479ffc0e1f74c5fc8d18 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-parameters.js @@ -0,0 +1,422 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unnecessary-type-parameters', + meta: { + type: 'problem', + docs: { + description: "Disallow type parameters that aren't used multiple times", + recommended: 'strict', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + replaceUsagesWithConstraint: 'Replace all usages of type parameter with its constraint.', + sole: 'Type parameter {{name}} is {{uses}} in the {{descriptor}} signature.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const parserServices = (0, util_1.getParserServices)(context); + function checkNode(node, descriptor) { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const checker = parserServices.program.getTypeChecker(); + let counts; + // Get the scope in which the type parameters are declared. + const scope = context.sourceCode.getScope(node); + for (const typeParameter of tsNode.typeParameters) { + const esTypeParameter = parserServices.tsNodeToESTreeNodeMap.get(typeParameter); + const smTypeParameterVariable = (0, util_1.nullThrows)((() => { + const variable = scope.set.get(esTypeParameter.name.name); + return variable?.isTypeVariable ? variable : undefined; + })(), "Type parameter should be present in scope's variables."); + // Quick path: if the type parameter is used multiple times in the AST, + // we don't need to dip into types to know it's repeated. + if (isTypeParameterRepeatedInAST(esTypeParameter, smTypeParameterVariable.references, node.body?.range[0] ?? node.returnType?.range[1])) { + continue; + } + // For any inferred types, we have to dip into type checking. + counts ??= countTypeParameterUsage(checker, tsNode); + const identifierCounts = counts.get(typeParameter.name); + if (!identifierCounts || identifierCounts > 2) { + continue; + } + context.report({ + node: esTypeParameter, + messageId: 'sole', + data: { + name: typeParameter.name.text, + descriptor, + uses: identifierCounts === 1 ? 'never used' : 'used only once', + }, + suggest: [ + { + messageId: 'replaceUsagesWithConstraint', + *fix(fixer) { + // Replace all the usages of the type parameter with the constraint... + const constraint = esTypeParameter.constraint; + // special case - a constraint of 'any' actually acts like 'unknown' + const constraintText = constraint != null && + constraint.type !== utils_1.AST_NODE_TYPES.TSAnyKeyword + ? context.sourceCode.getText(constraint) + : 'unknown'; + for (const reference of smTypeParameterVariable.references) { + if (reference.isTypeReference) { + const referenceNode = reference.identifier; + const isComplexType = constraint?.type === utils_1.AST_NODE_TYPES.TSUnionType || + constraint?.type === utils_1.AST_NODE_TYPES.TSIntersectionType || + constraint?.type === utils_1.AST_NODE_TYPES.TSConditionalType; + const hasMatchingAncestorType = [ + utils_1.AST_NODE_TYPES.TSArrayType, + utils_1.AST_NODE_TYPES.TSIndexedAccessType, + utils_1.AST_NODE_TYPES.TSIntersectionType, + utils_1.AST_NODE_TYPES.TSUnionType, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + ].some(type => referenceNode.parent.parent.type === type); + if (isComplexType && hasMatchingAncestorType) { + const fixResult = (0, util_1.getWrappingFixer)({ + node: referenceNode, + innerNode: constraint, + sourceCode: context.sourceCode, + wrap: constraintNode => constraintNode, + })(fixer); + yield fixResult; + } + else { + yield fixer.replaceText(referenceNode, constraintText); + } + } + } + // ...and remove the type parameter itself from the declaration. + const typeParamsNode = (0, util_1.nullThrows)(node.typeParameters, 'node should have type parameters'); + // We are assuming at this point that the reported type parameter + // is present in the inspected node's type parameters. + if (typeParamsNode.params.length === 1) { + // Remove the whole generic syntax if we're removing the only type parameter in the list. + yield fixer.remove(typeParamsNode); + } + else { + const index = typeParamsNode.params.indexOf(esTypeParameter); + if (index === 0) { + const commaAfter = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(esTypeParameter, token => token.value === ','), util_1.NullThrowsReasons.MissingToken('comma', 'type parameter list')); + const tokenAfterComma = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(commaAfter, { + includeComments: true, + }), util_1.NullThrowsReasons.MissingToken('token', 'type parameter list')); + yield fixer.removeRange([ + esTypeParameter.range[0], + tokenAfterComma.range[0], + ]); + } + else { + const commaBefore = (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(esTypeParameter, token => token.value === ','), util_1.NullThrowsReasons.MissingToken('comma', 'type parameter list')); + yield fixer.removeRange([ + commaBefore.range[0], + esTypeParameter.range[1], + ]); + } + } + }, + }, + ], + }); + } + } + return { + [[ + 'ArrowFunctionExpression[typeParameters]', + 'FunctionDeclaration[typeParameters]', + 'FunctionExpression[typeParameters]', + 'TSCallSignatureDeclaration[typeParameters]', + 'TSConstructorType[typeParameters]', + 'TSDeclareFunction[typeParameters]', + 'TSEmptyBodyFunctionExpression[typeParameters]', + 'TSFunctionType[typeParameters]', + 'TSMethodSignature[typeParameters]', + ].join(', ')](node) { + checkNode(node, 'function'); + }, + [[ + 'ClassDeclaration[typeParameters]', + 'ClassExpression[typeParameters]', + ].join(', ')](node) { + checkNode(node, 'class'); + }, + }; + }, +}); +function isTypeParameterRepeatedInAST(node, references, startOfBody = Infinity) { + let total = 0; + for (const reference of references) { + // References inside the type parameter's definition don't count... + if (reference.identifier.range[0] < node.range[1] && + reference.identifier.range[1] > node.range[0]) { + continue; + } + // ...nor references that are outside the declaring signature. + if (reference.identifier.range[0] > startOfBody) { + continue; + } + // Neither do references that aren't to the same type parameter, + // namely value-land (non-type) identifiers of the type parameter's type, + // and references to different type parameters or values. + if (!reference.isTypeReference || + reference.identifier.name !== node.name.name) { + continue; + } + // If the type parameter is being used as a type argument, then we + // know the type parameter is being reused and can't be reported. + if (reference.identifier.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference) { + const grandparent = skipConstituentsUpward(reference.identifier.parent.parent); + if (grandparent.type === utils_1.AST_NODE_TYPES.TSTypeParameterInstantiation && + grandparent.params.includes(reference.identifier.parent) && + // Array and ReadonlyArray must be handled carefully + // let's defer the check to the type-aware phase + !(grandparent.parent.type === utils_1.AST_NODE_TYPES.TSTypeReference && + grandparent.parent.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + ['Array', 'ReadonlyArray'].includes(grandparent.parent.typeName.name))) { + return true; + } + } + total += 1; + if (total >= 2) { + return true; + } + } + return false; +} +function skipConstituentsUpward(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSIntersectionType: + case utils_1.AST_NODE_TYPES.TSUnionType: + return skipConstituentsUpward(node.parent); + default: + return node; + } +} +/** + * Count uses of type parameters in inferred return types. + * We need to resolve and analyze the inferred return type of a function + * to see whether it contains additional references to the type parameters. + * For classes, we need to do this for all their methods. + */ +function countTypeParameterUsage(checker, node) { + const counts = new Map(); + if (ts.isClassLike(node)) { + for (const typeParameter of node.typeParameters) { + collectTypeParameterUsageCounts(checker, typeParameter, counts, true); + } + for (const member of node.members) { + collectTypeParameterUsageCounts(checker, member, counts, true); + } + } + else { + collectTypeParameterUsageCounts(checker, node, counts, false); + } + return counts; +} +/** + * Populates {@link foundIdentifierUsages} by the number of times each type parameter + * appears in the given type by checking its uses through its type references. + * This is essentially a limited subset of the scope manager, but for types. + */ +function collectTypeParameterUsageCounts(checker, node, foundIdentifierUsages, fromClass) { + const visitedSymbolLists = new Set(); + const type = checker.getTypeAtLocation(node); + const typeUsages = new Map(); + const visitedConstraints = new Set(); + let functionLikeType = false; + let visitedDefault = false; + if (ts.isCallSignatureDeclaration(node) || + ts.isConstructorDeclaration(node)) { + functionLikeType = true; + visitSignature(checker.getSignatureFromDeclaration(node)); + } + if (!functionLikeType) { + visitType(type, false); + } + function visitType(type, assumeMultipleUses, isReturnType = false) { + // Seeing the same type > (threshold=3 ** 2) times indicates a likely + // recursive type, like `type T = { [P in keyof T]: T }`. + // If it's not recursive, then heck, we've seen it enough times that any + // referenced types have been counted enough to qualify as used. + if (!type || incrementTypeUsages(type) > 9) { + return; + } + if (tsutils.isTypeParameter(type)) { + const declaration = type.getSymbol()?.getDeclarations()?.[0]; + if (declaration) { + incrementIdentifierCount(declaration.name, assumeMultipleUses); + // Visiting the type of a constrained type parameter will recurse into + // the constraint. We avoid infinite loops by visiting each only once. + if (declaration.constraint && + !visitedConstraints.has(declaration.constraint)) { + visitedConstraints.add(declaration.constraint); + visitType(checker.getTypeAtLocation(declaration.constraint), false); + } + if (declaration.default && !visitedDefault) { + visitedDefault = true; + visitType(checker.getTypeAtLocation(declaration.default), false); + } + } + } + // Catch-all: generic type references like `Exclude` + else if (type.aliasTypeArguments) { + // We don't descend into the definition of the type alias, so we don't + // know whether it's used multiple times. It's safest to assume it is. + visitTypesList(type.aliasTypeArguments, true); + } + // Intersections and unions like `0 | 1` + else if (tsutils.isUnionOrIntersectionType(type)) { + visitTypesList(type.types, assumeMultipleUses); + } + // Index access types like `T[K]` + else if (tsutils.isIndexedAccessType(type)) { + visitType(type.objectType, assumeMultipleUses); + visitType(type.indexType, assumeMultipleUses); + } + // Tuple types like `[K, V]` + // Generic type references like `Map` + else if (tsutils.isTypeReference(type)) { + for (const typeArgument of type.typeArguments ?? []) { + // currently, if we are in a "class context", everything is accepted + let thisAssumeMultipleUses = fromClass || assumeMultipleUses; + // special cases - readonly arrays/tuples are considered only to use the + // type parameter once. Mutable arrays/tuples are considered to use the + // type parameter multiple times if and only if they are returned. + // other kind of type references always count as multiple uses + thisAssumeMultipleUses ||= tsutils.isTupleType(type.target) + ? isReturnType && !type.target.readonly + : checker.isArrayType(type.target) + ? isReturnType && + type.symbol?.getName() === 'Array' + : true; + visitType(typeArgument, thisAssumeMultipleUses, isReturnType); + } + } + // Template literals like `a${T}b` + else if (tsutils.isTemplateLiteralType(type)) { + for (const subType of type.types) { + visitType(subType, assumeMultipleUses); + } + } + // Conditional types like `T extends string ? T : never` + else if (tsutils.isConditionalType(type)) { + visitType(type.checkType, assumeMultipleUses); + visitType(type.extendsType, assumeMultipleUses); + } + // Catch-all: inferred object types like `{ K: V }`. + // These catch-alls should be _after_ more specific checks like + // `isTypeReference` to avoid descending into all the properties of a + // generic interface/class, e.g. `Map`. + else if (tsutils.isObjectType(type)) { + const properties = type.getProperties(); + visitSymbolsListOnce(properties, false); + if (isMappedType(type)) { + visitType(type.typeParameter, false); + if (properties.length === 0) { + // TS treats mapped types like `{[k in "a"]: T}` like `{a: T}`. + // They have properties, so we need to avoid double-counting. + visitType(type.templateType ?? type.constraintType, false); + } + } + visitType(type.getNumberIndexType(), true); + visitType(type.getStringIndexType(), true); + type.getCallSignatures().forEach(signature => { + functionLikeType = true; + visitSignature(signature); + }); + type.getConstructSignatures().forEach(signature => { + functionLikeType = true; + visitSignature(signature); + }); + } + // Catch-all: operator types like `keyof T` + else if (isOperatorType(type)) { + visitType(type.type, assumeMultipleUses); + } + } + function incrementIdentifierCount(id, assumeMultipleUses) { + const identifierCount = foundIdentifierUsages.get(id) ?? 0; + const value = assumeMultipleUses ? 2 : 1; + foundIdentifierUsages.set(id, identifierCount + value); + } + function incrementTypeUsages(type) { + const count = (typeUsages.get(type) ?? 0) + 1; + typeUsages.set(type, count); + return count; + } + function visitSignature(signature) { + if (!signature) { + return; + } + if (signature.thisParameter) { + visitType(checker.getTypeOfSymbol(signature.thisParameter), false); + } + for (const parameter of signature.parameters) { + visitType(checker.getTypeOfSymbol(parameter), false); + } + for (const typeParameter of signature.getTypeParameters() ?? []) { + visitType(typeParameter, false); + } + visitType(checker.getTypePredicateOfSignature(signature)?.type ?? + signature.getReturnType(), false, true); + } + function visitSymbolsListOnce(symbols, assumeMultipleUses) { + if (visitedSymbolLists.has(symbols)) { + return; + } + visitedSymbolLists.add(symbols); + for (const symbol of symbols) { + visitType(checker.getTypeOfSymbol(symbol), assumeMultipleUses); + } + } + function visitTypesList(types, assumeMultipleUses) { + for (const type of types) { + visitType(type, assumeMultipleUses); + } + } +} +function isMappedType(type) { + return 'typeParameter' in type; +} +function isOperatorType(type) { + return 'type' in type && !!type.type; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fdc979f11e98e4ed3b9ee36a10b20a83f16266fa --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.d.ts @@ -0,0 +1,5 @@ +export type MessageIds = 'unsafeArgument' | 'unsafeArraySpread' | 'unsafeSpread' | 'unsafeTupleSpread'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js new file mode 100644 index 0000000000000000000000000000000000000000..0ac4090cf065c54fa35e20881d6747dffdc82d82 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-argument.js @@ -0,0 +1,272 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +var RestTypeKind; +(function (RestTypeKind) { + RestTypeKind[RestTypeKind["Array"] = 0] = "Array"; + RestTypeKind[RestTypeKind["Tuple"] = 1] = "Tuple"; + RestTypeKind[RestTypeKind["Other"] = 2] = "Other"; +})(RestTypeKind || (RestTypeKind = {})); +class FunctionSignature { + paramTypes; + restType; + hasConsumedArguments = false; + parameterTypeIndex = 0; + constructor(paramTypes, restType) { + this.paramTypes = paramTypes; + this.restType = restType; + } + static create(checker, tsNode) { + const signature = checker.getResolvedSignature(tsNode); + if (!signature) { + return null; + } + const paramTypes = []; + let restType = null; + const parameters = signature.getParameters(); + for (let i = 0; i < parameters.length; i += 1) { + const param = parameters[i]; + const type = checker.getTypeOfSymbolAtLocation(param, tsNode); + const decl = param.getDeclarations()?.[0]; + if (decl && (0, util_1.isRestParameterDeclaration)(decl)) { + // is a rest param + if (checker.isArrayType(type)) { + restType = { + type: checker.getTypeArguments(type)[0], + index: i, + kind: RestTypeKind.Array, + }; + } + else if (checker.isTupleType(type)) { + restType = { + index: i, + kind: RestTypeKind.Tuple, + typeArguments: checker.getTypeArguments(type), + }; + } + else { + restType = { + type, + index: i, + kind: RestTypeKind.Other, + }; + } + break; + } + paramTypes.push(type); + } + return new this(paramTypes, restType); + } + consumeRemainingArguments() { + this.hasConsumedArguments = true; + } + getNextParameterType() { + const index = this.parameterTypeIndex; + this.parameterTypeIndex += 1; + if (index >= this.paramTypes.length || this.hasConsumedArguments) { + if (this.restType == null) { + return null; + } + switch (this.restType.kind) { + case RestTypeKind.Tuple: { + const typeArguments = this.restType.typeArguments; + if (this.hasConsumedArguments) { + // all types consumed by a rest - just assume it's the last type + // there is one edge case where this is wrong, but we ignore it because + // it's rare and really complicated to handle + // eg: function foo(...a: [number, ...string[], number]) + return typeArguments[typeArguments.length - 1]; + } + const typeIndex = index - this.restType.index; + if (typeIndex >= typeArguments.length) { + return typeArguments[typeArguments.length - 1]; + } + return typeArguments[typeIndex]; + } + case RestTypeKind.Array: + case RestTypeKind.Other: + return this.restType.type; + } + } + return this.paramTypes[index]; + } +} +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-argument', + meta: { + type: 'problem', + docs: { + description: 'Disallow calling a function with a value with type `any`', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + unsafeArgument: 'Unsafe argument of type {{sender}} assigned to a parameter of type {{receiver}}.', + unsafeArraySpread: 'Unsafe spread of an {{sender}} array type.', + unsafeSpread: 'Unsafe spread of an {{sender}} type.', + unsafeTupleSpread: 'Unsafe spread of a tuple type. The argument is {{sender}} and is assigned to a parameter of type {{receiver}}.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function describeType(type) { + if (tsutils.isIntrinsicErrorType(type)) { + return 'error typed'; + } + return `\`${checker.typeToString(type)}\``; + } + function describeTypeForSpread(type) { + if (checker.isArrayType(type) && + tsutils.isIntrinsicErrorType(checker.getTypeArguments(type)[0])) { + return 'error'; + } + return describeType(type); + } + function describeTypeForTuple(type) { + if (tsutils.isIntrinsicErrorType(type)) { + return 'error typed'; + } + return `of type \`${checker.typeToString(type)}\``; + } + function checkUnsafeArguments(args, callee, node) { + if (args.length === 0) { + return; + } + // ignore any-typed calls as these are caught by no-unsafe-call + if ((0, util_1.isTypeAnyType)(services.getTypeAtLocation(callee))) { + return; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + const signature = (0, util_1.nullThrows)(FunctionSignature.create(checker, tsNode), 'Expected to a signature resolved'); + if (node.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) { + // Consumes the first parameter (TemplateStringsArray) of the function called with TaggedTemplateExpression. + signature.getNextParameterType(); + } + for (const argument of args) { + switch (argument.type) { + // spreads consume + case utils_1.AST_NODE_TYPES.SpreadElement: { + const spreadArgType = services.getTypeAtLocation(argument.argument); + if ((0, util_1.isTypeAnyType)(spreadArgType)) { + // foo(...any) + context.report({ + node: argument, + messageId: 'unsafeSpread', + data: { sender: describeType(spreadArgType) }, + }); + } + else if ((0, util_1.isTypeAnyArrayType)(spreadArgType, checker)) { + // foo(...any[]) + // TODO - we could break down the spread and compare the array type against each argument + context.report({ + node: argument, + messageId: 'unsafeArraySpread', + data: { sender: describeTypeForSpread(spreadArgType) }, + }); + } + else if (checker.isTupleType(spreadArgType)) { + // foo(...[tuple1, tuple2]) + const spreadTypeArguments = checker.getTypeArguments(spreadArgType); + for (const tupleType of spreadTypeArguments) { + const parameterType = signature.getNextParameterType(); + if (parameterType == null) { + continue; + } + const result = (0, util_1.isUnsafeAssignment)(tupleType, parameterType, checker, + // we can't pass the individual tuple members in here as this will most likely be a spread variable + // not a spread array + null); + if (result) { + context.report({ + node: argument, + messageId: 'unsafeTupleSpread', + data: { + receiver: describeType(parameterType), + sender: describeTypeForTuple(tupleType), + }, + }); + } + } + if (spreadArgType.target.combinedFlags & ts.ElementFlags.Variable) { + // the last element was a rest - so all remaining defined arguments can be considered "consumed" + // all remaining arguments should be compared against the rest type (if one exists) + signature.consumeRemainingArguments(); + } + } + else { + // something that's iterable + // handling this will be pretty complex - so we ignore it for now + // TODO - handle generic iterable case + } + break; + } + default: { + const parameterType = signature.getNextParameterType(); + if (parameterType == null) { + continue; + } + const argumentType = services.getTypeAtLocation(argument); + const result = (0, util_1.isUnsafeAssignment)(argumentType, parameterType, checker, argument); + if (result) { + context.report({ + node: argument, + messageId: 'unsafeArgument', + data: { + receiver: describeType(parameterType), + sender: describeType(argumentType), + }, + }); + } + } + } + } + } + return { + 'CallExpression, NewExpression'(node) { + checkUnsafeArguments(node.arguments, node.callee, node); + }, + TaggedTemplateExpression(node) { + checkUnsafeArguments(node.quasi.expressions, node.tag, node); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fd6d5a568eed4ee6e9b1938f0854c17ad64e6412 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unsafeArraySpread" | "anyAssignment" | "anyAssignmentThis" | "unsafeArrayPattern" | "unsafeArrayPatternFromTuple" | "unsafeAssignment" | "unsafeObjectPattern", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js new file mode 100644 index 0000000000000000000000000000000000000000..35be48c84bc5103b95a0c903c8f1dda8c466fea2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-assignment.js @@ -0,0 +1,322 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +var ComparisonType; +(function (ComparisonType) { + /** Do no assignment comparison */ + ComparisonType[ComparisonType["None"] = 0] = "None"; + /** Use the receiver's type for comparison */ + ComparisonType[ComparisonType["Basic"] = 1] = "Basic"; + /** Use the sender's contextual type for comparison */ + ComparisonType[ComparisonType["Contextual"] = 2] = "Contextual"; +})(ComparisonType || (ComparisonType = {})); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-assignment', + meta: { + type: 'problem', + docs: { + description: 'Disallow assigning a value with type `any` to variables and properties', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + anyAssignment: 'Unsafe assignment of an {{sender}} value.', + anyAssignmentThis: [ + 'Unsafe assignment of an {{sender}} value. `this` is typed as `any`.', + 'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.', + ].join('\n'), + unsafeArrayPattern: 'Unsafe array destructuring of an {{sender}} array value.', + unsafeArrayPatternFromTuple: 'Unsafe array destructuring of a tuple element with an {{sender}} value.', + unsafeArraySpread: 'Unsafe spread of an {{sender}} value in an array.', + unsafeAssignment: 'Unsafe assignment of type {{sender}} to a variable of type {{receiver}}.', + unsafeObjectPattern: 'Unsafe object destructuring of a property with an {{sender}} value.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'noImplicitThis'); + // returns true if the assignment reported + function checkArrayDestructureHelper(receiverNode, senderNode) { + if (receiverNode.type !== utils_1.AST_NODE_TYPES.ArrayPattern) { + return false; + } + const senderTsNode = services.esTreeNodeToTSNodeMap.get(senderNode); + const senderType = services.getTypeAtLocation(senderNode); + return checkArrayDestructure(receiverNode, senderType, senderTsNode); + } + // returns true if the assignment reported + function checkArrayDestructure(receiverNode, senderType, senderNode) { + // any array + // const [x] = ([] as any[]); + if ((0, util_1.isTypeAnyArrayType)(senderType, checker)) { + context.report({ + node: receiverNode, + messageId: 'unsafeArrayPattern', + data: createData(senderType), + }); + return false; + } + if (!checker.isTupleType(senderType)) { + return true; + } + const tupleElements = checker.getTypeArguments(senderType); + // tuple with any + // const [x] = [1 as any]; + let didReport = false; + for (let receiverIndex = 0; receiverIndex < receiverNode.elements.length; receiverIndex += 1) { + const receiverElement = receiverNode.elements[receiverIndex]; + if (!receiverElement) { + continue; + } + if (receiverElement.type === utils_1.AST_NODE_TYPES.RestElement) { + // don't handle rests as they're not a 1:1 assignment + continue; + } + const senderType = tupleElements[receiverIndex]; + if (!senderType) { + continue; + } + // check for the any type first so we can handle [[[x]]] = [any] + if ((0, util_1.isTypeAnyType)(senderType)) { + context.report({ + node: receiverElement, + messageId: 'unsafeArrayPatternFromTuple', + data: createData(senderType), + }); + // we want to report on every invalid element in the tuple + didReport = true; + } + else if (receiverElement.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + didReport = checkArrayDestructure(receiverElement, senderType, senderNode); + } + else if (receiverElement.type === utils_1.AST_NODE_TYPES.ObjectPattern) { + didReport = checkObjectDestructure(receiverElement, senderType, senderNode); + } + } + return didReport; + } + // returns true if the assignment reported + function checkObjectDestructureHelper(receiverNode, senderNode) { + if (receiverNode.type !== utils_1.AST_NODE_TYPES.ObjectPattern) { + return false; + } + const senderTsNode = services.esTreeNodeToTSNodeMap.get(senderNode); + const senderType = services.getTypeAtLocation(senderNode); + return checkObjectDestructure(receiverNode, senderType, senderTsNode); + } + // returns true if the assignment reported + function checkObjectDestructure(receiverNode, senderType, senderNode) { + const properties = new Map(senderType + .getProperties() + .map(property => [ + property.getName(), + checker.getTypeOfSymbolAtLocation(property, senderNode), + ])); + let didReport = false; + for (const receiverProperty of receiverNode.properties) { + if (receiverProperty.type === utils_1.AST_NODE_TYPES.RestElement) { + // don't bother checking rest + continue; + } + let key; + if (!receiverProperty.computed) { + key = + receiverProperty.key.type === utils_1.AST_NODE_TYPES.Identifier + ? receiverProperty.key.name + : String(receiverProperty.key.value); + } + else if (receiverProperty.key.type === utils_1.AST_NODE_TYPES.Literal) { + key = String(receiverProperty.key.value); + } + else if (receiverProperty.key.type === utils_1.AST_NODE_TYPES.TemplateLiteral && + receiverProperty.key.quasis.length === 1) { + const cooked = (0, util_1.nullThrows)(receiverProperty.key.quasis[0].value.cooked, 'cooked can only be null inside a TaggedTemplateExpression, which is not possible here'); + key = cooked; + } + else { + // can't figure out the name, so skip it + continue; + } + const senderType = properties.get(key); + if (!senderType) { + continue; + } + // check for the any type first so we can handle {x: {y: z}} = {x: any} + if ((0, util_1.isTypeAnyType)(senderType)) { + context.report({ + node: receiverProperty.value, + messageId: 'unsafeObjectPattern', + data: createData(senderType), + }); + didReport = true; + } + else if (receiverProperty.value.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + didReport = checkArrayDestructure(receiverProperty.value, senderType, senderNode); + } + else if (receiverProperty.value.type === utils_1.AST_NODE_TYPES.ObjectPattern) { + didReport = checkObjectDestructure(receiverProperty.value, senderType, senderNode); + } + } + return didReport; + } + // returns true if the assignment reported + function checkAssignment(receiverNode, senderNode, reportingNode, comparisonType) { + const receiverTsNode = services.esTreeNodeToTSNodeMap.get(receiverNode); + const receiverType = comparisonType === ComparisonType.Contextual + ? ((0, util_1.getContextualType)(checker, receiverTsNode) ?? + services.getTypeAtLocation(receiverNode)) + : services.getTypeAtLocation(receiverNode); + const senderType = services.getTypeAtLocation(senderNode); + if ((0, util_1.isTypeAnyType)(senderType)) { + // handle cases when we assign any ==> unknown. + if ((0, util_1.isTypeUnknownType)(receiverType)) { + return false; + } + let messageId = 'anyAssignment'; + if (!isNoImplicitThis) { + // `var foo = this` + const thisExpression = (0, util_1.getThisExpression)(senderNode); + if (thisExpression && + (0, util_1.isTypeAnyType)((0, util_1.getConstrainedTypeAtLocation)(services, thisExpression))) { + messageId = 'anyAssignmentThis'; + } + } + context.report({ + node: reportingNode, + messageId, + data: createData(senderType), + }); + return true; + } + if (comparisonType === ComparisonType.None) { + return false; + } + const result = (0, util_1.isUnsafeAssignment)(senderType, receiverType, checker, senderNode); + if (!result) { + return false; + } + const { receiver, sender } = result; + context.report({ + node: reportingNode, + messageId: 'unsafeAssignment', + data: createData(sender, receiver), + }); + return true; + } + function getComparisonType(typeAnnotation) { + return typeAnnotation + ? // if there's a type annotation, we can do a comparison + ComparisonType.Basic + : // no type annotation means the variable's type will just be inferred, thus equal + ComparisonType.None; + } + function createData(senderType, receiverType) { + if (receiverType) { + return { + receiver: `\`${checker.typeToString(receiverType)}\``, + sender: `\`${checker.typeToString(senderType)}\``, + }; + } + return { + sender: tsutils.isIntrinsicErrorType(senderType) + ? 'error typed' + : '`any`', + }; + } + return { + 'AccessorProperty[value != null]'(node) { + checkAssignment(node.key, node.value, node, getComparisonType(node.typeAnnotation)); + }, + 'AssignmentExpression[operator = "="], AssignmentPattern'(node) { + let didReport = checkAssignment(node.left, node.right, node, + // the variable already has some form of a type to compare against + ComparisonType.Basic); + if (!didReport) { + didReport = checkArrayDestructureHelper(node.left, node.right); + } + if (!didReport) { + checkObjectDestructureHelper(node.left, node.right); + } + }, + 'PropertyDefinition[value != null]'(node) { + checkAssignment(node.key, node.value, node, getComparisonType(node.typeAnnotation)); + }, + 'VariableDeclarator[init != null]'(node) { + const init = (0, util_1.nullThrows)(node.init, util_1.NullThrowsReasons.MissingToken(node.type, 'init')); + let didReport = checkAssignment(node.id, init, node, getComparisonType(node.id.typeAnnotation)); + if (!didReport) { + didReport = checkArrayDestructureHelper(node.id, init); + } + if (!didReport) { + checkObjectDestructureHelper(node.id, init); + } + }, + // object pattern props are checked via assignments + ':not(ObjectPattern) > Property'(node) { + if (node.value.type === utils_1.AST_NODE_TYPES.AssignmentPattern || + node.value.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + // handled by other selector + return; + } + checkAssignment(node.key, node.value, node, ComparisonType.Contextual); + }, + 'ArrayExpression > SpreadElement'(node) { + const restType = services.getTypeAtLocation(node.argument); + if ((0, util_1.isTypeAnyType)(restType) || (0, util_1.isTypeAnyArrayType)(restType, checker)) { + context.report({ + node, + messageId: 'unsafeArraySpread', + data: createData(restType), + }); + } + }, + 'JSXAttribute[value != null]'(node) { + const value = (0, util_1.nullThrows)(node.value, util_1.NullThrowsReasons.MissingToken(node.type, 'value')); + if (value.type !== utils_1.AST_NODE_TYPES.JSXExpressionContainer || + value.expression.type === utils_1.AST_NODE_TYPES.JSXEmptyExpression) { + return; + } + checkAssignment(node.name, value.expression, value.expression, ComparisonType.Contextual); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7ee45d5385fec625192cc0e76d64a7cf24335809 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.d.ts @@ -0,0 +1,5 @@ +export type MessageIds = 'errorCall' | 'errorCallThis' | 'errorNew' | 'errorTemplateTag' | 'unsafeCall' | 'unsafeCallThis' | 'unsafeNew' | 'unsafeTemplateTag'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js new file mode 100644 index 0000000000000000000000000000000000000000..a6dc6dfbd2f2323a1fc8c92505cc300ddebfb5d8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-call.js @@ -0,0 +1,136 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-call', + meta: { + type: 'problem', + docs: { + description: 'Disallow calling a value with type `any`', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + errorCall: 'Unsafe call of a type that could not be resolved.', + errorCallThis: 'Unsafe call of a `this` type that could not be resolved.', + errorNew: 'Unsafe construction of a type that could not be resolved.', + errorTemplateTag: 'Unsafe use of a template tag whose type could not be resolved.', + unsafeCall: 'Unsafe call of {{type}} typed value.', + unsafeCallThis: [ + 'Unsafe call of {{type}} typed value. `this` is typed as {{type}}.', + 'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.', + ].join('\n'), + unsafeNew: 'Unsafe construction of {{type}} typed value.', + unsafeTemplateTag: 'Unsafe use of {{type}} typed template tag.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const compilerOptions = services.program.getCompilerOptions(); + const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'noImplicitThis'); + function checkCall(node, reportingNode, unsafeMessageId, errorMessageId) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + if ((0, util_1.isTypeAnyType)(type)) { + if (!isNoImplicitThis) { + // `this()` or `this.foo()` or `this.foo[bar]()` + const thisExpression = (0, util_1.getThisExpression)(node); + if (thisExpression && + (0, util_1.isTypeAnyType)((0, util_1.getConstrainedTypeAtLocation)(services, thisExpression))) { + unsafeMessageId = 'unsafeCallThis'; + errorMessageId = 'errorCallThis'; + } + } + const isErrorType = tsutils.isIntrinsicErrorType(type); + context.report({ + node: reportingNode, + messageId: isErrorType ? errorMessageId : unsafeMessageId, + data: { + type: 'an `any`', + }, + }); + return; + } + if ((0, util_1.isBuiltinSymbolLike)(services.program, type, 'Function')) { + // this also matches subtypes of `Function`, like `interface Foo extends Function {}`. + // + // For weird TS reasons that I don't understand, these are + // + // safe to construct if: + // - they have at least one call signature _that is not void-returning_, + // - OR they have at least one construct signature. + // + // safe to call (including as template) if: + // - they have at least one call signature + // - OR they have at least one construct signature. + const constructSignatures = type.getConstructSignatures(); + if (constructSignatures.length > 0) { + return; + } + const callSignatures = type.getCallSignatures(); + if (unsafeMessageId === 'unsafeNew') { + if (callSignatures.some(signature => !tsutils.isIntrinsicVoidType(signature.getReturnType()))) { + return; + } + } + else if (callSignatures.length > 0) { + return; + } + context.report({ + node: reportingNode, + messageId: unsafeMessageId, + data: { + type: 'a `Function`', + }, + }); + return; + } + } + return { + 'CallExpression > *.callee'(node) { + checkCall(node, node, 'unsafeCall', 'errorCall'); + }, + NewExpression(node) { + checkCall(node.callee, node, 'unsafeNew', 'errorNew'); + }, + 'TaggedTemplateExpression > *.tag'(node) { + checkCall(node, node, 'unsafeTemplateTag', 'errorTemplateTag'); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65b601ec341b639956b1d0c17f69b5eab8317a2b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unsafeMerging", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.js new file mode 100644 index 0000000000000000000000000000000000000000..8d54322f23e65f0946b53202166e5fca82ee1efa --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-declaration-merging.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-declaration-merging', + meta: { + type: 'problem', + docs: { + description: 'Disallow unsafe declaration merging', + recommended: 'recommended', + requiresTypeChecking: false, + }, + messages: { + unsafeMerging: 'Unsafe declaration merging between classes and interfaces.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function checkUnsafeDeclaration(scope, node, unsafeKind) { + const variable = scope.set.get(node.name); + if (!variable) { + return; + } + const defs = variable.defs; + if (defs.length <= 1) { + return; + } + if (defs.some(def => def.node.type === unsafeKind)) { + context.report({ + node, + messageId: 'unsafeMerging', + }); + } + } + return { + ClassDeclaration(node) { + if (node.id) { + // by default eslint returns the inner class scope for the ClassDeclaration node + // but we want the outer scope within which merged variables will sit + const currentScope = context.sourceCode.getScope(node).upper; + if (currentScope == null) { + return; + } + checkUnsafeDeclaration(currentScope, node.id, utils_1.AST_NODE_TYPES.TSInterfaceDeclaration); + } + }, + TSInterfaceDeclaration(node) { + checkUnsafeDeclaration(context.sourceCode.getScope(node), node.id, utils_1.AST_NODE_TYPES.ClassDeclaration); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..67ef12b469190fcee0fecda5a6bb46d75dc214ee --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"mismatchedCase" | "mismatchedCondition" | "replaceValueWithEnum", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.js new file mode 100644 index 0000000000000000000000000000000000000000..ff271cb42666f1a0047d0eb176666be009bb5353 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-enum-comparison.js @@ -0,0 +1,192 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const shared_1 = require("./enum-utils/shared"); +/** + * @returns Whether the right type is an unsafe comparison against any left type. + */ +function typeViolates(leftTypeParts, rightType) { + const leftEnumValueTypes = new Set(leftTypeParts.map(getEnumValueType)); + return ((leftEnumValueTypes.has(ts.TypeFlags.Number) && isNumberLike(rightType)) || + (leftEnumValueTypes.has(ts.TypeFlags.String) && isStringLike(rightType))); +} +function isNumberLike(type) { + return tsutils + .unionConstituents(type) + .every(unionPart => tsutils + .intersectionConstituents(unionPart) + .some(intersectionPart => tsutils.isTypeFlagSet(intersectionPart, ts.TypeFlags.Number | ts.TypeFlags.NumberLike))); +} +function isStringLike(type) { + return tsutils + .unionConstituents(type) + .every(unionPart => tsutils + .intersectionConstituents(unionPart) + .some(intersectionPart => tsutils.isTypeFlagSet(intersectionPart, ts.TypeFlags.String | ts.TypeFlags.StringLike))); +} +/** + * @returns What type a type's enum value is (number or string), if either. + */ +function getEnumValueType(type) { + return tsutils.isTypeFlagSet(type, ts.TypeFlags.EnumLike) + ? tsutils.isTypeFlagSet(type, ts.TypeFlags.NumberLiteral) + ? ts.TypeFlags.Number + : ts.TypeFlags.String + : undefined; +} +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-enum-comparison', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow comparing an enum value with a non-enum value', + recommended: 'recommended', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + mismatchedCase: 'The case statement does not have a shared enum type with the switch predicate.', + mismatchedCondition: 'The two values in this comparison do not have a shared enum type.', + replaceValueWithEnum: 'Replace with an enum value comparison.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const parserServices = (0, util_1.getParserServices)(context); + const typeChecker = parserServices.program.getTypeChecker(); + function isMismatchedComparison(leftType, rightType) { + // Allow comparisons that don't have anything to do with enums: + // + // ```ts + // 1 === 2; + // ``` + const leftEnumTypes = (0, shared_1.getEnumTypes)(typeChecker, leftType); + const rightEnumTypes = new Set((0, shared_1.getEnumTypes)(typeChecker, rightType)); + if (leftEnumTypes.length === 0 && rightEnumTypes.size === 0) { + return false; + } + // Allow comparisons that share an enum type: + // + // ```ts + // Fruit.Apple === Fruit.Banana; + // ``` + for (const leftEnumType of leftEnumTypes) { + if (rightEnumTypes.has(leftEnumType)) { + return false; + } + } + // We need to split the type into the union type parts in order to find + // valid enum comparisons like: + // + // ```ts + // declare const something: Fruit | Vegetable; + // something === Fruit.Apple; + // ``` + const leftTypeParts = tsutils.unionConstituents(leftType); + const rightTypeParts = tsutils.unionConstituents(rightType); + // If a type exists in both sides, we consider this comparison safe: + // + // ```ts + // declare const fruit: Fruit.Apple | 0; + // fruit === 0; + // ``` + for (const leftTypePart of leftTypeParts) { + if (rightTypeParts.includes(leftTypePart)) { + return false; + } + } + return (typeViolates(leftTypeParts, rightType) || + typeViolates(rightTypeParts, leftType)); + } + return { + 'BinaryExpression[operator=/^[<>!=]?={0,2}$/]'(node) { + const leftType = parserServices.getTypeAtLocation(node.left); + const rightType = parserServices.getTypeAtLocation(node.right); + if (isMismatchedComparison(leftType, rightType)) { + context.report({ + node, + messageId: 'mismatchedCondition', + suggest: [ + { + messageId: 'replaceValueWithEnum', + fix(fixer) { + // Replace the right side with an enum key if possible: + // + // ```ts + // Fruit.Apple === 'apple'; // Fruit.Apple === Fruit.Apple + // ``` + const leftEnumKey = (0, shared_1.getEnumKeyForLiteral)((0, shared_1.getEnumLiterals)(leftType), (0, util_1.getStaticValue)(node.right)?.value); + if (leftEnumKey) { + return fixer.replaceText(node.right, leftEnumKey); + } + // Replace the left side with an enum key if possible: + // + // ```ts + // declare const fruit: Fruit; + // 'apple' === Fruit.Apple; // Fruit.Apple === Fruit.Apple + // ``` + const rightEnumKey = (0, shared_1.getEnumKeyForLiteral)((0, shared_1.getEnumLiterals)(rightType), (0, util_1.getStaticValue)(node.left)?.value); + if (rightEnumKey) { + return fixer.replaceText(node.left, rightEnumKey); + } + return null; + }, + }, + ], + }); + } + }, + SwitchCase(node) { + // Ignore `default` cases. + if (node.test == null) { + return; + } + const { parent } = node; + const leftType = parserServices.getTypeAtLocation(parent.discriminant); + const rightType = parserServices.getTypeAtLocation(node.test); + if (isMismatchedComparison(leftType, rightType)) { + context.report({ + node, + messageId: 'mismatchedCase', + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9fbcdc9062fd7cc762a7aab4a20ea001f3ea3d86 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"bannedFunctionType", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.js new file mode 100644 index 0000000000000000000000000000000000000000..c749232ce36089ccd4d9537c7ddd0eda0b4aa137 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-function-type.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-function-type', + meta: { + type: 'problem', + docs: { + description: 'Disallow using the unsafe built-in Function type', + recommended: 'recommended', + }, + messages: { + bannedFunctionType: [ + 'The `Function` type accepts any function-like value.', + 'Prefer explicitly defining any function parameters and return type.', + ].join('\n'), + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function checkBannedTypes(node) { + if (node.type === utils_1.AST_NODE_TYPES.Identifier && + node.name === 'Function' && + (0, util_1.isReferenceToGlobalFunction)('Function', node, context.sourceCode)) { + context.report({ + node, + messageId: 'bannedFunctionType', + }); + } + } + return { + TSClassImplements(node) { + checkBannedTypes(node.expression); + }, + TSInterfaceHeritage(node) { + checkBannedTypes(node.expression); + }, + TSTypeReference(node) { + checkBannedTypes(node.typeName); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c58dbc0571be6ec7a9d6eecbcb787c1476ed680c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.d.ts @@ -0,0 +1,10 @@ +export type Options = [ + { + allowOptionalChaining?: boolean; + } +]; +export type MessageIds = 'errorComputedMemberAccess' | 'errorMemberExpression' | 'errorThisMemberExpression' | 'unsafeComputedMemberAccess' | 'unsafeMemberExpression' | 'unsafeThisMemberExpression'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js new file mode 100644 index 0000000000000000000000000000000000000000..d944a9ded54f9c0ee53e85ec5fe1593d2e8f80ab --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-member-access.js @@ -0,0 +1,183 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +var State; +(function (State) { + State[State["Unsafe"] = 1] = "Unsafe"; + State[State["Safe"] = 2] = "Safe"; + State[State["Chained"] = 3] = "Chained"; +})(State || (State = {})); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-member-access', + meta: { + type: 'problem', + docs: { + description: 'Disallow member access on a value with type `any`', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + errorComputedMemberAccess: 'The type of computed name {{property}} cannot be resolved.', + errorMemberExpression: 'Unsafe member access {{property}} on a type that cannot be resolved.', + errorThisMemberExpression: [ + 'Unsafe member access {{property}}. The type of `this` cannot be resolved.', + 'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.', + ].join('\n'), + unsafeComputedMemberAccess: 'Computed name {{property}} resolves to an `any` value.', + unsafeMemberExpression: 'Unsafe member access {{property}} on an `any` value.', + unsafeThisMemberExpression: [ + 'Unsafe member access {{property}} on an `any` value. `this` is typed as `any`.', + 'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.', + ].join('\n'), + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowOptionalChaining: { + type: 'boolean', + description: 'Whether to allow `?.` optional chains on `any` values.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowOptionalChaining: false, + }, + ], + create(context, [{ allowOptionalChaining }]) { + const services = (0, util_1.getParserServices)(context); + const compilerOptions = services.program.getCompilerOptions(); + const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'noImplicitThis'); + const stateCache = new Map(); + // Case notes: + // value?.outer.middle.inner + // The ChainExpression is a child of the root expression, and a parent of all the MemberExpressions. + // But the left-most expression is what we want to report on: the inner-most expressions. + // In fact, this is true even if the chain is on the inside! + // value.outer.middle?.inner; + // It was already true that every `object` (MemberExpression) has optional: boolean + function checkMemberExpression(node) { + if (allowOptionalChaining && node.optional) { + stateCache.set(node, State.Chained); + return State.Chained; + } + const cachedState = stateCache.get(node); + if (cachedState) { + return cachedState; + } + if (node.object.type === utils_1.AST_NODE_TYPES.MemberExpression) { + const objectState = checkMemberExpression(node.object); + if (objectState === State.Unsafe) { + // if the object is unsafe, we know this will be unsafe as well + // we don't need to report, as we have already reported on the inner member expr + stateCache.set(node, objectState); + return objectState; + } + } + const type = services.getTypeAtLocation(node.object); + const state = (0, util_1.isTypeAnyType)(type) ? State.Unsafe : State.Safe; + stateCache.set(node, state); + if (state === State.Unsafe) { + const propertyName = context.sourceCode.getText(node.property); + let messageId; + if (!isNoImplicitThis) { + // `this.foo` or `this.foo[bar]` + const thisExpression = (0, util_1.getThisExpression)(node); + if (thisExpression) { + const thisType = (0, util_1.getConstrainedTypeAtLocation)(services, thisExpression); + if ((0, util_1.isTypeAnyType)(thisType)) { + messageId = tsutils.isIntrinsicErrorType(thisType) + ? 'errorThisMemberExpression' + : 'unsafeThisMemberExpression'; + } + } + } + if (!messageId) { + messageId = tsutils.isIntrinsicErrorType(type) + ? 'errorMemberExpression' + : 'unsafeMemberExpression'; + } + context.report({ + node: node.property, + messageId, + data: { + property: node.computed ? `[${propertyName}]` : `.${propertyName}`, + }, + }); + } + return state; + } + return { + // ignore MemberExpressions with ancestors of type `TSClassImplements` or `TSInterfaceHeritage` + 'MemberExpression:not(TSClassImplements MemberExpression, TSInterfaceHeritage MemberExpression)': checkMemberExpression, + 'MemberExpression[computed = true] > *.property'(node) { + if (allowOptionalChaining && + node.parent.optional) { + return; + } + if ( + // x[1] + node.type === utils_1.AST_NODE_TYPES.Literal || + // x[1++] x[++x] etc + // FUN FACT - **all** update expressions return type number, regardless of the argument's type, + // because JS engines return NaN if there the argument is not a number. + node.type === utils_1.AST_NODE_TYPES.UpdateExpression) { + // perf optimizations - literals can obviously never be `any` + return; + } + const type = services.getTypeAtLocation(node); + if ((0, util_1.isTypeAnyType)(type)) { + const propertyName = context.sourceCode.getText(node); + context.report({ + node, + messageId: tsutils.isIntrinsicErrorType(type) + ? 'errorComputedMemberAccess' + : 'unsafeComputedMemberAccess', + data: { + property: `[${propertyName}]`, + }, + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d600b743598847bedbb30fa6a8c96e85a181b36b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unsafeReturn" | "unsafeReturnAssignment" | "unsafeReturnThis", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js new file mode 100644 index 0000000000000000000000000000000000000000..e5cf41ea0cc87a75180251a41802a31a5fed12ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-return.js @@ -0,0 +1,184 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const getParentFunctionNode_1 = require("../util/getParentFunctionNode"); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-return', + meta: { + type: 'problem', + docs: { + description: 'Disallow returning a value with type `any` from a function', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + unsafeReturn: 'Unsafe return of a value of type {{type}}.', + unsafeReturnAssignment: 'Unsafe return of type `{{sender}}` from function with return type `{{receiver}}`.', + unsafeReturnThis: [ + 'Unsafe return of a value of type `{{type}}`. `this` is typed as `any`.', + 'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.', + ].join('\n'), + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'noImplicitThis'); + function checkReturn(returnNode, reportingNode = returnNode) { + const functionNode = (0, getParentFunctionNode_1.getParentFunctionNode)(returnNode); + /* istanbul ignore if */ if (!functionNode) { + return; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(returnNode); + const type = checker.getTypeAtLocation(tsNode); + const anyType = (0, util_1.discriminateAnyType)(type, checker, services.program, tsNode); + // function has an explicit return type, so ensure it's a safe return + const returnNodeType = services.getTypeAtLocation(returnNode); + const constrainedReturnNodeType = (0, util_1.getConstrainedTypeAtLocation)(services, returnNode); + const functionTSNode = services.esTreeNodeToTSNodeMap.get(functionNode); + // function expressions will not have their return type modified based on receiver typing + // so we have to use the contextual typing in these cases, i.e. + // const foo1: () => Set = () => new Set(); + // the return type of the arrow function is Set even though the variable is typed as Set + let functionType = ts.isFunctionExpression(functionTSNode) || + ts.isArrowFunction(functionTSNode) + ? (0, util_1.getContextualType)(checker, functionTSNode) + : services.getTypeAtLocation(functionNode); + functionType ??= services.getTypeAtLocation(functionNode); + const callSignatures = tsutils.getCallSignaturesOfType(functionType); + // If there is an explicit type annotation *and* that type matches the actual + // function return type, we shouldn't complain (it's intentional, even if unsafe) + if (functionTSNode.type) { + for (const signature of callSignatures) { + const signatureReturnType = signature.getReturnType(); + if (returnNodeType === signatureReturnType || + (0, util_1.isTypeFlagSet)(signatureReturnType, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return; + } + if (functionNode.async) { + const awaitedSignatureReturnType = checker.getAwaitedType(signatureReturnType); + const awaitedReturnNodeType = checker.getAwaitedType(returnNodeType); + if (awaitedReturnNodeType === awaitedSignatureReturnType || + (awaitedSignatureReturnType && + (0, util_1.isTypeFlagSet)(awaitedSignatureReturnType, ts.TypeFlags.Any | ts.TypeFlags.Unknown))) { + return; + } + } + } + } + if (anyType !== util_1.AnyType.Safe) { + // Allow cases when the declared return type of the function is either unknown or unknown[] + // and the function is returning any or any[]. + for (const signature of callSignatures) { + const functionReturnType = signature.getReturnType(); + if (anyType === util_1.AnyType.Any && + (0, util_1.isTypeUnknownType)(functionReturnType)) { + return; + } + if (anyType === util_1.AnyType.AnyArray && + (0, util_1.isTypeUnknownArrayType)(functionReturnType, checker)) { + return; + } + const awaitedType = checker.getAwaitedType(functionReturnType); + if (awaitedType && + anyType === util_1.AnyType.PromiseAny && + (0, util_1.isTypeUnknownType)(awaitedType)) { + return; + } + } + if (anyType === util_1.AnyType.PromiseAny && !functionNode.async) { + return; + } + let messageId = 'unsafeReturn'; + const isErrorType = tsutils.isIntrinsicErrorType(constrainedReturnNodeType); + if (!isNoImplicitThis) { + // `return this` + const thisExpression = (0, util_1.getThisExpression)(returnNode); + if (thisExpression && + (0, util_1.isTypeAnyType)((0, util_1.getConstrainedTypeAtLocation)(services, thisExpression))) { + messageId = 'unsafeReturnThis'; + } + } + // If the function return type was not unknown/unknown[], mark usage as unsafeReturn. + return context.report({ + node: reportingNode, + messageId, + data: { + type: isErrorType + ? 'error' + : anyType === util_1.AnyType.Any + ? '`any`' + : anyType === util_1.AnyType.PromiseAny + ? '`Promise`' + : '`any[]`', + }, + }); + } + const signature = functionType.getCallSignatures().at(0); + if (signature) { + const functionReturnType = signature.getReturnType(); + const result = (0, util_1.isUnsafeAssignment)(returnNodeType, functionReturnType, checker, returnNode); + if (!result) { + return; + } + const { receiver, sender } = result; + return context.report({ + node: reportingNode, + messageId: 'unsafeReturnAssignment', + data: { + receiver: checker.typeToString(receiver), + sender: checker.typeToString(sender), + }, + }); + } + } + return { + 'ArrowFunctionExpression > :not(BlockStatement).body': checkReturn, + ReturnStatement(node) { + const argument = node.argument; + if (!argument) { + return; + } + checkReturn(argument, node); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aed2514d2a001459fa2908d2c72fcc87fdd52b94 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unsafeOfAnyTypeAssertion" | "unsafeToAnyTypeAssertion" | "unsafeToUnconstrainedTypeAssertion" | "unsafeTypeAssertion" | "unsafeTypeAssertionAssignableToConstraint", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.js new file mode 100644 index 0000000000000000000000000000000000000000..c20a60ea6a2efb775ee77a8d923970e3cab64b56 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-type-assertion.js @@ -0,0 +1,165 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-unsafe-type-assertion', + meta: { + type: 'problem', + docs: { + description: 'Disallow type assertions that narrow a type', + requiresTypeChecking: true, + }, + messages: { + unsafeOfAnyTypeAssertion: 'Unsafe assertion from {{type}} detected: consider using type guards or a safer assertion.', + unsafeToAnyTypeAssertion: 'Unsafe assertion to {{type}} detected: consider using a more specific type to ensure safety.', + unsafeToUnconstrainedTypeAssertion: "Unsafe type assertion: '{{type}}' could be instantiated with an arbitrary type which could be unrelated to the original type.", + unsafeTypeAssertion: "Unsafe type assertion: type '{{type}}' is more narrow than the original type.", + unsafeTypeAssertionAssignableToConstraint: "Unsafe type assertion: the original type is assignable to the constraint of type '{{type}}', but '{{type}}' could be instantiated with a different subtype of its constraint.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function getAnyTypeName(type) { + return tsutils.isIntrinsicErrorType(type) ? 'error typed' : '`any`'; + } + function isObjectLiteralType(type) { + return (tsutils.isObjectType(type) && + tsutils.isObjectFlagSet(type, ts.ObjectFlags.ObjectLiteral)); + } + function checkExpression(node) { + const expressionType = services.getTypeAtLocation(node.expression); + const assertedType = services.getTypeAtLocation(node.typeAnnotation); + if (expressionType === assertedType) { + return; + } + // handle cases when asserting unknown ==> any. + if ((0, util_1.isTypeAnyType)(assertedType) && (0, util_1.isTypeUnknownType)(expressionType)) { + context.report({ + node, + messageId: 'unsafeToAnyTypeAssertion', + data: { + type: '`any`', + }, + }); + return; + } + const unsafeExpressionAny = (0, util_1.isUnsafeAssignment)(expressionType, assertedType, checker, node.expression); + if (unsafeExpressionAny) { + context.report({ + node, + messageId: 'unsafeOfAnyTypeAssertion', + data: { + type: getAnyTypeName(unsafeExpressionAny.sender), + }, + }); + return; + } + const unsafeAssertedAny = (0, util_1.isUnsafeAssignment)(assertedType, expressionType, checker, node.typeAnnotation); + if (unsafeAssertedAny) { + context.report({ + node, + messageId: 'unsafeToAnyTypeAssertion', + data: { + type: getAnyTypeName(unsafeAssertedAny.sender), + }, + }); + return; + } + // Use the widened type in case of an object literal so `isTypeAssignableTo()` + // won't fail on excess property check. + const expressionWidenedType = isObjectLiteralType(expressionType) + ? checker.getWidenedType(expressionType) + : expressionType; + let isAssertionSafe; + try { + isAssertionSafe = checker.isTypeAssignableTo(expressionWidenedType, assertedType); + } + catch { + // workaround for https://github.com/microsoft/TypeScript/issues/62933 + return; + } + if (isAssertionSafe) { + return; + } + // Produce a more specific error message when targeting a type parameter + if (tsutils.isTypeParameter(assertedType)) { + const assertedTypeConstraint = checker.getBaseConstraintOfType(assertedType); + if (!assertedTypeConstraint) { + // asserting to an unconstrained type parameter is unsafe + context.report({ + node, + messageId: 'unsafeToUnconstrainedTypeAssertion', + data: { + type: checker.typeToString(assertedType), + }, + }); + return; + } + // special case message if the original type is assignable to the + // constraint of the target type parameter + const isAssignableToConstraint = checker.isTypeAssignableTo(expressionWidenedType, assertedTypeConstraint); + if (isAssignableToConstraint) { + context.report({ + node, + messageId: 'unsafeTypeAssertionAssignableToConstraint', + data: { + type: checker.typeToString(assertedType), + }, + }); + return; + } + } + // General error message + context.report({ + node, + messageId: 'unsafeTypeAssertion', + data: { + type: checker.typeToString(assertedType), + }, + }); + } + return { + 'TSAsExpression, TSTypeAssertion'(node) { + checkExpression(node); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..11751cb79a3d3cc4a48686eb64c0d22474046d47 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.d.ts @@ -0,0 +1,6 @@ +export type Options = []; +export type MessageIds = 'unaryMinus'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unaryMinus", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.js new file mode 100644 index 0000000000000000000000000000000000000000..749f4b01e956beb10e536346e1e941d9aa24f494 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unsafe-unary-minus.js @@ -0,0 +1,78 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'no-unsafe-unary-minus', + meta: { + type: 'problem', + docs: { + description: 'Require unary negation to take a number', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + unaryMinus: 'Argument of unary negation should be assignable to number | bigint but is {{type}} instead.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + UnaryExpression(node) { + if (node.operator !== '-') { + return; + } + const services = util.getParserServices(context); + const argType = util.getConstrainedTypeAtLocation(services, node.argument); + const checker = services.program.getTypeChecker(); + if (tsutils + .unionConstituents(argType) + .some(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Any | + ts.TypeFlags.Never | + ts.TypeFlags.BigIntLike | + ts.TypeFlags.NumberLike))) { + context.report({ + node, + messageId: 'unaryMinus', + data: { type: checker.typeToString(argType) }, + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..64997868d12f10160360a020b168e8a5204b2394 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.d.ts @@ -0,0 +1,19 @@ +import { TSESTree } from '@typescript-eslint/utils'; +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util'; +declare const baseRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedExpression", [{ + allowShortCircuit?: boolean; + allowTaggedTemplates?: boolean; + allowTernary?: boolean; +}], unknown, { + ExpressionStatement(node: TSESTree.ExpressionStatement): void; +}>; +export type MessageIds = InferMessageIdsTypeFromRule; +export type Options = InferOptionsTypeFromRule; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedExpression", [{ + allowShortCircuit?: boolean; + allowTaggedTemplates?: boolean; + allowTernary?: boolean; +}], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js new file mode 100644 index 0000000000000000000000000000000000000000..c8118c511341903be8f6cd0974e142f324ecaf3f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-expressions.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-unused-expressions'); +const defaultOptions = [ + { + allowShortCircuit: false, + allowTaggedTemplates: false, + allowTernary: false, + }, +]; +exports.default = (0, util_1.createRule)({ + name: 'no-unused-expressions', + meta: { + type: 'suggestion', + defaultOptions, + docs: { + description: 'Disallow unused expressions', + extendsBaseRule: true, + recommended: 'recommended', + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: baseRule.meta.schema, + }, + defaultOptions, + create(context, [{ allowShortCircuit = false, allowTernary = false }]) { + const rules = baseRule.create(context); + function isValidExpression(node) { + if (allowShortCircuit && node.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + return isValidExpression(node.right); + } + if (allowTernary && node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) { + return (isValidExpression(node.alternate) && + isValidExpression(node.consequent)); + } + return ((node.type === utils_1.AST_NODE_TYPES.ChainExpression && + node.expression.type === utils_1.AST_NODE_TYPES.CallExpression) || + node.type === utils_1.AST_NODE_TYPES.ImportExpression); + } + return { + ExpressionStatement(node) { + if (node.directive || isValidExpression(node.expression)) { + return; + } + const expressionType = node.expression.type; + if (expressionType === + utils_1.TSESTree.AST_NODE_TYPES.TSInstantiationExpression || + expressionType === utils_1.TSESTree.AST_NODE_TYPES.TSAsExpression || + expressionType === utils_1.TSESTree.AST_NODE_TYPES.TSNonNullExpression || + expressionType === utils_1.TSESTree.AST_NODE_TYPES.TSTypeAssertion) { + rules.ExpressionStatement({ + ...node, + expression: node.expression.expression, + }); + return; + } + rules.ExpressionStatement(node); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-private-class-members.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-private-class-members.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5dc409b42663e40d314083afee9a1c680d82bd6b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-private-class-members.d.ts @@ -0,0 +1,6 @@ +import { ESLintUtils } from '@typescript-eslint/utils'; +export type MessageIds = 'unusedPrivateClassMember'; +declare const _default: ESLintUtils.RuleModule<"unusedPrivateClassMember", [], import("../../rules").ESLintPluginDocs, ESLintUtils.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-private-class-members.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-private-class-members.js new file mode 100644 index 0000000000000000000000000000000000000000..d9f26f93d77654a17ba3c90a3d9ded588de405f9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-private-class-members.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const classScopeAnalyzer_1 = require("../util/class-scope-analyzer/classScopeAnalyzer"); +exports.default = (0, util_1.createRule)({ + name: 'no-unused-private-class-members', + meta: { + type: 'problem', + docs: { + description: 'Disallow unused private class members', + extendsBaseRule: true, + requiresTypeChecking: false, + }, + messages: { + unusedPrivateClassMember: "Private class member '{{classMemberName}}' is defined but never used.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + 'Program:exit'(node) { + const result = (0, classScopeAnalyzer_1.analyzeClassMemberUsage)(node, utils_1.ESLintUtils.nullThrows(context.sourceCode.scopeManager, 'Missing required scope manager')); + for (const classScope of result.values()) { + for (const member of [ + ...classScope.members.instance.values(), + ...classScope.members.static.values(), + ]) { + if ((!member.isPrivate() && !member.isHashPrivate()) || + member.isUsed()) { + continue; + } + context.report({ + node: member.nameNode, + messageId: 'unusedPrivateClassMember', + data: { classMemberName: member.name }, + }); + } + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..63402e950e1b65fbb8bedefb091e2a1c52b3ca94 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.d.ts @@ -0,0 +1,24 @@ +import { TSESLint } from '@typescript-eslint/utils'; +export type MessageIds = 'removeUnusedImportDeclaration' | 'removeUnusedVar' | 'unusedVar' | 'usedIgnoredVar' | 'usedOnlyAsType'; +export type Options = [ + 'all' | 'local' | { + args?: 'after-used' | 'all' | 'none'; + argsIgnorePattern?: string; + caughtErrors?: 'all' | 'none'; + caughtErrorsIgnorePattern?: string; + destructuredArrayIgnorePattern?: string; + enableAutofixRemoval?: { + imports?: boolean; + }; + ignoreClassWithStaticInitBlock?: boolean; + ignoreRestSiblings?: boolean; + ignoreUsingDeclarations?: boolean; + reportUsedIgnorePattern?: boolean; + vars?: 'all' | 'local'; + varsIgnorePattern?: string; + } +]; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js new file mode 100644 index 0000000000000000000000000000000000000000..03e352d88059ac6c9f54f5bf589cfc479c4f75f0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js @@ -0,0 +1,1035 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const referenceContainsTypePredicate_1 = require("../util/referenceContainsTypePredicate"); +const referenceContainsTypeQuery_1 = require("../util/referenceContainsTypeQuery"); +// this is a superset of DefinitionType which defines sub-types for better granularity +var VariableType; +(function (VariableType) { + // New sub-types + VariableType[VariableType["ArrayDestructure"] = 0] = "ArrayDestructure"; + // DefinitionType + VariableType[VariableType["CatchClause"] = 1] = "CatchClause"; + VariableType[VariableType["ClassName"] = 2] = "ClassName"; + VariableType[VariableType["FunctionName"] = 3] = "FunctionName"; + VariableType[VariableType["ImportBinding"] = 4] = "ImportBinding"; + VariableType[VariableType["ImplicitGlobalVariable"] = 5] = "ImplicitGlobalVariable"; + VariableType[VariableType["Parameter"] = 6] = "Parameter"; + VariableType[VariableType["TSEnumMember"] = 7] = "TSEnumMember"; + VariableType[VariableType["TSEnumName"] = 8] = "TSEnumName"; + VariableType[VariableType["TSModuleName"] = 9] = "TSModuleName"; + VariableType[VariableType["Type"] = 10] = "Type"; + VariableType[VariableType["Variable"] = 11] = "Variable"; +})(VariableType || (VariableType = {})); +const isCommaToken = { + predicate: (token) => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && token.value === ',', + tokenChar: ',', +}; +const isLeftCurlyToken = { + predicate: (token) => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && token.value === '{', + tokenChar: '{', +}; +const isRightCurlyToken = { + predicate: (token) => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && token.value === '}', + tokenChar: '}', +}; +function assertToken({ predicate, tokenChar }, token) { + if (token == null) { + throw new Error(`Expected a valid "${tokenChar}" token, but found no token`); + } + if (!predicate(token)) { + throw new Error(`Expected a valid "${tokenChar}" token, but got "${token.value}" instead`); + } + return token; +} +exports.default = (0, util_1.createRule)({ + name: 'no-unused-vars', + meta: { + type: 'problem', + docs: { + description: 'Disallow unused variables', + extendsBaseRule: true, + recommended: 'recommended', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + removeUnusedImportDeclaration: 'Remove unused import declaration.', + removeUnusedVar: 'Remove unused variable "{{varName}}".', + unusedVar: "'{{varName}}' is {{action}} but never used{{additional}}.", + usedIgnoredVar: "'{{varName}}' is marked as ignored but is used{{additional}}.", + usedOnlyAsType: "'{{varName}}' is {{action}} but only used as a type{{additional}}.", + }, + schema: [ + { + oneOf: [ + { + type: 'string', + description: 'Broad setting for unused variables to target.', + enum: ['all', 'local'], + }, + { + type: 'object', + additionalProperties: false, + properties: { + args: { + type: 'string', + description: 'Whether to check all, some, or no arguments.', + enum: ['all', 'after-used', 'none'], + }, + argsIgnorePattern: { + type: 'string', + description: 'Regular expressions of argument names to not check for usage.', + }, + caughtErrors: { + type: 'string', + description: 'Whether to check catch block arguments.', + enum: ['all', 'none'], + }, + caughtErrorsIgnorePattern: { + type: 'string', + description: 'Regular expressions of catch block argument names to not check for usage.', + }, + destructuredArrayIgnorePattern: { + type: 'string', + description: 'Regular expressions of destructured array variable names to not check for usage.', + }, + enableAutofixRemoval: { + type: 'object', + additionalProperties: false, + description: 'Configurable automatic fixes for different types of unused variables.', + properties: { + imports: { + type: 'boolean', + description: 'Whether to enable automatic removal of unused imports.', + }, + }, + }, + ignoreClassWithStaticInitBlock: { + type: 'boolean', + description: 'Whether to ignore classes with at least one static initialization block.', + }, + ignoreRestSiblings: { + type: 'boolean', + description: 'Whether to ignore sibling properties in `...` destructurings.', + }, + ignoreUsingDeclarations: { + type: 'boolean', + description: 'Whether to ignore using or await using declarations.', + }, + reportUsedIgnorePattern: { + type: 'boolean', + description: 'Whether to report variables that match any of the valid ignore pattern options if they have been used.', + }, + vars: { + type: 'string', + description: 'Whether to check all variables or only locally-declared variables.', + enum: ['all', 'local'], + }, + varsIgnorePattern: { + type: 'string', + description: 'Regular expressions of variable names to not check for usage.', + }, + }, + }, + ], + }, + ], + }, + defaultOptions: [{}], + create(context, [firstOption]) { + const MODULE_DECL_CACHE = new Map(); + const reportedUnusedVariables = new Set(); + function areAllSpecifiersUnused(decl) { + return context.sourceCode.getDeclaredVariables(decl).every(variable => { + return reportedUnusedVariables.has(variable); + }); + } + const report = (unusedVar, opts) => { + reportedUnusedVariables.add(unusedVar); + const writeReferences = unusedVar.references.filter(ref => ref.isWrite() && + ref.from.variableScope === unusedVar.scope.variableScope); + const id = writeReferences.length + ? writeReferences[writeReferences.length - 1].identifier + : unusedVar.identifiers[0]; + const { start } = id.loc; + const idLength = id.name.length; + const loc = { + start, + end: { + column: start.column + idLength, + line: start.line, + }, + }; + const fixer = (() => { + const { messageId, fix, useAutofix } = (() => { + if (unusedVar.defs.length !== 1) { + // If there's multiple definitions then we'd have to clean them all + // up! That's complicated and messy so for now let's just ignore it. + return {}; + } + const { type, def } = defToVariableType(unusedVar.defs[0]); + switch (type) { + case VariableType.ArrayDestructure: + // TODO(bradzacher) -- this would be really easy to implement and + // is side-effect free! + return {}; + case VariableType.CatchClause: + // TODO(bradzacher) -- this would be really easy to implement and + // is side-effect free! + return {}; + case VariableType.ClassName: + // This would be easy to implement -- but classes can have + // side-effects in static initializers / static blocks. So it's + // dangerous to ever auto-fix remove them. + // + // Perhaps as an always-suggestion fixer...? + return {}; + case VariableType.FunctionName: + // TODO(bradzacher) -- this would be really easy to implement and + // is side-effect free! + return {}; + case VariableType.ImportBinding: + return { + ...getImportFixer(def), + useAutofix: options.enableAutofixRemoval.imports, + }; + case VariableType.ImplicitGlobalVariable: + // We don't report these via this code path, so no fixer is possible + return {}; + case VariableType.Parameter: + // This is easy to implement -- but we cannot implement it cos it + // changes the signature of the function which in turn might + // introduce type errors in consumers. + // + // Also parameters can have default values which might have + // side-effects. + // + // Perhaps as an always-suggestion fixer...? + return {}; + case VariableType.TSEnumMember: + // We don't report unused enum members so no fixer is ever possible + return {}; + case VariableType.TSEnumName: + // TODO(bradzacher) -- this would be really easy to implement and + // is side-effect free! + return {}; + case VariableType.TSModuleName: + // This is easy to implement -- but TS namespaces are eagerly + // initialized -- meaning that they might have side-effects in + // the body. So it's dangerous to ever auto-fix remove them. + // + // Perhaps as an always-suggestion fixer...? + return {}; + case VariableType.Type: + // TODO(bradzacher) -- this would be really easy to implement and + // is side-effect free! + return {}; + case VariableType.Variable: + // TODO(bradzacher) -- this would be really easy to implement + return {}; + } + })(); + if (!fix) { + return {}; + } + if (useAutofix) { + return { fix }; + } + const data = { + varName: unusedVar.name, + }; + return { + suggest: [ + { + messageId: messageId ?? 'removeUnusedVar', + data, + fix, + }, + ], + }; + })(); + context.report({ + ...opts, + ...fixer, + loc, + node: id, + }); + }; + const options = (() => { + const options = { + args: 'after-used', + caughtErrors: 'all', + enableAutofixRemoval: { + imports: false, + }, + ignoreClassWithStaticInitBlock: false, + ignoreRestSiblings: false, + ignoreUsingDeclarations: false, + reportUsedIgnorePattern: false, + vars: 'all', + }; + if (typeof firstOption === 'string') { + options.vars = firstOption; + } + else { + options.vars = firstOption.vars ?? options.vars; + options.args = firstOption.args ?? options.args; + options.ignoreRestSiblings = + firstOption.ignoreRestSiblings ?? options.ignoreRestSiblings; + options.ignoreUsingDeclarations = + firstOption.ignoreUsingDeclarations ?? + options.ignoreUsingDeclarations; + options.caughtErrors = firstOption.caughtErrors ?? options.caughtErrors; + options.ignoreClassWithStaticInitBlock = + firstOption.ignoreClassWithStaticInitBlock ?? + options.ignoreClassWithStaticInitBlock; + options.reportUsedIgnorePattern = + firstOption.reportUsedIgnorePattern ?? + options.reportUsedIgnorePattern; + if (firstOption.varsIgnorePattern) { + options.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern, 'u'); + } + if (firstOption.argsIgnorePattern) { + options.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern, 'u'); + } + if (firstOption.caughtErrorsIgnorePattern) { + options.caughtErrorsIgnorePattern = new RegExp(firstOption.caughtErrorsIgnorePattern, 'u'); + } + if (firstOption.destructuredArrayIgnorePattern) { + options.destructuredArrayIgnorePattern = new RegExp(firstOption.destructuredArrayIgnorePattern, 'u'); + } + if (firstOption.enableAutofixRemoval) { + // eslint-disable-next-line unicorn/no-lonely-if -- will add more cases later + if (firstOption.enableAutofixRemoval.imports != null) { + options.enableAutofixRemoval.imports = + firstOption.enableAutofixRemoval.imports; + } + } + } + return options; + })(); + function removeNodeWithTrailingNewline(fixer, node) { + const sourceCode = context.sourceCode; + const { line: startLine } = node.loc.start; + const { line: endLine } = node.loc.end; + // Expand range: start of first line to start of next line (or EOF) + const lineRangeStart = sourceCode.getIndexFromLoc({ + column: 0, + line: startLine, + }); + const lineRangeEnd = endLine < sourceCode.lines.length + ? sourceCode.getIndexFromLoc({ column: 0, line: endLine + 1 }) + : sourceCode.text.length; + // If node is the only non-whitespace on its line(s), remove full line(s) + if (sourceCode.getText(node) === + sourceCode.text.slice(lineRangeStart, lineRangeEnd).trim()) { + return fixer.removeRange([lineRangeStart, lineRangeEnd]); + } + return fixer.remove(node); + } + function getImportFixer(def) { + switch (def.node.type) { + case utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration: + // import equals declarations can only have one binding -- so we can + // just remove entire import declaration + return { + messageId: 'removeUnusedImportDeclaration', + fix: fixer => removeNodeWithTrailingNewline(fixer, def.node), + }; + case utils_1.AST_NODE_TYPES.ImportDefaultSpecifier: { + const importDecl = def.node.parent; + if (importDecl.specifiers.length === 1 || + areAllSpecifiersUnused(importDecl)) { + // all specifiers are unused -- so we can just remove entire import + // declaration + return { + messageId: 'removeUnusedImportDeclaration', + fix: fixer => removeNodeWithTrailingNewline(fixer, importDecl), + }; + } + // in this branch we know the following things: + // 1) there is at least one specifier that is used + // 2) the default specifier is unused + // + // by process of elimination we can deduce that there is at least one + // named specifier that is used + // + // i.e. the code must be import Unused, { Used, ... } from 'module'; + // + // there's one or more unused named specifiers, so we must remove the + // default specifier in isolation including the trailing comma. + // + // import Unused, { Used, ... } from 'module'; + // ^^^^^^^ remove this + // + // NOTE: we could also remove the spaces between the comma and the + // opening curly brace -- but this does risk removing comments. To be + // safe we'll be conservative for now + // + // TODO(bradzacher) -- consider removing the extra space whilst also + // preserving comments. + return { + messageId: 'removeUnusedVar', + fix: fixer => { + const comma = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(def.node), util_1.NullThrowsReasons.MissingToken(',', 'import specifier')); + assertToken(isCommaToken, comma); + return fixer.removeRange([ + Math.min(def.node.range[0], comma.range[0]), + Math.max(def.node.range[1], comma.range[1]), + ]); + }, + }; + } + case utils_1.AST_NODE_TYPES.ImportSpecifier: { + // guaranteed to NOT be in an export statement as we're inspecting an + // import + const importDecl = def.node.parent; + if (importDecl.specifiers.length === 1 || + areAllSpecifiersUnused(importDecl)) { + // all specifiers are unused -- so we can just remove entire import + // declaration + return { + messageId: 'removeUnusedImportDeclaration', + fix: fixer => removeNodeWithTrailingNewline(fixer, importDecl), + }; + } + return { + messageId: 'removeUnusedVar', + fix: fixer => { + const usedNamedSpecifiers = context.sourceCode + .getDeclaredVariables(importDecl) + .map(variable => { + if (reportedUnusedVariables.has(variable)) { + return null; + } + const specifier = variable.defs[0].node; + if (specifier.type !== utils_1.AST_NODE_TYPES.ImportSpecifier) { + return null; + } + return specifier; + }) + .filter(v => v != null); + if (usedNamedSpecifiers.length === 0) { + // in this branch we know the following things: + // 1) there is at least one specifier that is used + // 2) all named specifiers are unused + // + // by process of elimination we can deduce that there is a + // default specifier and it is the only used specifier + // + // i.e. the code must be import Used, { Unused, ... } from + // 'module'; + // + // So we can just remove the entire curly content and the comma + // before, eg import Used, { Unused, ... } from 'module'; + // ^^^^^^^^^^^^^^^^^ remove this + const leftCurly = assertToken(isLeftCurlyToken, context.sourceCode.getFirstToken(importDecl, isLeftCurlyToken.predicate)); + const leftToken = assertToken(isCommaToken, context.sourceCode.getTokenBefore(leftCurly)); + const rightToken = assertToken(isRightCurlyToken, context.sourceCode.getFirstToken(importDecl, isRightCurlyToken.predicate)); + return fixer.removeRange([ + leftToken.range[0], + rightToken.range[1], + ]); + } + // in this branch we know there is at least one used named + // specifier which means we have to remove each unused specifier + // in isolation. + // + // there's 3 possible cases to care about: import { Unused, + // Used... } from 'module'; import { ...Used, Unused } from + // 'module'; import { ...Used, Unused, } from 'module'; + // + // Note that because of the above usedNamedSpecifiers check we + // know that we don't have one of these cases: import { Unused } + // from 'module'; import { Unused, Unused... } from 'module'; + // import { ...Unused, Unused, } from 'module'; + // + // The result is that we know that there _must_ be a comma that + // needs cleaning up + // + // try to remove the leading comma first as it leads to a nicer + // fix output in most cases + // + // leading preferred: import { Used, Unused, Used } from 'module'; + // ^^^^^^^^ remove import { Used, Used } from 'module'; + // + // trailing preferred: import { Used, Unused, Used } from + // 'module'; ^^^^^^^ remove import { Used, Used } from + // 'module'; ^^ ugly double space + // + // But we need to still fallback to the trailing comma for cases + // where the unused specifier is the first in the import eg: + // import { Unused, Used } from 'module'; + const maybeComma = context.sourceCode.getTokenBefore(def.node); + const comma = maybeComma && isCommaToken.predicate(maybeComma) + ? maybeComma + : assertToken(isCommaToken, context.sourceCode.getTokenAfter(def.node)); + return fixer.removeRange([ + Math.min(def.node.range[0], comma.range[0]), + Math.max(def.node.range[1], comma.range[1]), + ]); + }, + }; + } + case utils_1.AST_NODE_TYPES.ImportNamespaceSpecifier: { + // namespace specifiers cannot be used with any other specifier -- so + // we can just remove entire import declaration + const importDecl = def.node.parent; + return { + messageId: 'removeUnusedImportDeclaration', + fix: fixer => removeNodeWithTrailingNewline(fixer, importDecl), + }; + } + } + } + /** + * Determines what variable type a def is. + * @param def the declaration to check + * @returns a simple name for the types of variables that this rule supports + */ + function defToVariableType(def) { + /* + * This `destructuredArrayIgnorePattern` error report works differently from the catch + * clause and parameter error reports. _Both_ the `varsIgnorePattern` and the + * `destructuredArrayIgnorePattern` will be checked for array destructuring. However, + * for the purposes of the report, the currently defined behavior is to only inform the + * user of the `destructuredArrayIgnorePattern` if it's present (regardless of the fact + * that the `varsIgnorePattern` would also apply). If it's not present, the user will be + * informed of the `varsIgnorePattern`, assuming that's present. + */ + if (options.destructuredArrayIgnorePattern && + def.name.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + return { type: VariableType.ArrayDestructure, def }; + } + switch (def.type) { + case scope_manager_1.DefinitionType.CatchClause: + return { type: VariableType.CatchClause, def }; + case scope_manager_1.DefinitionType.ClassName: + return { type: VariableType.ClassName, def }; + case scope_manager_1.DefinitionType.FunctionName: + return { type: VariableType.FunctionName, def }; + case scope_manager_1.DefinitionType.ImplicitGlobalVariable: + return { type: VariableType.ImplicitGlobalVariable, def }; + case scope_manager_1.DefinitionType.ImportBinding: + return { type: VariableType.ImportBinding, def }; + case scope_manager_1.DefinitionType.Parameter: + return { type: VariableType.Parameter, def }; + case scope_manager_1.DefinitionType.TSEnumName: + return { type: VariableType.TSEnumName, def }; + case scope_manager_1.DefinitionType.TSEnumMember: + return { type: VariableType.TSEnumMember, def }; + case scope_manager_1.DefinitionType.TSModuleName: + return { type: VariableType.TSModuleName, def }; + case scope_manager_1.DefinitionType.Type: + return { type: VariableType.Type, def }; + case scope_manager_1.DefinitionType.Variable: + return { type: VariableType.Variable, def }; + } + } + /** + * Gets a given variable's description and configured ignore pattern + * based on the provided variableType + * @param variableType a simple name for the types of variables that this rule supports + * @returns the given variable's description and + * ignore pattern + */ + function getVariableDescription(variableType) { + switch (variableType) { + case VariableType.ArrayDestructure: + return { + pattern: options.destructuredArrayIgnorePattern?.toString(), + variableDescription: 'elements of array destructuring', + }; + case VariableType.CatchClause: + return { + pattern: options.caughtErrorsIgnorePattern?.toString(), + variableDescription: 'caught errors', + }; + case VariableType.Parameter: + return { + pattern: options.argsIgnorePattern?.toString(), + variableDescription: 'args', + }; + default: + return { + pattern: options.varsIgnorePattern?.toString(), + variableDescription: 'vars', + }; + } + } + /** + * Generates the message data about the variable being defined and unused, + * including the ignore pattern if configured. + * @param unusedVar eslint-scope variable object. + * @returns The message data to be used with this unused variable. + */ + function getDefinedMessageData(unusedVar) { + const def = unusedVar.defs.at(0); + let additionalMessageData = ''; + if (def) { + const { pattern, variableDescription } = getVariableDescription(defToVariableType(def).type); + if (pattern && variableDescription) { + additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`; + } + } + return { + action: 'defined', + additional: additionalMessageData, + varName: unusedVar.name, + }; + } + /** + * Generate the warning message about the variable being + * assigned and unused, including the ignore pattern if configured. + * @param unusedVar eslint-scope variable object. + * @returns The message data to be used with this unused variable. + */ + function getAssignedMessageData(unusedVar) { + const def = unusedVar.defs.at(0); + let additionalMessageData = ''; + if (def) { + const { pattern, variableDescription } = getVariableDescription(defToVariableType(def).type); + if (pattern && variableDescription) { + additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`; + } + } + return { + action: 'assigned a value', + additional: additionalMessageData, + varName: unusedVar.name, + }; + } + /** + * Generate the warning message about a variable being used even though + * it is marked as being ignored. + * @param variable eslint-scope variable object + * @param variableType a simple name for the types of variables that this rule supports + * @returns The message data to be used with this used ignored variable. + */ + function getUsedIgnoredMessageData(variable, variableType) { + const { pattern, variableDescription } = getVariableDescription(variableType); + let additionalMessageData = ''; + if (pattern && variableDescription) { + additionalMessageData = `. Used ${variableDescription} must not match ${pattern}`; + } + return { + additional: additionalMessageData, + varName: variable.name, + }; + } + function collectUnusedVariables() { + /** + * Checks whether a node is a sibling of the rest property or not. + * @param node a node to check + * @returns True if the node is a sibling of the rest property, otherwise false. + */ + function hasRestSibling(node) { + return (node.type === utils_1.AST_NODE_TYPES.Property && + node.parent.type === utils_1.AST_NODE_TYPES.ObjectPattern && + node.parent.properties[node.parent.properties.length - 1].type === + utils_1.AST_NODE_TYPES.RestElement); + } + /** + * Determines if a variable has a sibling rest property + * @param variable eslint-scope variable object. + * @returns True if the variable is exported, false if not. + */ + function hasRestSpreadSibling(variable) { + if (options.ignoreRestSiblings) { + const hasRestSiblingDefinition = variable.defs.some(def => hasRestSibling(def.name.parent)); + const hasRestSiblingReference = variable.references.some(ref => hasRestSibling(ref.identifier.parent)); + return hasRestSiblingDefinition || hasRestSiblingReference; + } + return false; + } + /** + * Checks whether the given variable is after the last used parameter. + * @param variable The variable to check. + * @returns `true` if the variable is defined after the last used parameter. + */ + function isAfterLastUsedArg(variable) { + const def = variable.defs[0]; + const params = context.sourceCode.getDeclaredVariables(def.node); + const posteriorParams = params.slice(params.indexOf(variable) + 1); + // If any used parameters occur after this parameter, do not report. + return !posteriorParams.some(v => v.references.length > 0 || v.eslintUsed); + } + const analysisResults = (0, util_1.collectVariables)(context); + const variables = [ + ...Array.from(analysisResults.unusedVariables, variable => ({ + used: false, + variable, + })), + ...Array.from(analysisResults.usedVariables, variable => ({ + used: true, + variable, + })), + ]; + const unusedVariablesReturn = []; + for (const { used, variable } of variables) { + // explicit global variables don't have definitions. + if (variable.defs.length === 0) { + if (!used) { + unusedVariablesReturn.push(variable); + } + continue; + } + const def = variable.defs[0]; + if (variable.scope.type === utils_1.TSESLint.Scope.ScopeType.global && + options.vars === 'local') { + // skip variables in the global scope if configured to + continue; + } + const refUsedInArrayPatterns = variable.references.some(ref => ref.identifier.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern); + // skip elements of array destructuring patterns + if ((def.name.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern || + refUsedInArrayPatterns) && + def.name.type === utils_1.AST_NODE_TYPES.Identifier && + options.destructuredArrayIgnorePattern?.test(def.name.name)) { + if (options.reportUsedIgnorePattern && used) { + report(variable, { + messageId: 'usedIgnoredVar', + data: getUsedIgnoredMessageData(variable, VariableType.ArrayDestructure), + }); + } + continue; + } + if (def.type === utils_1.TSESLint.Scope.DefinitionType.ClassName) { + const hasStaticBlock = def.node.body.body.some(node => node.type === utils_1.AST_NODE_TYPES.StaticBlock); + if (options.ignoreClassWithStaticInitBlock && hasStaticBlock) { + continue; + } + } + // skip catch variables + if (def.type === utils_1.TSESLint.Scope.DefinitionType.CatchClause) { + if (options.caughtErrors === 'none') { + continue; + } + // skip ignored parameters + if (options.caughtErrorsIgnorePattern?.test(def.name.name)) { + if (options.reportUsedIgnorePattern && used) { + report(variable, { + messageId: 'usedIgnoredVar', + data: getUsedIgnoredMessageData(variable, VariableType.CatchClause), + }); + } + continue; + } + } + else if (def.type === utils_1.TSESLint.Scope.DefinitionType.Parameter) { + // if "args" option is "none", skip any parameter + if (options.args === 'none') { + continue; + } + // skip ignored parameters + if (def.name.type === utils_1.AST_NODE_TYPES.Identifier && + options.argsIgnorePattern?.test(def.name.name)) { + if (options.reportUsedIgnorePattern && used) { + report(variable, { + messageId: 'usedIgnoredVar', + data: getUsedIgnoredMessageData(variable, VariableType.Parameter), + }); + } + continue; + } + // if "args" option is "after-used", skip used variables + if (options.args === 'after-used' && + (0, util_1.isFunction)(def.name.parent) && + !isAfterLastUsedArg(variable)) { + continue; + } + } + // skip ignored variables + else if (def.name.type === utils_1.AST_NODE_TYPES.Identifier && + options.varsIgnorePattern?.test(def.name.name)) { + if (options.reportUsedIgnorePattern && + used && + /* enum members are always marked as 'used' by `collectVariables`, but in reality they may be used or + unused. either way, don't complain about their naming. */ + def.type !== utils_1.TSESLint.Scope.DefinitionType.TSEnumMember) { + report(variable, { + messageId: 'usedIgnoredVar', + data: getUsedIgnoredMessageData(variable, VariableType.Variable), + }); + } + continue; + } + if (def.type === utils_1.TSESLint.Scope.DefinitionType.Variable && + options.ignoreUsingDeclarations && + (def.parent.kind === 'await using' || def.parent.kind === 'using')) { + continue; + } + if (hasRestSpreadSibling(variable)) { + continue; + } + // in case another rule has run and used the collectUnusedVariables, + // we want to ensure our selectors that marked variables as used are respected + if (variable.eslintUsed) { + continue; + } + if (!used) { + unusedVariablesReturn.push(variable); + } + } + return unusedVariablesReturn; + } + return { + // top-level declaration file handling + [ambientDeclarationSelector(utils_1.AST_NODE_TYPES.Program)](node) { + if (!(0, util_1.isDefinitionFile)(context.filename)) { + return; + } + const moduleDecl = (0, util_1.nullThrows)(node.parent, util_1.NullThrowsReasons.MissingParent); + if (checkForOverridingExportStatements(moduleDecl)) { + return; + } + markDeclarationChildAsUsed(node); + }, + // children of a namespace that is a child of a declared namespace are auto-exported + [ambientDeclarationSelector('TSModuleDeclaration[declare = true] > TSModuleBlock TSModuleDeclaration > TSModuleBlock')](node) { + const moduleDecl = (0, util_1.nullThrows)(node.parent.parent, util_1.NullThrowsReasons.MissingParent); + if (checkForOverridingExportStatements(moduleDecl)) { + return; + } + markDeclarationChildAsUsed(node); + }, + // declared namespace handling + [ambientDeclarationSelector('TSModuleDeclaration[declare = true] > TSModuleBlock')](node) { + const moduleDecl = (0, util_1.nullThrows)(node.parent.parent, util_1.NullThrowsReasons.MissingParent); + if (checkForOverridingExportStatements(moduleDecl)) { + return; + } + markDeclarationChildAsUsed(node); + }, + // namespace handling in definition files + [ambientDeclarationSelector('TSModuleDeclaration > TSModuleBlock')](node) { + if (!(0, util_1.isDefinitionFile)(context.filename)) { + return; + } + const moduleDecl = (0, util_1.nullThrows)(node.parent.parent, util_1.NullThrowsReasons.MissingParent); + if (checkForOverridingExportStatements(moduleDecl)) { + return; + } + markDeclarationChildAsUsed(node); + }, + // collect + 'Program:exit'(programNode) { + const unusedVars = collectUnusedVariables(); + for (const unusedVar of unusedVars) { + // Report the first declaration. + if (unusedVar.defs.length > 0) { + const usedOnlyAsType = unusedVar.references.some(ref => (0, referenceContainsTypeQuery_1.referenceContainsTypeQuery)(ref.identifier) || + (0, referenceContainsTypePredicate_1.referenceContainsTypePredicate)(ref.identifier)); + const messageId = usedOnlyAsType ? 'usedOnlyAsType' : 'unusedVar'; + const isImportUsedOnlyAsType = usedOnlyAsType && + unusedVar.defs.some(def => def.type === scope_manager_1.DefinitionType.ImportBinding); + if (isImportUsedOnlyAsType) { + continue; + } + report(unusedVar, { + messageId, + data: unusedVar.references.some(ref => ref.isWrite()) + ? getAssignedMessageData(unusedVar) + : getDefinedMessageData(unusedVar), + }); + // If there are no regular declaration, report the first `/*globals*/` comment directive. + } + else if ('eslintExplicitGlobalComments' in unusedVar && + unusedVar.eslintExplicitGlobalComments) { + const directiveComment = unusedVar.eslintExplicitGlobalComments[0]; + context.report({ + loc: (0, util_1.getNameLocationInGlobalDirectiveComment)(context.sourceCode, directiveComment, unusedVar.name), + node: programNode, + messageId: 'unusedVar', + data: getDefinedMessageData(unusedVar), + }); + } + } + }, + }; + function checkForOverridingExportStatements(node) { + const cached = MODULE_DECL_CACHE.get(node); + if (cached != null) { + return cached; + } + const body = getStatementsOfNode(node); + if (hasOverridingExportStatement(body)) { + MODULE_DECL_CACHE.set(node, true); + return true; + } + MODULE_DECL_CACHE.set(node, false); + return false; + } + function ambientDeclarationSelector(parent) { + return [ + // Types are ambiently exported + `${parent} > :matches(${[ + utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration, + ].join(', ')})`, + // Value things are ambiently exported if they are "declare"d + `${parent} > :matches(${[ + utils_1.AST_NODE_TYPES.ClassDeclaration, + utils_1.AST_NODE_TYPES.TSDeclareFunction, + utils_1.AST_NODE_TYPES.TSEnumDeclaration, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + utils_1.AST_NODE_TYPES.VariableDeclaration, + ].join(', ')})`, + ].join(', '); + } + function markDeclarationChildAsUsed(node) { + const identifiers = []; + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSInterfaceDeclaration: + case utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration: + case utils_1.AST_NODE_TYPES.ClassDeclaration: + case utils_1.AST_NODE_TYPES.FunctionDeclaration: + case utils_1.AST_NODE_TYPES.TSDeclareFunction: + case utils_1.AST_NODE_TYPES.TSEnumDeclaration: + case utils_1.AST_NODE_TYPES.TSModuleDeclaration: + if (node.id?.type === utils_1.AST_NODE_TYPES.Identifier) { + identifiers.push(node.id); + } + break; + case utils_1.AST_NODE_TYPES.VariableDeclaration: + for (const declaration of node.declarations) { + visitPattern(declaration, pattern => { + identifiers.push(pattern); + }); + } + break; + } + let scope = context.sourceCode.getScope(node); + const shouldUseUpperScope = [ + utils_1.AST_NODE_TYPES.TSDeclareFunction, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + ].includes(node.type); + if (scope.variableScope !== scope) { + scope = scope.variableScope; + } + else if (shouldUseUpperScope && scope.upper) { + scope = scope.upper; + } + for (const id of identifiers) { + const superVar = scope.set.get(id.name); + if (superVar) { + superVar.eslintUsed = true; + } + } + } + function visitPattern(node, cb) { + const visitor = new scope_manager_1.PatternVisitor({}, node, cb); + visitor.visit(node); + } + }, +}); +function hasOverridingExportStatement(body) { + for (const statement of body) { + if ((statement.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration && + statement.declaration == null) || + statement.type === utils_1.AST_NODE_TYPES.ExportAllDeclaration || + statement.type === utils_1.AST_NODE_TYPES.TSExportAssignment) { + return true; + } + if (statement.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration && + statement.declaration.type === utils_1.AST_NODE_TYPES.Identifier) { + return true; + } + } + return false; +} +function getStatementsOfNode(block) { + if (block.type === utils_1.AST_NODE_TYPES.Program) { + return block.body; + } + return block.body.body; +} +/* + +###### TODO ###### + +Edge cases that aren't currently handled due to laziness and them being super edgy edge cases + + +--- function params referenced in typeof type refs in the function declaration --- +--- NOTE - TS gets these cases wrong + +function _foo( + arg: number // arg should be unused +): typeof arg { + return 1 as any; +} + +function _bar( + arg: number, // arg should be unused + _arg2: typeof arg, +) {} + + +--- function names referenced in typeof type refs in the function declaration --- +--- NOTE - TS gets these cases right + +function foo( // foo should be unused +): typeof foo { + return 1 as any; +} + +function bar( // bar should be unused + _arg: typeof bar +) {} + + +--- if an interface is merged into a namespace --- +--- NOTE - TS gets these cases wrong + +namespace Test { + interface Foo { // Foo should be unused here + a: string; + } + export namespace Foo { + export type T = 'b'; + } +} +type T = Test.Foo; // Error: Namespace 'Test' has no exported member 'Foo'. + + +namespace Test { + export interface Foo { + a: string; + } + namespace Foo { // Foo should be unused here + export type T = 'b'; + } +} +type T = Test.Foo.T; // Error: Namespace 'Test' has no exported member 'Foo'. + +--- + +These cases are mishandled because the base rule assumes that each variable has one def, but type-value shadowing +creates a variable with two defs + +--- type-only or value-only references to type/value shadowed variables --- +--- NOTE - TS gets these cases wrong + +type T = 1; +const T = 2; // this T should be unused + +type U = T; // this U should be unused +const U = 3; + +const _V = U; + + +--- partially exported type/value shadowed variables --- +--- NOTE - TS gets these cases wrong + +export interface Foo {} +const Foo = 1; // this Foo should be unused + +interface Bar {} // this Bar should be unused +export const Bar = 1; + +*/ diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1ea60695ded6762089e63aec028b80df95fd4158 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.d.ts @@ -0,0 +1,16 @@ +import { TSESLint } from '@typescript-eslint/utils'; +export interface Config { + allowNamedExports?: boolean; + classes?: boolean; + enums?: boolean; + functions?: boolean; + ignoreTypeReferences?: boolean; + typedefs?: boolean; + variables?: boolean; +} +export type Options = ['nofunc' | Config]; +export type MessageIds = 'noUseBeforeDefine'; +declare const _default: TSESLint.RuleModule<"noUseBeforeDefine", Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js new file mode 100644 index 0000000000000000000000000000000000000000..89dfd85e5795a5a9b33157929f610c0a08891288 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-use-before-define.js @@ -0,0 +1,303 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const referenceContainsTypeQuery_1 = require("../util/referenceContainsTypeQuery"); +const SENTINEL_TYPE = /^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/; +/** + * Parses a given value as options. + */ +function parseOptions(options) { + let functions = true; + let classes = true; + let enums = true; + let variables = true; + let typedefs = true; + let ignoreTypeReferences = true; + let allowNamedExports = false; + if (typeof options === 'string') { + functions = options !== 'nofunc'; + } + else if (typeof options === 'object' && options != null) { + functions = options.functions !== false; + classes = options.classes !== false; + enums = options.enums !== false; + variables = options.variables !== false; + typedefs = options.typedefs !== false; + ignoreTypeReferences = options.ignoreTypeReferences !== false; + allowNamedExports = options.allowNamedExports !== false; + } + return { + allowNamedExports, + classes, + enums, + functions, + ignoreTypeReferences, + typedefs, + variables, + }; +} +/** + * Checks whether or not a given variable is a function declaration. + */ +function isFunction(variable) { + return variable.defs[0].type === scope_manager_1.DefinitionType.FunctionName; +} +/** + * Checks whether or not a given variable is a type declaration. + */ +function isTypedef(variable) { + return variable.defs[0].type === scope_manager_1.DefinitionType.Type; +} +/** + * Checks whether or not a given variable is a enum declaration. + */ +function isOuterEnum(variable, reference) { + return (variable.defs[0].type === scope_manager_1.DefinitionType.TSEnumName && + variable.scope.variableScope !== reference.from.variableScope); +} +/** + * Checks whether or not a given variable is a class declaration in an upper function scope. + */ +function isOuterClass(variable, reference) { + return (variable.defs[0].type === scope_manager_1.DefinitionType.ClassName && + variable.scope.variableScope !== reference.from.variableScope); +} +/** + * Checks whether or not a given variable is a variable declaration in an upper function scope. + */ +function isOuterVariable(variable, reference) { + return (variable.defs[0].type === scope_manager_1.DefinitionType.Variable && + variable.scope.variableScope !== reference.from.variableScope); +} +/** + * Checks whether or not a given reference is a export reference. + */ +function isNamedExports(reference) { + const { identifier } = reference; + return (identifier.parent.type === utils_1.AST_NODE_TYPES.ExportSpecifier && + identifier.parent.local === identifier); +} +/** + * Checks whether or not a given reference is a type reference. + */ +function isTypeReference(reference) { + return (reference.isTypeReference || + (0, referenceContainsTypeQuery_1.referenceContainsTypeQuery)(reference.identifier)); +} +/** + * Checks whether or not a given location is inside of the range of a given node. + */ +function isInRange(node, location) { + return !!node && node.range[0] <= location && location <= node.range[1]; +} +/** + * Decorators are transpiled such that the decorator is placed after the class declaration + * So it is considered safe + */ +function isClassRefInClassDecorator(variable, reference) { + if (variable.defs[0].type !== scope_manager_1.DefinitionType.ClassName || + variable.defs[0].node.decorators.length === 0) { + return false; + } + for (const deco of variable.defs[0].node.decorators) { + if (reference.identifier.range[0] >= deco.range[0] && + reference.identifier.range[1] <= deco.range[1]) { + return true; + } + } + return false; +} +/** + * Checks whether or not a given reference is inside of the initializers of a given variable. + * + * @returns `true` in the following cases: + * - var a = a + * - var [a = a] = list + * - var {a = a} = obj + * - for (var a in a) {} + * - for (var a of a) {} + */ +function isInInitializer(variable, reference) { + if (variable.scope !== reference.from) { + return false; + } + let node = variable.identifiers[0].parent; + const location = reference.identifier.range[1]; + while (node) { + if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) { + if (isInRange(node.init, location)) { + return true; + } + if ((node.parent.parent.type === utils_1.AST_NODE_TYPES.ForInStatement || + node.parent.parent.type === utils_1.AST_NODE_TYPES.ForOfStatement) && + isInRange(node.parent.parent.right, location)) { + return true; + } + break; + } + else if (node.type === utils_1.AST_NODE_TYPES.AssignmentPattern) { + if (isInRange(node.right, location)) { + return true; + } + } + else if (SENTINEL_TYPE.test(node.type)) { + break; + } + node = node.parent; + } + return false; +} +exports.default = (0, util_1.createRule)({ + name: 'no-use-before-define', + meta: { + type: 'problem', + docs: { + description: 'Disallow the use of variables before they are defined', + extendsBaseRule: true, + }, + messages: { + noUseBeforeDefine: "'{{name}}' was used before it was defined.", + }, + schema: [ + { + oneOf: [ + { + type: 'string', + description: 'Broadly set functions and allowNamedExports to false.', + enum: ['nofunc'], + }, + { + type: 'object', + additionalProperties: false, + properties: { + allowNamedExports: { + type: 'boolean', + description: 'Whether to ignore named exports.', + }, + classes: { + type: 'boolean', + description: 'Whether to ignore references to class declarations.', + }, + enums: { + type: 'boolean', + description: 'Whether to check references to enums.', + }, + functions: { + type: 'boolean', + description: 'Whether to ignore references to function declarations.', + }, + ignoreTypeReferences: { + type: 'boolean', + description: 'Whether to ignore type references, such as in type annotations and assertions.', + }, + typedefs: { + type: 'boolean', + description: 'Whether to check references to types.', + }, + variables: { + type: 'boolean', + description: 'Whether to ignore references to variables.', + }, + }, + }, + ], + }, + ], + }, + defaultOptions: [ + { + allowNamedExports: false, + classes: true, + enums: true, + functions: true, + ignoreTypeReferences: true, + typedefs: true, + variables: true, + }, + ], + create(context, optionsWithDefault) { + const options = parseOptions(optionsWithDefault[0]); + /** + * Determines whether a given use-before-define case should be reported according to the options. + * @param variable The variable that gets used before being defined + * @param reference The reference to the variable + */ + function isForbidden(variable, reference) { + if (options.ignoreTypeReferences && isTypeReference(reference)) { + return false; + } + if (isFunction(variable)) { + return options.functions; + } + if (isOuterClass(variable, reference)) { + return options.classes; + } + if (isOuterVariable(variable, reference)) { + return options.variables; + } + if (isOuterEnum(variable, reference)) { + return options.enums; + } + if (isTypedef(variable)) { + return options.typedefs; + } + return true; + } + function isDefinedBeforeUse(variable, reference) { + return (variable.identifiers[0].range[1] <= reference.identifier.range[1] && + !(reference.isValueReference && isInInitializer(variable, reference))); + } + /** + * Finds and validates all variables in a given scope. + */ + function findVariablesInScope(scope) { + scope.references.forEach(reference => { + const variable = reference.resolved; + function report() { + context.report({ + node: reference.identifier, + messageId: 'noUseBeforeDefine', + data: { + name: reference.identifier.name, + }, + }); + } + // Skips when the reference is: + // - initializations. + // - referring to an undefined variable. + // - referring to a global environment variable (there're no identifiers). + // - located preceded by the variable (except in initializers). + // - allowed by options. + if (reference.init) { + return; + } + if (!options.allowNamedExports && isNamedExports(reference)) { + if (!variable || !isDefinedBeforeUse(variable, reference)) { + report(); + } + return; + } + if (!variable) { + return; + } + if (variable.identifiers.length === 0 || + isDefinedBeforeUse(variable, reference) || + !isForbidden(variable, reference) || + isClassRefInClassDecorator(variable, reference) || + reference.from.type === utils_1.TSESLint.Scope.ScopeType.functionType) { + return; + } + // Reports. + report(); + }); + scope.childScopes.forEach(findVariablesInScope); + } + return { + Program(node) { + findVariablesInScope(context.sourceCode.getScope(node)); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..96745246f8d3291b4b97353b82def632adbf215f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.d.ts @@ -0,0 +1,11 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util'; +declare const baseRule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noUselessConstructor" | "removeConstructor", [], unknown, { + MethodDefinition(node: TSESTree.MethodDefinition): void; +}>; +export type Options = InferOptionsTypeFromRule; +export type MessageIds = InferMessageIdsTypeFromRule; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noUselessConstructor" | "removeConstructor", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js new file mode 100644 index 0000000000000000000000000000000000000000..6bdee67b7a27fa7e87ef2727927be1e50a9774ba --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-constructor.js @@ -0,0 +1,57 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-useless-constructor'); +/** + * Check if method with accessibility is not useless + */ +function checkAccessibility(node) { + switch (node.accessibility) { + case 'protected': + case 'private': + return false; + case 'public': + if (node.parent.parent.superClass) { + return false; + } + break; + } + return true; +} +/** + * Check if method is not useless due to typescript parameter properties and decorators + */ +function checkParams(node) { + return !node.value.params.some(param => param.type === utils_1.AST_NODE_TYPES.TSParameterProperty || + param.decorators.length); +} +exports.default = (0, util_1.createRule)({ + name: 'no-useless-constructor', + meta: { + type: 'problem', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Disallow unnecessary constructors', + extendsBaseRule: true, + recommended: 'strict', + }, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema: baseRule.meta.schema, + }, + defaultOptions: [], + create(context) { + const rules = baseRule.create(context); + return { + MethodDefinition(node) { + if (node.value.type === utils_1.AST_NODE_TYPES.FunctionExpression && + checkAccessibility(node) && + checkParams(node)) { + rules.MethodDefinition(node); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-default-assignment.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-default-assignment.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..99f3adc45276971f2c0363d7771513e5934353d0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-default-assignment.d.ts @@ -0,0 +1,11 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +type MessageId = 'noStrictNullCheck' | 'preferOptionalSyntax' | 'uselessDefaultAssignment' | 'uselessUndefined'; +type Options = [ + { + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean; + } +]; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-default-assignment.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-default-assignment.js new file mode 100644 index 0000000000000000000000000000000000000000..6bb701fc0a2ac100f058e6c4d9b2cce3f5660abc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-default-assignment.js @@ -0,0 +1,321 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-useless-default-assignment', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow default values that will never be used', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + preferOptionalSyntax: 'Using `= undefined` to make a parameter optional adds unnecessary runtime logic. Use the `?` optional syntax instead.', + uselessDefaultAssignment: 'Default value is useless because the {{ type }} is not optional.', + uselessUndefined: 'Default value is useless because it is undefined. Optional {{ type }}s are already undefined by default.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + description: 'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + }, + ], + create(context, [{ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing }]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + if (!isStrictNullChecks && + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { column: 0, line: 0 }, + end: { column: 0, line: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + function canBeUndefined(type) { + if ((0, util_1.isTypeAnyType)(type) || (0, util_1.isTypeUnknownType)(type)) { + return true; + } + return tsutils + .unionConstituents(type) + .some(part => (0, util_1.isTypeFlagSet)(part, ts.TypeFlags.Undefined)); + } + function getArrayElementType(arrayType, elementIndex) { + if (checker.isTupleType(arrayType)) { + const tupleArgs = checker.getTypeArguments(arrayType); + if (elementIndex < tupleArgs.length) { + return tupleArgs[elementIndex]; + } + } + return arrayType.getNumberIndexType() ?? null; + } + function checkAssignmentPattern(node) { + if (node.right.type === utils_1.AST_NODE_TYPES.Identifier && + node.right.name === 'undefined') { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (ts.isParameter(tsNode) && + tsNode.type && + canBeUndefined(checker.getTypeFromTypeNode(tsNode.type))) { + reportPreferOptionalSyntax(node); + return; + } + const type = node.parent.type === utils_1.AST_NODE_TYPES.Property || + node.parent.type === utils_1.AST_NODE_TYPES.ArrayPattern + ? 'property' + : 'parameter'; + reportUselessUndefined(node, type); + return; + } + const parent = node.parent; + if (parent.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + parent.type === utils_1.AST_NODE_TYPES.FunctionExpression) { + const paramIndex = parent.params.indexOf(node); + if (paramIndex !== -1) { + const tsFunc = services.esTreeNodeToTSNodeMap.get(parent); + // tsFunc is already a FunctionLike subtype; defensive runtime check + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (ts.isFunctionLike(tsFunc)) { + const contextualType = checker.getContextualType(tsFunc); + if (!contextualType) { + return; + } + const signatures = contextualType.getCallSignatures(); + if (signatures.length === 0 || + signatures[0].getDeclaration() === tsFunc) { + return; + } + const params = signatures[0].getParameters(); + if (paramIndex < params.length) { + const paramSymbol = params[paramIndex]; + if (paramSymbol.valueDeclaration && + ts.isParameter(paramSymbol.valueDeclaration) && + paramSymbol.valueDeclaration.dotDotDotToken != null) { + return; + } + if (!tsutils.isSymbolFlagSet(paramSymbol, ts.SymbolFlags.Optional)) { + const paramType = checker.getTypeOfSymbol(paramSymbol); + if (!tsutils.isTypeParameter(paramType) && + !canBeUndefined(paramType)) { + reportUselessDefaultAssignment(node, 'parameter'); + } + } + } + } + } + return; + } + if (parent.type === utils_1.AST_NODE_TYPES.Property) { + const propertyType = getTypeOfProperty(parent); + if (!propertyType) { + return; + } + if (!canBeUndefined(propertyType)) { + reportUselessDefaultAssignment(node, 'property'); + } + } + else if (parent.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + const sourceType = getSourceTypeForPattern(parent); + if (!sourceType) { + return; + } + if (!checker.isTupleType(sourceType)) { + return; + } + const tupleArgs = checker.getTypeArguments(sourceType); + const elementIndex = parent.elements.indexOf(node); + if (elementIndex < 0 || elementIndex >= tupleArgs.length) { + return; + } + const elementType = tupleArgs[elementIndex]; + if (!canBeUndefined(elementType)) { + reportUselessDefaultAssignment(node, 'property'); + } + } + } + function getTypeOfProperty(node) { + const objectPattern = node.parent; + const sourceType = getSourceTypeForPattern(objectPattern); + if (!sourceType) { + return null; + } + const propertyName = getPropertyName(node.key); + if (!propertyName) { + return null; + } + const symbol = sourceType.getProperty(propertyName); + if (!symbol) { + return null; + } + if (tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Optional)) { + const parent = objectPattern.parent; + if (parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator && + parent.init && + hasConditionalInitializer(objectPattern)) { + const propertyName = getPropertyName(node.key); + if (!propertyName || + !hasPropertyInAllBranches(parent.init, propertyName)) { + return null; + } + } + } + return checker.getTypeOfSymbol(symbol); + } + function hasConditionalInitializer(node) { + const parent = node.parent; + if (!parent) { + return false; + } + if (parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator && parent.init) { + return (parent.init.type === utils_1.AST_NODE_TYPES.ConditionalExpression || + parent.init.type === utils_1.AST_NODE_TYPES.LogicalExpression); + } + return hasConditionalInitializer(parent); + } + function getSourceTypeForPattern(pattern) { + const parent = (0, util_1.nullThrows)(pattern.parent, util_1.NullThrowsReasons.MissingParent); + if (parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator && parent.init) { + const tsNode = services.esTreeNodeToTSNodeMap.get(parent.init); + return checker.getTypeAtLocation(tsNode); + } + if ((0, util_1.isFunction)(parent)) { + let paramIndex = parent.params.indexOf(pattern); + const tsFunc = services.esTreeNodeToTSNodeMap.get(parent); + const signature = (0, util_1.nullThrows)(checker.getSignatureFromDeclaration(tsFunc), util_1.NullThrowsReasons.MissingToken('signature', 'function')); + const params = signature.getParameters(); + if (signature.thisParameter) { + paramIndex--; + } + if (paramIndex < 0 || paramIndex >= params.length) { + return null; + } + return checker.getTypeOfSymbol(params[paramIndex]); + } + if (parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern) { + return getSourceTypeForPattern(parent); + } + if (parent.type === utils_1.AST_NODE_TYPES.Property) { + return getTypeOfProperty(parent); + } + if (parent.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + const arrayType = getSourceTypeForPattern(parent); + if (!arrayType) { + return null; + } + const elementIndex = parent.elements.indexOf(pattern); + return getArrayElementType(arrayType, elementIndex); + } + return null; + } + function getPropertyName(key) { + switch (key.type) { + case utils_1.AST_NODE_TYPES.Identifier: + return key.name; + case utils_1.AST_NODE_TYPES.Literal: + return String(key.value); + case utils_1.AST_NODE_TYPES.TemplateLiteral: + return key.expressions.length ? null : key.quasis[0].value.cooked; + default: + return null; + } + } + function reportUselessDefaultAssignment(node, type) { + context.report({ + node: node.right, + messageId: 'uselessDefaultAssignment', + data: { type }, + fix: fixer => removeDefault(fixer, node), + }); + } + function reportUselessUndefined(node, type) { + context.report({ + node: node.right, + messageId: 'uselessUndefined', + data: { type }, + fix: fixer => removeDefault(fixer, node), + }); + } + function reportPreferOptionalSyntax(node) { + context.report({ + node: node.right, + messageId: 'preferOptionalSyntax', + *fix(fixer) { + yield removeDefault(fixer, node); + const { left } = node; + if (left.type === utils_1.AST_NODE_TYPES.Identifier) { + yield fixer.insertTextAfterRange([left.range[0], left.range[0] + left.name.length], '?'); + } + }, + }); + } + function removeDefault(fixer, node) { + const start = node.left.range[1]; + const end = node.range[1]; + return fixer.removeRange([start, end]); + } + function hasPropertyInAllBranches(expression, propertyName) { + return ((expression.type === utils_1.AST_NODE_TYPES.ObjectExpression && + expression.properties.some(prop => prop.type === utils_1.AST_NODE_TYPES.Property && + getPropertyName(prop.key) === propertyName)) || + (expression.type === utils_1.AST_NODE_TYPES.ConditionalExpression && + hasPropertyInAllBranches(expression.consequent, propertyName) && + hasPropertyInAllBranches(expression.alternate, propertyName))); + } + return { + AssignmentPattern: checkAssignmentPattern, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..47f465648dc8758bbfa75659b6576aad96be918d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"uselessExport", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js new file mode 100644 index 0000000000000000000000000000000000000000..804dfa398640939c6d335268d442786ce00390a4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-useless-empty-export.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +function isEmptyExport(node) { + return (node.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration && + node.specifiers.length === 0 && + !node.declaration); +} +const exportOrImportNodeTypes = new Set([ + utils_1.AST_NODE_TYPES.ExportAllDeclaration, + utils_1.AST_NODE_TYPES.ExportDefaultDeclaration, + utils_1.AST_NODE_TYPES.ExportNamedDeclaration, + utils_1.AST_NODE_TYPES.ExportSpecifier, + utils_1.AST_NODE_TYPES.ImportDeclaration, + utils_1.AST_NODE_TYPES.TSExportAssignment, + utils_1.AST_NODE_TYPES.TSImportEqualsDeclaration, +]); +exports.default = (0, util_1.createRule)({ + name: 'no-useless-empty-export', + meta: { + type: 'suggestion', + docs: { + description: "Disallow empty exports that don't change anything in a module file", + }, + fixable: 'code', + hasSuggestions: false, + messages: { + uselessExport: 'Empty export does nothing and can be removed.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + // In a definition file, export {} is necessary to make the module properly + // encapsulated, even when there are other exports + // https://github.com/typescript-eslint/typescript-eslint/issues/4975 + if ((0, util_1.isDefinitionFile)(context.filename)) { + return {}; + } + function checkNode(node) { + if (!Array.isArray(node.body)) { + return; + } + const emptyExports = []; + let foundOtherExport = false; + for (const statement of node.body) { + if (isEmptyExport(statement)) { + emptyExports.push(statement); + } + else if (exportOrImportNodeTypes.has(statement.type)) { + foundOtherExport = true; + } + } + if (foundOtherExport) { + for (const emptyExport of emptyExports) { + context.report({ + node: emptyExport, + messageId: 'uselessExport', + fix: fixer => fixer.remove(emptyExport), + }); + } + } + } + return { + Program: checkNode, + TSModuleDeclaration: checkNode, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a2f40b59935875fc9a070a1070cd0e6e0a333da --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.d.ts @@ -0,0 +1,10 @@ +export type Options = [ + { + allow: string[]; + } +]; +export type MessageIds = 'noVarReqs'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noVarReqs", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js new file mode 100644 index 0000000000000000000000000000000000000000..a6d793597094b62f88d2891707ff8bdae25c191c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-var-requires.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'no-var-requires', + meta: { + type: 'problem', + deprecated: { + deprecatedSince: '8.0.0', + replacedBy: [ + { + rule: { + name: '@typescript-eslint/no-require-imports', + url: 'https://typescript-eslint.io/rules/no-require-imports', + }, + }, + ], + url: 'https://github.com/typescript-eslint/typescript-eslint/pull/8334', + }, + docs: { + description: 'Disallow `require` statements except in import statements', + }, + messages: { + noVarReqs: 'Require statement not part of import statement.', + }, + replacedBy: ['@typescript-eslint/no-require-imports'], + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + type: 'array', + description: 'Patterns of import paths to allow requiring from.', + items: { type: 'string' }, + }, + }, + }, + ], + }, + defaultOptions: [{ allow: [] }], + create(context, options) { + const allowPatterns = options[0].allow.map(pattern => new RegExp(pattern, 'u')); + function isImportPathAllowed(importPath) { + return allowPatterns.some(pattern => importPath.match(pattern)); + } + function isStringOrTemplateLiteral(node) { + return ((node.type === utils_1.AST_NODE_TYPES.Literal && + typeof node.value === 'string') || + node.type === utils_1.AST_NODE_TYPES.TemplateLiteral); + } + return { + 'CallExpression[callee.name="require"]'(node) { + if (node.arguments[0] && isStringOrTemplateLiteral(node.arguments[0])) { + const argValue = (0, util_1.getStaticStringValue)(node.arguments[0]); + if (typeof argValue === 'string' && isImportPathAllowed(argValue)) { + return; + } + } + const parent = node.parent.type === utils_1.AST_NODE_TYPES.ChainExpression + ? node.parent.parent + : node.parent; + if ([ + utils_1.AST_NODE_TYPES.CallExpression, + utils_1.AST_NODE_TYPES.MemberExpression, + utils_1.AST_NODE_TYPES.NewExpression, + utils_1.AST_NODE_TYPES.TSAsExpression, + utils_1.AST_NODE_TYPES.TSTypeAssertion, + utils_1.AST_NODE_TYPES.VariableDeclarator, + ].includes(parent.type)) { + const variable = utils_1.ASTUtils.findVariable(context.sourceCode.getScope(node), 'require'); + if (!variable?.identifiers.length) { + context.report({ + node, + messageId: 'noVarReqs', + }); + } + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fa0ff45470319fc95f79af5e8584be458f8daf04 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"bannedClassType", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.js new file mode 100644 index 0000000000000000000000000000000000000000..11c3509035221c135ef255b5def672c5e5c36324 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-wrapper-object-types.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const classNames = new Set([ + 'BigInt', + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + 'Boolean', + 'Number', + 'Object', + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + 'String', + 'Symbol', +]); +exports.default = (0, util_1.createRule)({ + name: 'no-wrapper-object-types', + meta: { + type: 'problem', + docs: { + description: 'Disallow using confusing built-in primitive class wrappers', + recommended: 'recommended', + }, + fixable: 'code', + messages: { + bannedClassType: 'Prefer using the primitive `{{preferred}}` as a type name, rather than the upper-cased `{{typeName}}`.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function checkBannedTypes(node, includeFix) { + const typeName = node.type === utils_1.AST_NODE_TYPES.Identifier && node.name; + if (!typeName || + !classNames.has(typeName) || + !(0, util_1.isReferenceToGlobalFunction)(typeName, node, context.sourceCode)) { + return; + } + const preferred = typeName.toLowerCase(); + context.report({ + node, + messageId: 'bannedClassType', + data: { preferred, typeName }, + fix: includeFix + ? (fixer) => fixer.replaceText(node, preferred) + : undefined, + }); + } + return { + TSClassImplements(node) { + checkBannedTypes(node.expression, false); + }, + TSInterfaceHeritage(node) { + checkBannedTypes(node.expression, false); + }, + TSTypeReference(node) { + checkBannedTypes(node.typeName, true); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6dcf6a6118a59e98c888e9d449da4a9fb244c2c9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferNonNullAssertion", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js new file mode 100644 index 0000000000000000000000000000000000000000..056a2adcab627280652534fb4a0033bccbd360b4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/non-nullable-type-assertion-style.js @@ -0,0 +1,132 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'non-nullable-type-assertion-style', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce non-null assertions over explicit type assertions', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferNonNullAssertion: 'Use a ! assertion to more succinctly remove null and undefined from the type.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const getTypesIfNotLoose = (node) => { + const type = services.getTypeAtLocation(node); + if (tsutils.isTypeFlagSet(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return undefined; + } + return tsutils.unionConstituents(type); + }; + const couldBeNullish = (type) => { + if (tsutils.isTypeFlagSet(type, ts.TypeFlags.TypeParameter)) { + const constraint = type.getConstraint(); + return constraint == null || couldBeNullish(constraint); + } + if (tsutils.isUnionType(type)) { + for (const part of type.types) { + if (couldBeNullish(part)) { + return true; + } + } + return false; + } + return tsutils.isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined); + }; + const sameTypeWithoutNullish = (assertedTypes, originalTypes) => { + const nonNullishOriginalTypes = originalTypes.filter(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined)); + if (nonNullishOriginalTypes.length === originalTypes.length) { + return false; + } + for (const assertedType of assertedTypes) { + if (couldBeNullish(assertedType) || + !nonNullishOriginalTypes.includes(assertedType)) { + return false; + } + } + for (const originalType of nonNullishOriginalTypes) { + if (!assertedTypes.includes(originalType)) { + return false; + } + } + return true; + }; + const isConstAssertion = (node) => { + return (node.typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference && + node.typeAnnotation.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + node.typeAnnotation.typeName.name === 'const'); + }; + return { + 'TSAsExpression, TSTypeAssertion'(node) { + if (isConstAssertion(node)) { + return; + } + const originalTypes = getTypesIfNotLoose(node.expression); + if (!originalTypes) { + return; + } + const assertedTypes = getTypesIfNotLoose(node.typeAnnotation); + if (!assertedTypes) { + return; + } + if (sameTypeWithoutNullish(assertedTypes, originalTypes)) { + const expressionSourceCode = context.sourceCode.getText(node.expression); + const higherPrecedenceThanUnary = (0, util_1.getOperatorPrecedence)(services.esTreeNodeToTSNodeMap.get(node.expression).kind, ts.SyntaxKind.Unknown) > util_1.OperatorPrecedence.Unary; + context.report({ + node, + messageId: 'preferNonNullAssertion', + fix(fixer) { + return fixer.replaceText(node, higherPrecedenceThanUnary + ? `${expressionSourceCode}!` + : `(${expressionSourceCode})!`); + }, + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2d8c4bd2c1f15102929ff3e37e2e579e7a20fb2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.d.ts @@ -0,0 +1,14 @@ +import type { TypeOrValueSpecifier } from '../util'; +export type MessageIds = 'object' | 'undef'; +export type Options = [ + { + allow?: TypeOrValueSpecifier[]; + allowRethrowing?: boolean; + allowThrowingAny?: boolean; + allowThrowingUnknown?: boolean; + } +]; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.js new file mode 100644 index 0000000000000000000000000000000000000000..d2ab3535774aa849257acb320ae16ecb25a4f8c8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/only-throw-error.js @@ -0,0 +1,158 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts_api_utils_1 = require("ts-api-utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const promiseUtils_1 = require("../util/promiseUtils"); +exports.default = (0, util_1.createRule)({ + name: 'only-throw-error', + meta: { + type: 'problem', + docs: { + description: 'Disallow throwing non-`Error` values as exceptions', + extendsBaseRule: 'no-throw-literal', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + object: 'Expected an error object to be thrown.', + undef: 'Do not throw undefined.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + ...util_1.typeOrValueSpecifiersSchema, + description: 'Type specifiers that can be thrown.', + }, + allowRethrowing: { + type: 'boolean', + description: 'Whether to allow rethrowing caught values that are not `Error` objects.', + }, + allowThrowingAny: { + type: 'boolean', + description: 'Whether to always allow throwing values typed as `any`.', + }, + allowThrowingUnknown: { + type: 'boolean', + description: 'Whether to always allow throwing values typed as `unknown`.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [], + allowRethrowing: true, + allowThrowingAny: true, + allowThrowingUnknown: true, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const allow = options.allow; + function isRethrownError(node) { + if (node.type !== utils_1.AST_NODE_TYPES.Identifier) { + return false; + } + const scope = context.sourceCode.getScope(node); + const smVariable = (0, util_1.nullThrows)((0, util_1.findVariable)(scope, node), `Variable ${node.name} should exist in scope manager`); + const variableDefinitions = smVariable.defs.filter(def => def.isVariableDefinition); + if (variableDefinitions.length !== 1) { + return false; + } + const def = smVariable.defs[0]; + // try { /* ... */ } catch (x) { throw x; } + if (def.node.type === utils_1.AST_NODE_TYPES.CatchClause) { + return true; + } + // promise.catch(x => { throw x; }) + // promise.then(onFulfilled, x => { throw x; }) + if (def.node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + def.node.params.length >= 1 && + def.node.params[0] === def.name && + def.node.parent.type === utils_1.AST_NODE_TYPES.CallExpression) { + const callExpression = def.node.parent; + const parsedPromiseHandlingCall = (0, promiseUtils_1.parseCatchCall)(callExpression, context) ?? + (0, promiseUtils_1.parseThenCall)(callExpression, context); + if (parsedPromiseHandlingCall != null) { + const { object, onRejected } = parsedPromiseHandlingCall; + if (onRejected === def.node) { + const tsObjectNode = services.esTreeNodeToTSNodeMap.get(object); + // make sure we're actually dealing with a promise + if ((0, ts_api_utils_1.isThenableType)(services.program.getTypeChecker(), tsObjectNode)) { + return true; + } + } + } + } + return false; + } + function checkThrowArgument(node) { + if (options.allowRethrowing && isRethrownError(node)) { + return; + } + const type = services.getTypeAtLocation(node); + if ((0, util_1.typeMatchesSomeSpecifier)(type, allow, services.program)) { + return; + } + if (tsutils.isTypeFlagSet(type, ts.TypeFlags.Undefined)) { + context.report({ node, messageId: 'undef' }); + return; + } + if (options.allowThrowingAny && (0, util_1.isTypeAnyType)(type)) { + return; + } + if (options.allowThrowingUnknown && (0, util_1.isTypeUnknownType)(type)) { + return; + } + if ((0, util_1.isErrorLike)(services.program, type)) { + return; + } + context.report({ node, messageId: 'object' }); + } + return { + ThrowStatement(node) { + checkThrowArgument(node.argument); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3cb3aad21d9ab4013e6293f0c746a90511264710 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.d.ts @@ -0,0 +1,13 @@ +type Modifier = 'private' | 'private readonly' | 'protected' | 'protected readonly' | 'public' | 'public readonly' | 'readonly'; +type Prefer = 'class-property' | 'parameter-property'; +export type Options = [ + { + allow?: Modifier[]; + prefer?: Prefer; + } +]; +export type MessageIds = 'preferClassProperty' | 'preferParameterProperty'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js new file mode 100644 index 0000000000000000000000000000000000000000..a549a156efb4f9d86b9bbb7bc95fb4bfe3def32a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js @@ -0,0 +1,164 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'parameter-properties', + meta: { + type: 'problem', + docs: { + description: 'Require or disallow parameter properties in class constructors', + }, + messages: { + preferClassProperty: 'Property {{parameter}} should be declared as a class property.', + preferParameterProperty: 'Property {{parameter}} should be declared as a parameter property.', + }, + schema: [ + { + type: 'object', + $defs: { + modifier: { + type: 'string', + enum: [ + 'readonly', + 'private', + 'protected', + 'public', + 'private readonly', + 'protected readonly', + 'public readonly', + ], + }, + }, + additionalProperties: false, + properties: { + allow: { + type: 'array', + description: 'Whether to allow certain kinds of properties to be ignored.', + items: { + $ref: '#/items/0/$defs/modifier', + }, + }, + prefer: { + type: 'string', + description: 'Whether to prefer class properties or parameter properties.', + enum: ['class-property', 'parameter-property'], + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [], + prefer: 'class-property', + }, + ], + create(context, [{ allow = [], prefer = 'class-property' }]) { + /** + * Gets the modifiers of `node`. + * @param node the node to be inspected. + */ + function getModifiers(node) { + const modifiers = []; + if (node.accessibility) { + modifiers.push(node.accessibility); + } + if (node.readonly) { + modifiers.push('readonly'); + } + return modifiers.filter(Boolean).join(' '); + } + if (prefer === 'class-property') { + return { + TSParameterProperty(node) { + const modifiers = getModifiers(node); + if (!allow.includes(modifiers)) { + const name = node.parameter.type === utils_1.AST_NODE_TYPES.Identifier + ? node.parameter.name + : node.parameter.left.name; + context.report({ + node, + messageId: 'preferClassProperty', + data: { + parameter: name, + }, + }); + } + }, + }; + } + const propertyNodesByNameStack = []; + function getNodesByName(name) { + const propertyNodesByName = propertyNodesByNameStack[propertyNodesByNameStack.length - 1]; + const existing = propertyNodesByName.get(name); + if (existing) { + return existing; + } + const created = {}; + propertyNodesByName.set(name, created); + return created; + } + function typeAnnotationsMatch(classProperty, constructorParameter) { + if (!classProperty.typeAnnotation || + !constructorParameter.typeAnnotation) { + return (classProperty.typeAnnotation === constructorParameter.typeAnnotation); + } + return (context.sourceCode.getText(classProperty.typeAnnotation) === + context.sourceCode.getText(constructorParameter.typeAnnotation)); + } + return { + ':matches(ClassDeclaration, ClassExpression):exit'() { + const propertyNodesByName = (0, util_1.nullThrows)(propertyNodesByNameStack.pop(), 'Stack should exist on class exit'); + for (const [name, nodes] of propertyNodesByName) { + if (nodes.classProperty && + nodes.constructorAssignment && + nodes.constructorParameter && + typeAnnotationsMatch(nodes.classProperty, nodes.constructorParameter)) { + context.report({ + node: nodes.classProperty, + messageId: 'preferParameterProperty', + data: { + parameter: name, + }, + }); + } + } + }, + ClassBody(node) { + for (const element of node.body) { + if (element.type === utils_1.AST_NODE_TYPES.PropertyDefinition && + element.key.type === utils_1.AST_NODE_TYPES.Identifier && + !element.value && + !allow.includes(getModifiers(element))) { + getNodesByName(element.key.name).classProperty = element; + } + } + }, + 'ClassDeclaration, ClassExpression'() { + propertyNodesByNameStack.push(new Map()); + }, + 'MethodDefinition[kind="constructor"]'(node) { + for (const parameter of node.value.params) { + if (parameter.type === utils_1.AST_NODE_TYPES.Identifier) { + getNodesByName(parameter.name).constructorParameter = parameter; + } + } + for (const statement of node.value.body?.body ?? []) { + if (statement.type !== utils_1.AST_NODE_TYPES.ExpressionStatement || + statement.expression.type !== utils_1.AST_NODE_TYPES.AssignmentExpression || + statement.expression.left.type !== + utils_1.AST_NODE_TYPES.MemberExpression || + statement.expression.left.object.type !== + utils_1.AST_NODE_TYPES.ThisExpression || + statement.expression.left.property.type !== + utils_1.AST_NODE_TYPES.Identifier || + statement.expression.right.type !== utils_1.AST_NODE_TYPES.Identifier) { + break; + } + getNodesByName(statement.expression.right.name).constructorAssignment = statement.expression; + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..99318497348b2705fe0859d56c7ea25abb8f379a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"preferConstAssertion" | "variableConstAssertion" | "variableSuggest", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js new file mode 100644 index 0000000000000000000000000000000000000000..9e7ef2fc277449e98742a60e6d3ff5a97efedf5b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-as-const.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-as-const', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce the use of `as const` over literal type', + recommended: 'recommended', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + preferConstAssertion: 'Expected a `const` instead of a literal type assertion.', + variableConstAssertion: 'Expected a `const` assertion instead of a literal type annotation.', + variableSuggest: 'You should use `as const` instead of type annotation.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function compareTypes(valueNode, typeNode, canFix) { + if (valueNode.type === utils_1.AST_NODE_TYPES.Literal && + typeNode.type === utils_1.AST_NODE_TYPES.TSLiteralType && + typeNode.literal.type === utils_1.AST_NODE_TYPES.Literal && + valueNode.raw === typeNode.literal.raw) { + if (canFix) { + context.report({ + node: typeNode, + messageId: 'preferConstAssertion', + fix: fixer => fixer.replaceText(typeNode, 'const'), + }); + } + else { + context.report({ + node: typeNode, + messageId: 'variableConstAssertion', + suggest: [ + { + messageId: 'variableSuggest', + fix: (fixer) => [ + fixer.remove(typeNode.parent), + fixer.insertTextAfter(valueNode, ' as const'), + ], + }, + ], + }); + } + } + } + return { + PropertyDefinition(node) { + if (node.value && node.typeAnnotation) { + compareTypes(node.value, node.typeAnnotation.typeAnnotation, false); + } + }, + TSAsExpression(node) { + compareTypes(node.expression, node.typeAnnotation, true); + }, + TSTypeAssertion(node) { + compareTypes(node.expression, node.typeAnnotation, true); + }, + VariableDeclarator(node) { + if (node.init && node.id.typeAnnotation) { + compareTypes(node.init, node.id.typeAnnotation.typeAnnotation, false); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a60564c09f37e9ae2958e705e3f19bf60ffdbed2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.d.ts @@ -0,0 +1,19 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule } from '../util'; +declare const baseRule: TSESLint.RuleModule<"preferDestructuring", [import("eslint/lib/rules/prefer-destructuring").DestructuringTypeConfig | { + AssignmentExpression?: import("eslint/lib/rules/prefer-destructuring").DestructuringTypeConfig; + VariableDeclarator?: import("eslint/lib/rules/prefer-destructuring").DestructuringTypeConfig; +}, (import("eslint/lib/rules/prefer-destructuring").Option1 | undefined)?], unknown, { + AssignmentExpression(node: TSESTree.AssignmentExpression): void; + VariableDeclarator(node: TSESTree.VariableDeclarator): void; +}>; +type BaseOptions = InferOptionsTypeFromRule; +type EnforcementOptions = { + enforceForDeclarationWithTypeAnnotation?: boolean; +} & BaseOptions[1]; +export type Options = [BaseOptions[0], EnforcementOptions]; +export type MessageIds = InferMessageIdsTypeFromRule; +declare const _default: TSESLint.RuleModule<"preferDestructuring", Options, import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.js new file mode 100644 index 0000000000000000000000000000000000000000..f99de3ddc7d693f03f881ca21117f3c9657ae335 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-destructuring.js @@ -0,0 +1,216 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +const getESLintCoreRule_1 = require("../util/getESLintCoreRule"); +const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('prefer-destructuring'); +const destructuringTypeConfig = { + type: 'object', + additionalProperties: false, + properties: { + array: { + type: 'boolean', + }, + object: { + type: 'boolean', + }, + }, +}; +const schema = [ + { + oneOf: [ + { + type: 'object', + additionalProperties: false, + properties: { + AssignmentExpression: destructuringTypeConfig, + VariableDeclarator: destructuringTypeConfig, + }, + }, + destructuringTypeConfig, + ], + }, + { + type: 'object', + additionalProperties: false, + properties: { + enforceForDeclarationWithTypeAnnotation: { + type: 'boolean', + description: 'Whether to enforce destructuring on variable declarations with type annotations.', + }, + enforceForRenamedProperties: { + type: 'boolean', + description: 'Whether to enforce destructuring that use a different variable name than the property name.', + }, + }, + }, +]; +exports.default = (0, util_1.createRule)({ + name: 'prefer-destructuring', + meta: { + type: 'suggestion', + // defaultOptions, -- base rule does not use defaultOptions + docs: { + description: 'Require destructuring from arrays and/or objects', + extendsBaseRule: true, + frozen: true, + requiresTypeChecking: true, + }, + fixable: baseRule.meta.fixable, + hasSuggestions: baseRule.meta.hasSuggestions, + messages: baseRule.meta.messages, + schema, + }, + defaultOptions: [ + { + AssignmentExpression: { + array: true, + object: true, + }, + VariableDeclarator: { + array: true, + object: true, + }, + }, + {}, + ], + create(context, [enabledTypes, options]) { + const { enforceForDeclarationWithTypeAnnotation = false, enforceForRenamedProperties = false, } = options; + const { esTreeNodeToTSNodeMap, program } = (0, util_1.getParserServices)(context); + const typeChecker = program.getTypeChecker(); + const baseRules = baseRule.create(context); + let baseRulesWithoutFixCache = null; + return { + AssignmentExpression(node) { + if (node.operator !== '=') { + return; + } + performCheck(node.left, node.right, node); + }, + VariableDeclarator(node) { + performCheck(node.id, node.init, node); + }, + }; + function performCheck(leftNode, rightNode, reportNode) { + const rules = leftNode.type === utils_1.AST_NODE_TYPES.Identifier && + leftNode.typeAnnotation == null + ? baseRules + : baseRulesWithoutFix(); + if ((leftNode.type === utils_1.AST_NODE_TYPES.ArrayPattern || + leftNode.type === utils_1.AST_NODE_TYPES.Identifier || + leftNode.type === utils_1.AST_NODE_TYPES.ObjectPattern) && + leftNode.typeAnnotation != null && + !enforceForDeclarationWithTypeAnnotation) { + return; + } + if (rightNode != null && + isArrayLiteralIntegerIndexAccess(rightNode) && + rightNode.object.type !== utils_1.AST_NODE_TYPES.Super) { + const tsObj = esTreeNodeToTSNodeMap.get(rightNode.object); + const objType = typeChecker.getTypeAtLocation(tsObj); + if (!isTypeAnyOrIterableType(objType, typeChecker)) { + if (!enforceForRenamedProperties || + !getNormalizedEnabledType(reportNode.type, 'object')) { + return; + } + context.report({ + node: reportNode, + messageId: 'preferDestructuring', + data: { type: 'object' }, + }); + return; + } + } + if (reportNode.type === utils_1.AST_NODE_TYPES.AssignmentExpression) { + rules.AssignmentExpression(reportNode); + } + else { + rules.VariableDeclarator(reportNode); + } + } + function getNormalizedEnabledType(nodeType, destructuringType) { + if ('object' in enabledTypes || 'array' in enabledTypes) { + return enabledTypes[destructuringType]; + } + return enabledTypes[nodeType][destructuringType]; + } + function baseRulesWithoutFix() { + baseRulesWithoutFixCache ??= baseRule.create(noFixContext(context)); + return baseRulesWithoutFixCache; + } + }, +}); +function noFixContext(context) { + const customContext = { + report: (descriptor) => { + context.report({ + ...descriptor, + fix: undefined, + }); + }, + }; + // we can't directly proxy `context` because its `report` property is non-configurable + // and non-writable. So we proxy `customContext` and redirect all + // property access to the original context except for `report` + return new Proxy(customContext, { + get(target, path, receiver) { + if (path !== 'report') { + return Reflect.get(context, path, receiver); + } + return Reflect.get(target, path, receiver); + }, + }); +} +function isTypeAnyOrIterableType(type, typeChecker) { + if ((0, util_1.isTypeAnyType)(type)) { + return true; + } + if (!type.isUnion()) { + const iterator = tsutils.getWellKnownSymbolPropertyOfType(type, 'iterator', typeChecker); + return iterator != null; + } + return type.types.every(t => isTypeAnyOrIterableType(t, typeChecker)); +} +function isArrayLiteralIntegerIndexAccess(node) { + if (node.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return false; + } + if (node.property.type !== utils_1.AST_NODE_TYPES.Literal) { + return false; + } + return Number.isInteger(node.property.value); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..244c414dccdcbb04a1366f720f2494d71a572759 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.d.ts @@ -0,0 +1,6 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type MessageIds = 'defineInitializer' | 'defineInitializerSuggestion'; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js new file mode 100644 index 0000000000000000000000000000000000000000..d9549e651432184e48e9ea08f8d576f3ae3cc7e8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-enum-initializers.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-enum-initializers', + meta: { + type: 'suggestion', + docs: { + description: 'Require each enum member value to be explicitly initialized', + }, + hasSuggestions: true, + messages: { + defineInitializer: "The value of the member '{{ name }}' should be explicitly defined.", + defineInitializerSuggestion: 'Can be fixed to {{ name }} = {{ suggested }}', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function TSEnumDeclaration(node) { + const { members } = node.body; + members.forEach((member, index) => { + if (member.initializer == null) { + const name = context.sourceCode.getText(member); + context.report({ + node: member, + messageId: 'defineInitializer', + data: { + name, + }, + suggest: [ + { + messageId: 'defineInitializerSuggestion', + data: { name, suggested: index }, + fix: (fixer) => { + return fixer.replaceText(member, `${name} = ${index}`); + }, + }, + { + messageId: 'defineInitializerSuggestion', + data: { name, suggested: index + 1 }, + fix: (fixer) => { + return fixer.replaceText(member, `${name} = ${index + 1}`); + }, + }, + { + messageId: 'defineInitializerSuggestion', + data: { name, suggested: `'${name}'` }, + fix: (fixer) => { + return fixer.replaceText(member, `${name} = '${name}'`); + }, + }, + ], + }); + } + }); + } + return { + TSEnumDeclaration, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d427bc51034be0a613a2a6714f80f56314d7a2d1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"preferFind" | "preferFindSuggestion", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.js new file mode 100644 index 0000000000000000000000000000000000000000..fc23349eef24d2c072a7b747e66c41a4e31ace09 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-find.js @@ -0,0 +1,247 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-find', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + preferFind: 'Prefer .find(...) instead of .filter(...)[0].', + preferFindSuggestion: 'Use .find(...) instead of .filter(...)[0].', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const globalScope = context.sourceCode.getScope(context.sourceCode.ast); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function parseArrayFilterExpressions(expression) { + const node = (0, util_1.skipChainExpression)(expression); + if (node.type === utils_1.AST_NODE_TYPES.SequenceExpression) { + // Only the last expression in (a, b, [1, 2, 3].filter(condition))[0] matters + const lastExpression = (0, util_1.nullThrows)(node.expressions.at(-1), 'Expected to have more than zero expressions in a sequence expression'); + return parseArrayFilterExpressions(lastExpression); + } + // This is the only reason we're returning a list rather than a single value. + if (node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) { + // Both branches of the ternary _must_ return results. + const consequentResult = parseArrayFilterExpressions(node.consequent); + if (consequentResult.length === 0) { + return []; + } + const alternateResult = parseArrayFilterExpressions(node.alternate); + if (alternateResult.length === 0) { + return []; + } + // Accumulate the results from both sides and pass up the chain. + return [...consequentResult, ...alternateResult]; + } + // Check if it looks like <>(...), but not <>?.(...) + if (node.type === utils_1.AST_NODE_TYPES.CallExpression && !node.optional) { + const callee = node.callee; + // Check if it looks like <>.filter(...) or <>['filter'](...), + // or the optional chaining variants. + if (callee.type === utils_1.AST_NODE_TYPES.MemberExpression) { + const isBracketSyntaxForFilter = callee.computed; + if ((0, util_1.isStaticMemberAccessOfValue)(callee, context, 'filter')) { + const filterNode = callee.property; + const filteredObjectType = (0, util_1.getConstrainedTypeAtLocation)(services, callee.object); + // As long as the object is a (possibly nullable) array, + // this is an Array.prototype.filter expression. + if (isArrayish(filteredObjectType)) { + return [ + { + filterNode, + isBracketSyntaxForFilter, + }, + ]; + } + } + } + } + // not a filter expression. + return []; + } + /** + * Tells whether the type is a possibly nullable array/tuple or union thereof. + */ + function isArrayish(type) { + let isAtLeastOneArrayishComponent = false; + for (const unionPart of tsutils.unionConstituents(type)) { + if (tsutils.isIntrinsicNullType(unionPart) || + tsutils.isIntrinsicUndefinedType(unionPart)) { + continue; + } + // apparently checker.isArrayType(T[] & S[]) => false. + // so we need to check the intersection parts individually. + const isArrayOrIntersectionThereof = tsutils + .intersectionConstituents(unionPart) + .every(intersectionPart => checker.isArrayType(intersectionPart) || + checker.isTupleType(intersectionPart)); + if (!isArrayOrIntersectionThereof) { + // There is a non-array, non-nullish type component, + // so it's not an array. + return false; + } + isAtLeastOneArrayishComponent = true; + } + return isAtLeastOneArrayishComponent; + } + function getObjectIfArrayAtZeroExpression(node) { + // .at() should take exactly one argument. + if (node.arguments.length !== 1) { + return undefined; + } + const callee = node.callee; + if (callee.type === utils_1.AST_NODE_TYPES.MemberExpression && + !callee.optional && + (0, util_1.isStaticMemberAccessOfValue)(callee, context, 'at')) { + const atArgument = (0, util_1.getStaticValue)(node.arguments[0], globalScope); + if (atArgument != null && isTreatedAsZeroByArrayAt(atArgument.value)) { + return callee.object; + } + } + return undefined; + } + /** + * Implements the algorithm for array indexing by `.at()` method. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at#parameters + */ + function isTreatedAsZeroByArrayAt(value) { + // This would cause the number constructor coercion to throw. Other static + // values are safe. + if (typeof value === 'symbol') { + return false; + } + const asNumber = Number(value); + if (isNaN(asNumber)) { + return true; + } + return Math.trunc(asNumber) === 0; + } + function isMemberAccessOfZero(node) { + const property = (0, util_1.getStaticValue)(node.property, globalScope); + // Check if it looks like <>[0] or <>['0'], but not <>?.[0] + return (!node.optional && + property != null && + isTreatedAsZeroByMemberAccess(property.value)); + } + /** + * Implements the algorithm for array indexing by member operator. + * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#array_indices + */ + function isTreatedAsZeroByMemberAccess(value) { + return String(value) === '0'; + } + function generateFixToRemoveArrayElementAccess(fixer, arrayNode, wholeExpressionBeingFlagged) { + const tokenToStartDeletingFrom = (0, util_1.nullThrows)( + // The next `.` or `[` is what we're looking for. + // think of (...).at(0) or (...)[0] or even (...)["at"](0). + context.sourceCode.getTokenAfter(arrayNode, token => token.value === '.' || token.value === '['), 'Expected to find a member access token!'); + return fixer.removeRange([ + tokenToStartDeletingFrom.range[0], + wholeExpressionBeingFlagged.range[1], + ]); + } + function generateFixToReplaceFilterWithFind(fixer, filterExpression) { + return fixer.replaceText(filterExpression.filterNode, filterExpression.isBracketSyntaxForFilter ? '"find"' : 'find'); + } + return { + // This query will be used to find things like `filteredResults.at(0)`. + CallExpression(node) { + const object = getObjectIfArrayAtZeroExpression(node); + if (object) { + const filterExpressions = parseArrayFilterExpressions(object); + if (filterExpressions.length !== 0) { + context.report({ + node, + messageId: 'preferFind', + suggest: [ + { + messageId: 'preferFindSuggestion', + fix: (fixer) => { + return [ + ...filterExpressions.map(filterExpression => generateFixToReplaceFilterWithFind(fixer, filterExpression)), + // Get rid of the .at(0) or ['at'](0). + generateFixToRemoveArrayElementAccess(fixer, object, node), + ]; + }, + }, + ], + }); + } + } + }, + // This query will be used to find things like `filteredResults[0]`. + // + // Note: we're always looking for array member access to be "computed", + // i.e. `filteredResults[0]`, since `filteredResults.0` isn't a thing. + 'MemberExpression[computed=true]'(node) { + if (isMemberAccessOfZero(node)) { + const object = node.object; + const filterExpressions = parseArrayFilterExpressions(object); + if (filterExpressions.length !== 0) { + context.report({ + node, + messageId: 'preferFind', + suggest: [ + { + messageId: 'preferFindSuggestion', + fix: (fixer) => { + return [ + ...filterExpressions.map(filterExpression => generateFixToReplaceFilterWithFind(fixer, filterExpression)), + // Get rid of the [0]. + generateFixToRemoveArrayElementAccess(fixer, object, node), + ]; + }, + }, + ], + }); + } + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6145bf3a81ea160196f47e647df9893481e9518 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"preferForOf", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js new file mode 100644 index 0000000000000000000000000000000000000000..e77461a7f56e244432b80c517f1fb8c8a3fa86a7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-for-of.js @@ -0,0 +1,115 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-for-of', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce the use of `for-of` loop over the standard `for` loop where possible', + recommended: 'stylistic', + }, + messages: { + preferForOf: 'Expected a `for-of` loop instead of a `for` loop with this simple iteration.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function isSingleVariableDeclaration(node) { + return (node?.type === utils_1.AST_NODE_TYPES.VariableDeclaration && + node.kind !== 'const' && + node.declarations.length === 1); + } + function isLiteral(node, value) { + return node.type === utils_1.AST_NODE_TYPES.Literal && node.value === value; + } + function isZeroInitialized(node) { + return node.init != null && isLiteral(node.init, 0); + } + function isMatchingIdentifier(node, name) { + return node.type === utils_1.AST_NODE_TYPES.Identifier && node.name === name; + } + function isLessThanLengthExpression(node, name) { + if (node?.type === utils_1.AST_NODE_TYPES.BinaryExpression && + node.operator === '<' && + isMatchingIdentifier(node.left, name) && + node.right.type === utils_1.AST_NODE_TYPES.MemberExpression && + isMatchingIdentifier(node.right.property, 'length')) { + return node.right.object; + } + return null; + } + function isIncrement(node, name) { + if (!node) { + return false; + } + switch (node.type) { + case utils_1.AST_NODE_TYPES.UpdateExpression: + // x++ or ++x + return (node.operator === '++' && isMatchingIdentifier(node.argument, name)); + case utils_1.AST_NODE_TYPES.AssignmentExpression: + if (isMatchingIdentifier(node.left, name)) { + if (node.operator === '+=') { + // x += 1 + return isLiteral(node.right, 1); + } + if (node.operator === '=') { + // x = x + 1 or x = 1 + x + const expr = node.right; + return (expr.type === utils_1.AST_NODE_TYPES.BinaryExpression && + expr.operator === '+' && + ((isMatchingIdentifier(expr.left, name) && + isLiteral(expr.right, 1)) || + (isLiteral(expr.left, 1) && + isMatchingIdentifier(expr.right, name)))); + } + } + } + return false; + } + function contains(outer, inner) { + return (outer.range[0] <= inner.range[0] && outer.range[1] >= inner.range[1]); + } + function isIndexOnlyUsedWithArray(body, indexVar, arrayExpression) { + const arrayText = context.sourceCode.getText(arrayExpression); + return indexVar.references.every(reference => { + const id = reference.identifier; + const node = id.parent; + return (!contains(body, id) || + (node.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.object.type !== utils_1.AST_NODE_TYPES.ThisExpression && + node.property === id && + context.sourceCode.getText(node.object) === arrayText && + !(0, util_1.isAssignee)(node))); + }); + } + return { + 'ForStatement:exit'(node) { + if (!isSingleVariableDeclaration(node.init)) { + return; + } + const declarator = node.init.declarations[0]; + if (!declarator || + !isZeroInitialized(declarator) || + declarator.id.type !== utils_1.AST_NODE_TYPES.Identifier) { + return; + } + const indexName = declarator.id.name; + const arrayExpression = isLessThanLengthExpression(node.test, indexName); + if (!arrayExpression) { + return; + } + const [indexVar] = context.sourceCode.getDeclaredVariables(node.init); + if (isIncrement(node.update, indexName) && + isIndexOnlyUsedWithArray(node.body, indexVar, arrayExpression)) { + context.report({ + node, + messageId: 'preferForOf', + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aea6292d21418a70b17d59e25ded4c87e3762ead --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.d.ts @@ -0,0 +1,9 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export declare const phrases: { + readonly TSInterfaceDeclaration: "Interface"; + readonly TSTypeLiteral: "Type literal"; +}; +declare const _default: TSESLint.RuleModule<"functionTypeOverCallableType" | "unexpectedThisOnFunctionOnlyInterface", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js new file mode 100644 index 0000000000000000000000000000000000000000..b93373476a1c1e1fa4d941d9fa7469d3cc949c9c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-function-type.js @@ -0,0 +1,186 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.phrases = void 0; +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.phrases = { + [utils_1.AST_NODE_TYPES.TSInterfaceDeclaration]: 'Interface', + [utils_1.AST_NODE_TYPES.TSTypeLiteral]: 'Type literal', +}; +exports.default = (0, util_1.createRule)({ + name: 'prefer-function-type', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce using function types instead of interfaces with call signatures', + recommended: 'stylistic', + }, + fixable: 'code', + messages: { + functionTypeOverCallableType: '{{ literalOrInterface }} only has a call signature, you should use a function type instead.', + unexpectedThisOnFunctionOnlyInterface: "`this` refers to the function type '{{ interfaceName }}', did you intend to use a generic `this` parameter like `(this: Self, ...) => Self` instead?", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + /** + * Checks if there the interface has exactly one supertype that isn't named 'Function' + * @param node The node being checked + */ + function hasOneSupertype(node) { + if (node.extends.length === 0) { + return false; + } + if (node.extends.length !== 1) { + return true; + } + const expr = node.extends[0].expression; + return (expr.type !== utils_1.AST_NODE_TYPES.Identifier || expr.name !== 'Function'); + } + /** + * @param parent The parent of the call signature causing the diagnostic + */ + function shouldWrapSuggestion(parent) { + if (!parent) { + return false; + } + switch (parent.type) { + case utils_1.AST_NODE_TYPES.TSUnionType: + case utils_1.AST_NODE_TYPES.TSIntersectionType: + case utils_1.AST_NODE_TYPES.TSArrayType: + return true; + default: + return false; + } + } + /** + * @param member The TypeElement being checked + * @param node The parent of member being checked + */ + function checkMember(member, node, tsThisTypes = null) { + if ((member.type === utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration || + member.type === utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration) && + member.returnType != null) { + if (tsThisTypes?.length && + node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration) { + // the message can be confusing if we don't point directly to the `this` node instead of the whole member + // and in favour of generating at most one error we'll only report the first occurrence of `this` if there are multiple + context.report({ + node: tsThisTypes[0], + messageId: 'unexpectedThisOnFunctionOnlyInterface', + data: { + interfaceName: node.id.name, + }, + }); + return; + } + const fixable = node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration; + const fix = fixable + ? null + : (fixer) => { + const fixes = []; + const start = member.range[0]; + // https://github.com/microsoft/TypeScript/pull/56908 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const colonPos = member.returnType.range[0] - start; + const text = context.sourceCode + .getText() + .slice(start, member.range[1]); + const comments = [ + ...context.sourceCode.getCommentsBefore(member), + ...context.sourceCode.getCommentsAfter(member), + ]; + let suggestion = `${text.slice(0, colonPos)} =>${text.slice(colonPos + 1)}`; + const lastChar = suggestion.endsWith(';') ? ';' : ''; + if (lastChar) { + suggestion = suggestion.slice(0, -1); + } + if (shouldWrapSuggestion(node.parent)) { + suggestion = `(${suggestion})`; + } + if (node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration) { + if (node.typeParameters != null) { + suggestion = `type ${context.sourceCode + .getText() + .slice(node.id.range[0], node.typeParameters.range[1])} = ${suggestion}${lastChar}`; + } + else { + suggestion = `type ${node.id.name} = ${suggestion}${lastChar}`; + } + } + const isParentExported = node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration; + if (node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration && + isParentExported) { + const commentsText = comments + .map(({ type, value }) => type === utils_1.AST_TOKEN_TYPES.Line + ? `//${value}\n` + : `/*${value}*/\n`) + .join(''); + // comments should move before export and not between export and interface declaration + fixes.push(fixer.insertTextBefore(node.parent, commentsText)); + } + else { + comments.forEach(comment => { + let commentText = comment.type === utils_1.AST_TOKEN_TYPES.Line + ? `//${comment.value}` + : `/*${comment.value}*/`; + const isCommentOnTheSameLine = comment.loc.start.line === member.loc.start.line; + if (!isCommentOnTheSameLine) { + commentText += '\n'; + } + else { + commentText += ' '; + } + suggestion = commentText + suggestion; + }); + } + const fixStart = node.range[0]; + fixes.push(fixer.replaceTextRange([fixStart, node.range[1]], suggestion)); + return fixes; + }; + context.report({ + node: member, + messageId: 'functionTypeOverCallableType', + data: { + literalOrInterface: exports.phrases[node.type], + }, + fix, + }); + } + } + let tsThisTypes = null; + let literalNesting = 0; + return { + TSInterfaceDeclaration() { + // when entering an interface reset the count of `this`s to empty. + tsThisTypes = []; + }, + 'TSInterfaceDeclaration:exit'(node) { + if (!hasOneSupertype(node) && node.body.body.length === 1) { + checkMember(node.body.body[0], node, tsThisTypes); + } + // on exit check member and reset the array to nothing. + tsThisTypes = null; + }, + 'TSInterfaceDeclaration TSThisType'(node) { + // inside an interface keep track of all ThisType references. + // unless it's inside a nested type literal in which case it's invalid code anyway + // we don't want to incorrectly say "it refers to name" while typescript says it's completely invalid. + if (literalNesting === 0 && tsThisTypes != null) { + tsThisTypes.push(node); + } + }, + // keep track of nested literals to avoid complaining about invalid `this` uses + 'TSInterfaceDeclaration TSTypeLiteral'() { + literalNesting += 1; + }, + 'TSInterfaceDeclaration TSTypeLiteral:exit'() { + literalNesting -= 1; + }, + 'TSTypeLiteral[members.length = 1]'(node) { + checkMember(node.members[0], node); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3f456edfdd01a7bf5f424c7da34d9a71c1598cc8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"preferIncludes" | "preferStringIncludes", [], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js new file mode 100644 index 0000000000000000000000000000000000000000..acca9776c4c93f5ba5c70c358ccbc876068d83d7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-includes.js @@ -0,0 +1,242 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const regexpp_1 = require("@eslint-community/regexpp"); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-includes', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce `includes` method over `indexOf` method', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferIncludes: "Use 'includes()' method instead.", + preferStringIncludes: 'Use `String#includes()` method with a string instead.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const globalScope = context.sourceCode.getScope(context.sourceCode.ast); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function isNumber(node, value) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + return evaluated?.value === value; + } + function isPositiveCheck(node) { + switch (node.operator) { + case '!==': + case '!=': + case '>': + return isNumber(node.right, -1); + case '>=': + return isNumber(node.right, 0); + default: + return false; + } + } + function isNegativeCheck(node) { + switch (node.operator) { + case '===': + case '==': + case '<=': + return isNumber(node.right, -1); + case '<': + return isNumber(node.right, 0); + default: + return false; + } + } + function hasSameParameters(nodeA, nodeB) { + if (!ts.isFunctionLike(nodeA) || !ts.isFunctionLike(nodeB)) { + return false; + } + const paramsA = nodeA.parameters; + const paramsB = nodeB.parameters; + if (paramsA.length !== paramsB.length) { + return false; + } + for (let i = 0; i < paramsA.length; ++i) { + const paramA = paramsA[i]; + const paramB = paramsB[i]; + // Check name, type, and question token once. + if (paramA.getText() !== paramB.getText()) { + return false; + } + } + return true; + } + /** + * Parse a given node if it's a `RegExp` instance. + * @param node The node to parse. + */ + function parseRegExp(node) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + if (evaluated == null || !(evaluated.value instanceof RegExp)) { + return null; + } + const { flags, pattern } = (0, regexpp_1.parseRegExpLiteral)(evaluated.value); + if (pattern.alternatives.length !== 1 || + flags.ignoreCase || + flags.global) { + return null; + } + // Check if it can determine a unique string. + const chars = pattern.alternatives[0].elements; + if (!chars.every(c => c.type === 'Character')) { + return null; + } + // To string. + return String.fromCodePoint(...chars.map(c => c.value)); + } + function escapeString(str) { + const EscapeMap = { + '\0': '\\0', + '\t': '\\t', + '\n': '\\n', + '\v': '\\v', + '\f': '\\f', + '\r': '\\r', + "'": "\\'", + '\\': '\\\\', + // "\b" cause unexpected replacements + // '\b': '\\b', + }; + const replaceRegex = new RegExp(Object.values(EscapeMap).join('|'), 'g'); + return str.replaceAll(replaceRegex, char => EscapeMap[char]); + } + function checkArrayIndexOf(node, allowFixing) { + if (!(0, util_1.isStaticMemberAccessOfValue)(node, context, 'indexOf')) { + return; + } + // Check if the comparison is equivalent to `includes()`. + const callNode = node.parent; + const compareNode = (callNode.parent.type === utils_1.AST_NODE_TYPES.ChainExpression + ? callNode.parent.parent + : callNode.parent); + const negative = isNegativeCheck(compareNode); + if (!negative && !isPositiveCheck(compareNode)) { + return; + } + // Get the symbol of `indexOf` method. + const indexofMethodDeclarations = services + .getSymbolAtLocation(node.property) + ?.getDeclarations(); + if (indexofMethodDeclarations == null || + indexofMethodDeclarations.length === 0) { + return; + } + // Check if every declaration of `indexOf` method has `includes` method + // and the two methods have the same parameters. + for (const instanceofMethodDecl of indexofMethodDeclarations) { + const typeDecl = instanceofMethodDecl.parent; + const type = checker.getTypeAtLocation(typeDecl); + const includesMethodDecl = type + .getProperty('includes') + ?.getDeclarations(); + if (!includesMethodDecl?.some(includesMethodDecl => hasSameParameters(includesMethodDecl, instanceofMethodDecl))) { + return; + } + } + // Report it. + context.report({ + node: compareNode, + messageId: 'preferIncludes', + ...(allowFixing && { + *fix(fixer) { + if (negative) { + yield fixer.insertTextBefore(callNode, '!'); + } + yield fixer.replaceText(node.property, 'includes'); + yield fixer.removeRange([callNode.range[1], compareNode.range[1]]); + }, + }), + }); + } + return { + // a.indexOf(b) !== 1 + 'BinaryExpression > CallExpression.left > MemberExpression'(node) { + checkArrayIndexOf(node, /* allowFixing */ true); + }, + // a?.indexOf(b) !== 1 + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression'(node) { + checkArrayIndexOf(node, /* allowFixing */ false); + }, + // /bar/.test(foo) + 'CallExpression[arguments.length=1] > MemberExpression.callee[property.name="test"][computed=false]'(node) { + const callNode = node.parent; + const text = parseRegExp(node.object); + if (text == null) { + return; + } + //check the argument type of test methods + const argument = callNode.arguments[0]; + const type = (0, util_1.getConstrainedTypeAtLocation)(services, argument); + const includesMethodDecl = type + .getProperty('includes') + ?.getDeclarations(); + if (includesMethodDecl == null) { + return; + } + context.report({ + node: callNode, + messageId: 'preferStringIncludes', + *fix(fixer) { + const argNode = callNode.arguments[0]; + const needsParen = argNode.type !== utils_1.AST_NODE_TYPES.Literal && + argNode.type !== utils_1.AST_NODE_TYPES.TemplateLiteral && + argNode.type !== utils_1.AST_NODE_TYPES.Identifier && + argNode.type !== utils_1.AST_NODE_TYPES.MemberExpression && + argNode.type !== utils_1.AST_NODE_TYPES.CallExpression; + yield fixer.removeRange([callNode.range[0], argNode.range[0]]); + yield fixer.removeRange([argNode.range[1], callNode.range[1]]); + if (needsParen) { + yield fixer.insertTextBefore(argNode, '('); + yield fixer.insertTextAfter(argNode, ')'); + } + yield fixer.insertTextAfter(argNode, `${node.optional ? '?.' : '.'}includes('${escapeString(text)}')`); + }, + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..02b07894006a275a6ac3b0966f49cf2ed8e14c5b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.d.ts @@ -0,0 +1,6 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"notLiteral" | "notLiteralOrBitwiseExpression", [{ + allowBitwiseExpressions: boolean; +}], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js new file mode 100644 index 0000000000000000000000000000000000000000..168fdcd78df872721b836524224e14ebc86b40db --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-literal-enum-member.js @@ -0,0 +1,116 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-literal-enum-member', + meta: { + type: 'suggestion', + docs: { + description: 'Require all enum members to be literal values', + recommended: 'strict', + requiresTypeChecking: false, + }, + messages: { + notLiteral: `Explicit enum value must only be a literal value (string or number).`, + notLiteralOrBitwiseExpression: `Explicit enum value must only be a literal value (string or number) or a bitwise expression.`, + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowBitwiseExpressions: { + type: 'boolean', + description: 'Whether to allow using bitwise expressions in enum initializers.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowBitwiseExpressions: false, + }, + ], + create(context, [{ allowBitwiseExpressions }]) { + function isIdentifierWithName(node, name) { + return node.type === utils_1.AST_NODE_TYPES.Identifier && node.name === name; + } + function hasEnumMember(decl, name) { + return decl.body.members.some(member => isIdentifierWithName(member.id, name) || + (member.id.type === utils_1.AST_NODE_TYPES.Literal && + (0, util_1.getStaticStringValue)(member.id) === name)); + } + function isSelfEnumMember(decl, node) { + if (node.type === utils_1.AST_NODE_TYPES.Identifier) { + return hasEnumMember(decl, node.name); + } + if (node.type === utils_1.AST_NODE_TYPES.MemberExpression && + isIdentifierWithName(node.object, decl.id.name)) { + if (node.property.type === utils_1.AST_NODE_TYPES.Identifier) { + return hasEnumMember(decl, node.property.name); + } + if (node.computed) { + const propertyName = (0, util_1.getStaticStringValue)(node.property); + if (propertyName) { + return hasEnumMember(decl, propertyName); + } + } + } + return false; + } + return { + TSEnumMember(node) { + // If there is no initializer, then this node is just the name of the member, so ignore. + if (node.initializer == null) { + return; + } + const declaration = node.parent.parent; + function isAllowedInitializerExpressionRecursive(node, partOfBitwiseComputation) { + // You can only refer to an enum member if it's part of a bitwise computation. + // so C = B isn't allowed (special case), but C = A | B is. + if (partOfBitwiseComputation && isSelfEnumMember(declaration, node)) { + return true; + } + switch (node.type) { + // any old literal + case utils_1.AST_NODE_TYPES.Literal: + return true; + // TemplateLiteral without expressions + case utils_1.AST_NODE_TYPES.TemplateLiteral: + return node.expressions.length === 0; + case utils_1.AST_NODE_TYPES.UnaryExpression: + // +123, -123, etc. + if (['-', '+'].includes(node.operator)) { + return isAllowedInitializerExpressionRecursive(node.argument, partOfBitwiseComputation); + } + if (allowBitwiseExpressions) { + return (node.operator === '~' && + isAllowedInitializerExpressionRecursive(node.argument, true)); + } + return false; + case utils_1.AST_NODE_TYPES.BinaryExpression: + if (allowBitwiseExpressions) { + return (['&', '^', '<<', '>>', '>>>', '|'].includes(node.operator) && + isAllowedInitializerExpressionRecursive(node.left, true) && + isAllowedInitializerExpressionRecursive(node.right, true)); + } + return false; + default: + return false; + } + } + if (isAllowedInitializerExpressionRecursive(node.initializer, false)) { + return; + } + context.report({ + node: node.id, + messageId: allowBitwiseExpressions + ? 'notLiteralOrBitwiseExpression' + : 'notLiteral', + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..998def956c008856917b59eaa95fb8ea271577bf --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"useNamespace", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js new file mode 100644 index 0000000000000000000000000000000000000000..6d25e0d150758b31e25d58d14a6f5a77573efc0a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-namespace-keyword.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-namespace-keyword', + meta: { + type: 'suggestion', + docs: { + description: 'Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules', + recommended: 'recommended', + }, + fixable: 'code', + messages: { + useNamespace: "Use 'namespace' instead of 'module' to declare custom TypeScript modules.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + return { + TSModuleDeclaration(node) { + // Do nothing if the name is a string. + if (node.id.type === utils_1.AST_NODE_TYPES.Literal) { + return; + } + // Get tokens of the declaration header. + const moduleType = context.sourceCode.getTokenBefore(node.id); + if (moduleType?.type === utils_1.AST_TOKEN_TYPES.Identifier && + moduleType.value === 'module') { + context.report({ + node, + messageId: 'useNamespace', + fix(fixer) { + return fixer.replaceText(moduleType, 'namespace'); + }, + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d0f40098e6d62571a750d31d4b5adad58352eb9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.d.ts @@ -0,0 +1,22 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type Options = [ + { + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean; + ignoreBooleanCoercion?: boolean; + ignoreConditionalTests?: boolean; + ignoreIfStatements?: boolean; + ignoreMixedLogicalExpressions?: boolean; + ignorePrimitives?: true | { + bigint?: boolean; + boolean?: boolean; + number?: boolean; + string?: boolean; + }; + ignoreTernaryTests?: boolean; + } +]; +export type MessageIds = 'noStrictNullCheck' | 'preferNullishOverAssignment' | 'preferNullishOverOr' | 'preferNullishOverTernary' | 'suggestNullish'; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js new file mode 100644 index 0000000000000000000000000000000000000000..b46be0f4a69a539fdcfd926cc0279df45ec75fe7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-nullish-coalescing.js @@ -0,0 +1,647 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const getWrappedCode_1 = require("../util/getWrappedCode"); +const isMemberAccessLike = (0, util_1.isNodeOfTypes)([ + utils_1.AST_NODE_TYPES.ChainExpression, + utils_1.AST_NODE_TYPES.Identifier, + utils_1.AST_NODE_TYPES.MemberExpression, +]); +const isNullLiteralOrUndefinedIdentifier = (node) => (0, util_1.isNullLiteral)(node) || (0, util_1.isUndefinedIdentifier)(node); +const isNodeNullishComparison = (node) => isNullLiteralOrUndefinedIdentifier(node.left) && + isNullLiteralOrUndefinedIdentifier(node.right); +exports.default = (0, util_1.createRule)({ + name: 'prefer-nullish-coalescing', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce using the nullish coalescing operator instead of logical assignments or chaining', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + preferNullishOverAssignment: 'Prefer using nullish coalescing operator (`??{{ equals }}`) instead of an assignment expression, as it is simpler to read.', + preferNullishOverOr: 'Prefer using nullish coalescing operator (`??{{ equals }}`) instead of a logical {{ description }} (`||{{ equals }}`), as it is a safer operator.', + preferNullishOverTernary: 'Prefer using nullish coalescing operator (`??{{ equals }}`) instead of a ternary expression, as it is simpler to read.', + suggestNullish: 'Fix to nullish coalescing operator (`??{{ equals }}`).', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + description: 'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.', + }, + ignoreBooleanCoercion: { + type: 'boolean', + description: 'Whether to ignore arguments to the `Boolean` constructor', + }, + ignoreConditionalTests: { + type: 'boolean', + description: 'Whether to ignore cases that are located within a conditional test.', + }, + ignoreIfStatements: { + type: 'boolean', + description: 'Whether to ignore any if statements that could be simplified by using the nullish coalescing operator.', + }, + ignoreMixedLogicalExpressions: { + type: 'boolean', + description: 'Whether to ignore any logical or expressions that are part of a mixed logical expression (with `&&`).', + }, + ignorePrimitives: { + description: 'Whether to ignore all (`true`) or some (an object with properties) primitive types.', + oneOf: [ + { + type: 'object', + additionalProperties: false, + description: 'Which primitives types may be ignored.', + properties: { + bigint: { + type: 'boolean', + description: 'Ignore bigint primitive types.', + }, + boolean: { + type: 'boolean', + description: 'Ignore boolean primitive types.', + }, + number: { + type: 'boolean', + description: 'Ignore number primitive types.', + }, + string: { + type: 'boolean', + description: 'Ignore string primitive types.', + }, + }, + }, + { + type: 'boolean', + description: 'Ignore all primitive types.', + enum: [true], + }, + ], + }, + ignoreTernaryTests: { + type: 'boolean', + description: 'Whether to ignore any ternary expressions that could be simplified by using the nullish coalescing operator.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + ignoreBooleanCoercion: false, + ignoreConditionalTests: true, + ignoreIfStatements: false, + ignoreMixedLogicalExpressions: false, + ignorePrimitives: { + bigint: false, + boolean: false, + number: false, + string: false, + }, + ignoreTernaryTests: false, + }, + ], + create(context, [{ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing, ignoreBooleanCoercion, ignoreConditionalTests, ignoreIfStatements, ignoreMixedLogicalExpressions, ignorePrimitives, ignoreTernaryTests, },]) { + const parserServices = (0, util_1.getParserServices)(context); + const compilerOptions = parserServices.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + if (!isStrictNullChecks && + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { column: 0, line: 0 }, + end: { column: 0, line: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + /** + * Checks whether a type tested for truthiness is eligible for conversion to + * a nullishness check, taking into account the rule's configuration. + */ + function isTypeEligibleForPreferNullish(type) { + if (!(0, util_1.isNullableType)(type)) { + return false; + } + const ignorableFlags = [ + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + (ignorePrimitives === true || ignorePrimitives.bigint) && + ts.TypeFlags.BigIntLike, + (ignorePrimitives === true || ignorePrimitives.boolean) && + ts.TypeFlags.BooleanLike, + (ignorePrimitives === true || ignorePrimitives.number) && + ts.TypeFlags.NumberLike, + (ignorePrimitives === true || ignorePrimitives.string) && + ts.TypeFlags.StringLike, + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + ] + .filter((flag) => typeof flag === 'number') + .reduce((previous, flag) => previous | flag, 0); + if (ignorableFlags === 0) { + // any types are eligible for conversion. + return true; + } + // if the type is `any` or `unknown` we can't make any assumptions + // about the value, so it could be any primitive, even though the flags + // won't be set. + // + // technically, this is true of `void` as well, however, it's a TS error + // to test `void` for truthiness, so we don't need to bother checking for + // it in valid code. + if (tsutils.isTypeFlagSet(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return false; + } + if (tsutils + .typeConstituents(type) + .some(t => tsutils + .intersectionConstituents(t) + .some(t => tsutils.isTypeFlagSet(t, ignorableFlags)))) { + return false; + } + return true; + } + /** + * Determines whether a control flow construct that uses the truthiness of + * a test expression is eligible for conversion to the nullish coalescing + * operator, taking into account (both dependent on the rule's configuration): + * 1. Whether the construct is in a permitted syntactic context + * 2. Whether the type of the test expression is deemed eligible for + * conversion + * + * @param node The overall node to be converted (e.g. `a || b` or `a ? a : b`) + * @param testNode The node being tested (i.e. `a`) + */ + function isTruthinessCheckEligibleForPreferNullish({ node, testNode, }) { + if (ignoreConditionalTests === true && isConditionalTest(node)) { + return false; + } + if (ignoreBooleanCoercion === true && + isBooleanConstructorContext(node, context) && + !(node.type === utils_1.AST_NODE_TYPES.ConditionalExpression && + node.parent.type === utils_1.AST_NODE_TYPES.CallExpression)) { + return false; + } + const testType = parserServices.getTypeAtLocation(testNode); + if (!isTypeEligibleForPreferNullish(testType)) { + return false; + } + return true; + } + function checkAndFixWithPreferNullishOverOr(node, description, equals) { + if (!isTruthinessCheckEligibleForPreferNullish({ + node, + testNode: node.left, + })) { + return; + } + if (ignoreMixedLogicalExpressions === true && + isMixedLogicalExpression(node)) { + return; + } + const barBarOperator = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.left, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === node.operator), util_1.NullThrowsReasons.MissingToken('operator', node.type)); + function* fix(fixer) { + if ((0, util_1.isLogicalOrOperator)(node.parent)) { + // '&&' and '??' operations cannot be mixed without parentheses (e.g. a && b ?? c) + if (node.left.type === utils_1.AST_NODE_TYPES.LogicalExpression && + !(0, util_1.isLogicalOrOperator)(node.left.left)) { + yield fixer.insertTextBefore(node.left.right, '('); + } + else { + yield fixer.insertTextBefore(node.left, '('); + } + yield fixer.insertTextAfter(node.right, ')'); + } + yield fixer.replaceText(barBarOperator, node.operator.replace('||', '??')); + } + context.report({ + node: barBarOperator, + messageId: 'preferNullishOverOr', + data: { description, equals }, + suggest: [ + { + messageId: 'suggestNullish', + data: { equals }, + fix, + }, + ], + }); + } + function getNullishCoalescingParams(node, nonNullishNode, nodesInsideTestExpression, operator) { + let nullishCoalescingLeftNode; + let hasTruthinessCheck = false; + let hasNullCheckWithoutTruthinessCheck = false; + let hasUndefinedCheckWithoutTruthinessCheck = false; + if (!nodesInsideTestExpression.length) { + hasTruthinessCheck = true; + nullishCoalescingLeftNode = + node.test.type === utils_1.AST_NODE_TYPES.UnaryExpression + ? node.test.argument + : node.test; + if (!areNodesSimilarMemberAccess(nullishCoalescingLeftNode, nonNullishNode)) { + return { isFixable: false }; + } + } + else { + // we check that the test only contains null, undefined and the identifier + for (const testNode of nodesInsideTestExpression) { + if ((0, util_1.isNullLiteral)(testNode)) { + hasNullCheckWithoutTruthinessCheck = true; + } + else if ((0, util_1.isUndefinedIdentifier)(testNode)) { + hasUndefinedCheckWithoutTruthinessCheck = true; + } + else if (areNodesSimilarMemberAccess(testNode, nonNullishNode)) { + // Only consider the first expression in a multi-part nullish check, + // as subsequent expressions might not require all the optional chaining operators. + // For example: a?.b?.c !== undefined && a.b.c !== null ? a.b.c : 'foo'; + // This works because `node.test` is always evaluated first in the loop + // and has the same or more necessary optional chaining operators + // than `node.alternate` or `node.consequent`. + nullishCoalescingLeftNode ??= testNode; + } + else { + return { isFixable: false }; + } + } + } + if (!nullishCoalescingLeftNode) { + return { isFixable: false }; + } + const isFixable = (() => { + if (hasTruthinessCheck) { + return isTruthinessCheckEligibleForPreferNullish({ + node, + testNode: nullishCoalescingLeftNode, + }); + } + // it is fixable if we check for both null and undefined, or not if neither + if (hasUndefinedCheckWithoutTruthinessCheck === + hasNullCheckWithoutTruthinessCheck) { + return hasUndefinedCheckWithoutTruthinessCheck; + } + // it is fixable if we loosely check for either null or undefined + if (['==', '!='].includes(operator)) { + return true; + } + const type = parserServices.getTypeAtLocation(nullishCoalescingLeftNode); + const flags = (0, util_1.getTypeFlags)(type); + if (flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return false; + } + const hasNullType = (flags & ts.TypeFlags.Null) !== 0; + // it is fixable if we check for undefined and the type is not nullable + if (hasUndefinedCheckWithoutTruthinessCheck && !hasNullType) { + return true; + } + const hasUndefinedType = (flags & ts.TypeFlags.Undefined) !== 0; + // it is fixable if we check for null and the type can't be undefined + return hasNullCheckWithoutTruthinessCheck && !hasUndefinedType; + })(); + return isFixable + ? { isFixable: true, nullishCoalescingLeftNode } + : { isFixable: false }; + } + return { + 'AssignmentExpression[operator = "||="]'(node) { + checkAndFixWithPreferNullishOverOr(node, 'assignment', '='); + }, + ConditionalExpression(node) { + if (ignoreTernaryTests) { + return; + } + const { nodesInsideTestExpression, operator } = getOperatorAndNodesInsideTestExpression(node); + if (operator == null) { + return; + } + const { nonNullishBranch, nullishBranch } = getBranchNodes(node, operator); + const nullishCoalescingParams = getNullishCoalescingParams(node, nonNullishBranch, nodesInsideTestExpression, operator); + if (nullishCoalescingParams.isFixable) { + context.report({ + node, + messageId: 'preferNullishOverTernary', + // TODO: also account for = in the ternary clause + data: { equals: '' }, + suggest: [ + { + messageId: 'suggestNullish', + data: { equals: '' }, + fix(fixer) { + const nullishBranchText = (0, util_1.getTextWithParentheses)(context.sourceCode, nullishBranch); + const rightOperandReplacement = (0, util_1.isParenthesized)(nullishBranch, context.sourceCode) + ? nullishBranchText + : (0, getWrappedCode_1.getWrappedCode)(nullishBranchText, (0, util_1.getOperatorPrecedenceForNode)(nullishBranch), util_1.OperatorPrecedence.Coalesce); + return fixer.replaceText(node, `${(0, util_1.getTextWithParentheses)(context.sourceCode, nullishCoalescingParams.nullishCoalescingLeftNode)} ?? ${rightOperandReplacement}`); + }, + }, + ], + }); + } + }, + IfStatement(node) { + if (ignoreIfStatements || node.alternate != null) { + return; + } + let assignmentExpression; + if (node.consequent.type === utils_1.AST_NODE_TYPES.BlockStatement && + node.consequent.body.length === 1 && + node.consequent.body[0].type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + assignmentExpression = node.consequent.body[0].expression; + } + else if (node.consequent.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + assignmentExpression = node.consequent.expression; + } + if (assignmentExpression?.type !== utils_1.AST_NODE_TYPES.AssignmentExpression || + !isMemberAccessLike(assignmentExpression.left)) { + return; + } + const nullishCoalescingLeftNode = assignmentExpression.left; + const nullishCoalescingRightNode = assignmentExpression.right; + const { nodesInsideTestExpression, operator } = getOperatorAndNodesInsideTestExpression(node); + if (operator == null || !['!', '==', '==='].includes(operator)) { + return; + } + const nullishCoalescingParams = getNullishCoalescingParams(node, nullishCoalescingLeftNode, nodesInsideTestExpression, operator); + if (nullishCoalescingParams.isFixable) { + // Handle comments + const isConsequentNodeBlockStatement = node.consequent.type === utils_1.AST_NODE_TYPES.BlockStatement; + const commentsBefore = formatComments(context.sourceCode.getCommentsBefore(assignmentExpression), isConsequentNodeBlockStatement ? '\n' : ' '); + const commentsAfter = isConsequentNodeBlockStatement + ? formatComments(context.sourceCode.getCommentsAfter(assignmentExpression.parent), '\n') + : ''; + context.report({ + node, + messageId: 'preferNullishOverAssignment', + data: { equals: '=' }, + suggest: [ + { + messageId: 'suggestNullish', + data: { equals: '=' }, + fix(fixer) { + const fixes = []; + if (commentsBefore) { + fixes.push(fixer.insertTextBefore(node, commentsBefore)); + } + fixes.push(fixer.replaceText(node, `${(0, util_1.getTextWithParentheses)(context.sourceCode, nullishCoalescingLeftNode)} ??= ${(0, util_1.getTextWithParentheses)(context.sourceCode, nullishCoalescingRightNode)};`)); + if (commentsAfter) { + fixes.push(fixer.insertTextAfter(node, ` ${commentsAfter.slice(0, -1)}`)); + } + return fixes; + }, + }, + ], + }); + } + }, + 'LogicalExpression[operator = "||"]'(node) { + checkAndFixWithPreferNullishOverOr(node, 'or', ''); + }, + }; + }, +}); +function isConditionalTest(node) { + const parent = node.parent; + if (parent == null) { + return false; + } + if (parent.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + return isConditionalTest(parent); + } + if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression && + (parent.consequent === node || parent.alternate === node)) { + return isConditionalTest(parent); + } + if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression && + parent.expressions.at(-1) === node) { + return isConditionalTest(parent); + } + if (parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + parent.operator === '!') { + return isConditionalTest(parent); + } + if ((parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression || + parent.type === utils_1.AST_NODE_TYPES.DoWhileStatement || + parent.type === utils_1.AST_NODE_TYPES.IfStatement || + parent.type === utils_1.AST_NODE_TYPES.ForStatement || + parent.type === utils_1.AST_NODE_TYPES.WhileStatement) && + parent.test === node) { + return true; + } + return false; +} +function isBooleanConstructorContext(node, context) { + const parent = node.parent; + if (parent == null) { + return false; + } + if (parent.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + return isBooleanConstructorContext(parent, context); + } + if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression && + (parent.consequent === node || parent.alternate === node)) { + return isBooleanConstructorContext(parent, context); + } + if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression && + parent.expressions.at(-1) === node) { + return isBooleanConstructorContext(parent, context); + } + return isBuiltInBooleanCall(parent, context); +} +function isBuiltInBooleanCall(node, context) { + if (node.type === utils_1.AST_NODE_TYPES.CallExpression && + node.callee.type === utils_1.AST_NODE_TYPES.Identifier && + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + node.callee.name === 'Boolean' && + node.arguments[0]) { + const scope = context.sourceCode.getScope(node); + const variable = scope.set.get(utils_1.AST_TOKEN_TYPES.Boolean); + return variable == null || variable.defs.length === 0; + } + return false; +} +function isMixedLogicalExpression(node) { + const seen = new Set(); + const queue = [node.parent, node.left, node.right]; + for (const current of queue) { + if (seen.has(current)) { + continue; + } + seen.add(current); + if (current.type === utils_1.AST_NODE_TYPES.LogicalExpression) { + if (current.operator === '&&') { + return true; + } + if (['||', '||='].includes(current.operator)) { + // check the pieces of the node to catch cases like `a || b || c && d` + queue.push(current.parent, current.left, current.right); + } + } + } + return false; +} +/** + * Checks if two TSESTree nodes have the same member access sequence, + * regardless of optional chaining differences. + * + * Note: This does not imply that the nodes are runtime-equivalent. + * + * Example: `a.b.c`, `a?.b.c`, `a.b?.c`, `(a?.b).c`, `(a.b)?.c` are considered similar. + * + * @param a First TSESTree node. + * @param b Second TSESTree node. + * @returns `true` if the nodes access members in the same order; otherwise, `false`. + */ +function areNodesSimilarMemberAccess(a, b) { + if (a.type === utils_1.AST_NODE_TYPES.MemberExpression && + b.type === utils_1.AST_NODE_TYPES.MemberExpression) { + if (!areNodesSimilarMemberAccess(a.object, b.object)) { + return false; + } + if (a.computed === b.computed) { + return (0, util_1.isNodeEqual)(a.property, b.property); + } + if (a.property.type === utils_1.AST_NODE_TYPES.Literal && + b.property.type === utils_1.AST_NODE_TYPES.Identifier) { + return a.property.value === b.property.name; + } + if (a.property.type === utils_1.AST_NODE_TYPES.Identifier && + b.property.type === utils_1.AST_NODE_TYPES.Literal) { + return a.property.name === b.property.value; + } + return false; + } + if (a.type === utils_1.AST_NODE_TYPES.ChainExpression || + b.type === utils_1.AST_NODE_TYPES.ChainExpression) { + return areNodesSimilarMemberAccess((0, util_1.skipChainExpression)(a), (0, util_1.skipChainExpression)(b)); + } + return (0, util_1.isNodeEqual)(a, b); +} +/** + * Returns the branch nodes of a conditional expression: + * - the "nonNullish branch" is the branch when test node is not nullish + * - the "nullish branch" is the branch when test node is nullish + */ +function getBranchNodes(node, operator) { + if (['', '!=', '!=='].includes(operator)) { + return { nonNullishBranch: node.consequent, nullishBranch: node.alternate }; + } + return { nonNullishBranch: node.alternate, nullishBranch: node.consequent }; +} +function getOperatorAndNodesInsideTestExpression(node) { + let operator = null; + let nodesInsideTestExpression = []; + if (isMemberAccessLike(node.test) || + node.test.type === utils_1.AST_NODE_TYPES.UnaryExpression) { + operator = getNonBinaryNodeOperator(node.test); + } + else if (node.test.type === utils_1.AST_NODE_TYPES.BinaryExpression) { + nodesInsideTestExpression = [node.test.left, node.test.right]; + if (node.test.operator === '==' || + node.test.operator === '!=' || + node.test.operator === '===' || + node.test.operator === '!==') { + operator = node.test.operator; + } + } + else if (node.test.type === utils_1.AST_NODE_TYPES.LogicalExpression && + node.test.left.type === utils_1.AST_NODE_TYPES.BinaryExpression && + node.test.right.type === utils_1.AST_NODE_TYPES.BinaryExpression) { + if (isNodeNullishComparison(node.test.left) || + isNodeNullishComparison(node.test.right)) { + return { nodesInsideTestExpression, operator }; + } + nodesInsideTestExpression = [ + node.test.left.left, + node.test.left.right, + node.test.right.left, + node.test.right.right, + ]; + if (['||', '||='].includes(node.test.operator)) { + if (node.test.left.operator === '===' && + node.test.right.operator === '===') { + operator = '==='; + } + else if (((node.test.left.operator === '===' || + node.test.right.operator === '===') && + (node.test.left.operator === '==' || + node.test.right.operator === '==')) || + (node.test.left.operator === '==' && node.test.right.operator === '==')) { + operator = '=='; + } + } + else if (node.test.operator === '&&') { + if (node.test.left.operator === '!==' && + node.test.right.operator === '!==') { + operator = '!=='; + } + else if (((node.test.left.operator === '!==' || + node.test.right.operator === '!==') && + (node.test.left.operator === '!=' || + node.test.right.operator === '!=')) || + (node.test.left.operator === '!=' && node.test.right.operator === '!=')) { + operator = '!='; + } + } + } + return { nodesInsideTestExpression, operator }; +} +function getNonBinaryNodeOperator(node) { + if (node.type !== utils_1.AST_NODE_TYPES.UnaryExpression) { + return ''; + } + if (isMemberAccessLike(node.argument) && node.operator === '!') { + return '!'; + } + return null; +} +function formatComments(comments, separator) { + return comments + .map(({ type, value }) => type === utils_1.AST_TOKEN_TYPES.Line + ? `//${value}${separator}` + : `/*${value}*/${separator}`) + .join(''); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..26bb56f7ed80c2f1bb50525dd2d101cae24c8d2e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.d.ts @@ -0,0 +1,11 @@ +export type PreferOptionalChainMessageIds = 'optionalChainSuggest' | 'preferOptionalChain'; +export interface PreferOptionalChainOptions { + allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing?: boolean; + checkAny?: boolean; + checkBigInt?: boolean; + checkBoolean?: boolean; + checkNumber?: boolean; + checkString?: boolean; + checkUnknown?: boolean; + requireNullish?: boolean; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/PreferOptionalChainOptions.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5e3a9a4ea0d3d4a8566810fde7236cfba0470bd8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.d.ts @@ -0,0 +1,7 @@ +import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils'; +import type { RuleContext } from '@typescript-eslint/utils/ts-eslint'; +import type { LastChainOperand, ValidOperand } from './gatherLogicalOperands'; +import type { PreferOptionalChainMessageIds, PreferOptionalChainOptions } from './PreferOptionalChainOptions'; +export declare function analyzeChain(context: RuleContext, parserServices: ParserServicesWithTypeInformation, options: PreferOptionalChainOptions, node: TSESTree.Node, operator: TSESTree.LogicalExpression['operator'], chain: ValidOperand[], lastChainOperand?: LastChainOperand): void; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.js new file mode 100644 index 0000000000000000000000000000000000000000..c58e040628aced2c5f4a510493b48a23a6eddf4a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/analyzeChain.js @@ -0,0 +1,612 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.analyzeChain = analyzeChain; +const utils_1 = require("@typescript-eslint/utils"); +const ts_api_utils_1 = require("ts-api-utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../../util"); +const checkNullishAndReport_1 = require("./checkNullishAndReport"); +const compareNodes_1 = require("./compareNodes"); +const gatherLogicalOperands_1 = require("./gatherLogicalOperands"); +function includesType(parserServices, node, typeFlagIn) { + const typeFlag = typeFlagIn | ts.TypeFlags.Any | ts.TypeFlags.Unknown; + const types = (0, ts_api_utils_1.unionConstituents)(parserServices.getTypeAtLocation(node)); + for (const type of types) { + if ((0, util_1.isTypeFlagSet)(type, typeFlag)) { + return true; + } + } + return false; +} +function isValidAndLastChainOperand(ComparisonValueType, comparisonType, parserServices) { + const type = parserServices.getTypeAtLocation(ComparisonValueType); + const ANY_UNKNOWN_FLAGS = ts.TypeFlags.Any | ts.TypeFlags.Unknown; + const types = (0, ts_api_utils_1.unionConstituents)(type); + switch (comparisonType) { + case gatherLogicalOperands_1.ComparisonType.Equal: { + const isNullish = types.some(t => (0, util_1.isTypeFlagSet)(t, ANY_UNKNOWN_FLAGS | ts.TypeFlags.Null | ts.TypeFlags.Undefined)); + return !isNullish; + } + case gatherLogicalOperands_1.ComparisonType.StrictEqual: { + const isUndefined = types.some(t => (0, util_1.isTypeFlagSet)(t, ANY_UNKNOWN_FLAGS | ts.TypeFlags.Undefined)); + return !isUndefined; + } + case gatherLogicalOperands_1.ComparisonType.NotStrictEqual: { + return types.every(t => (0, util_1.isTypeFlagSet)(t, ts.TypeFlags.Undefined)); + } + case gatherLogicalOperands_1.ComparisonType.NotEqual: { + return types.every(t => (0, util_1.isTypeFlagSet)(t, ts.TypeFlags.Undefined | ts.TypeFlags.Null)); + } + } +} +function isValidOrLastChainOperand(ComparisonValueType, comparisonType, parserServices) { + const type = parserServices.getTypeAtLocation(ComparisonValueType); + const ANY_UNKNOWN_FLAGS = ts.TypeFlags.Any | ts.TypeFlags.Unknown; + const types = (0, ts_api_utils_1.unionConstituents)(type); + switch (comparisonType) { + case gatherLogicalOperands_1.ComparisonType.NotEqual: { + const isNullish = types.some(t => (0, util_1.isTypeFlagSet)(t, ANY_UNKNOWN_FLAGS | ts.TypeFlags.Null | ts.TypeFlags.Undefined)); + return !isNullish; + } + case gatherLogicalOperands_1.ComparisonType.NotStrictEqual: { + const isUndefined = types.some(t => (0, util_1.isTypeFlagSet)(t, ANY_UNKNOWN_FLAGS | ts.TypeFlags.Undefined)); + return !isUndefined; + } + case gatherLogicalOperands_1.ComparisonType.Equal: + return types.every(t => (0, util_1.isTypeFlagSet)(t, ts.TypeFlags.Undefined | ts.TypeFlags.Null)); + case gatherLogicalOperands_1.ComparisonType.StrictEqual: + return types.every(t => (0, util_1.isTypeFlagSet)(t, ts.TypeFlags.Undefined)); + } +} +const analyzeAndChainOperand = (parserServices, operand, index, chain) => { + switch (operand.comparisonType) { + case gatherLogicalOperands_1.NullishComparisonType.Boolean: + case gatherLogicalOperands_1.NullishComparisonType.NotEqualNullOrUndefined: + return [operand]; + case gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualNull: { + // handle `x !== null && x !== undefined` + const nextOperand = chain.at(index + 1); + if (nextOperand?.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualUndefined && + (0, compareNodes_1.compareNodes)(operand.comparedName, nextOperand.comparedName) === + compareNodes_1.NodeComparisonResult.Equal) { + return [operand, nextOperand]; + } + if (nextOperand && + !includesType(parserServices, operand.comparedName, ts.TypeFlags.Undefined)) { + // we know the next operand is not an `undefined` check and that this + // operand includes `undefined` - which means that making this an + // optional chain would change the runtime behavior of the expression + return [operand]; + } + return null; + } + case gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualUndefined: { + // handle `x !== undefined && x !== null` + const nextOperand = chain.at(index + 1); + if (nextOperand?.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualNull && + (0, compareNodes_1.compareNodes)(operand.comparedName, nextOperand.comparedName) === + compareNodes_1.NodeComparisonResult.Equal) { + return [operand, nextOperand]; + } + if (includesType(parserServices, operand.comparedName, ts.TypeFlags.Null)) { + // we know the next operand is not a `null` check and that this + // operand includes `null` - which means that making this an + // optional chain would change the runtime behavior of the expression + return null; + } + return [operand]; + } + default: + return null; + } +}; +const analyzeOrChainOperand = (parserServices, operand, index, chain) => { + switch (operand.comparisonType) { + case gatherLogicalOperands_1.NullishComparisonType.NotBoolean: + case gatherLogicalOperands_1.NullishComparisonType.EqualNullOrUndefined: + return [operand]; + case gatherLogicalOperands_1.NullishComparisonType.StrictEqualNull: { + // handle `x === null || x === undefined` + const nextOperand = chain.at(index + 1); + if (nextOperand?.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.StrictEqualUndefined && + (0, compareNodes_1.compareNodes)(operand.comparedName, nextOperand.comparedName) === + compareNodes_1.NodeComparisonResult.Equal) { + return [operand, nextOperand]; + } + if (includesType(parserServices, operand.comparedName, ts.TypeFlags.Undefined)) { + // we know the next operand is not an `undefined` check and that this + // operand includes `undefined` - which means that making this an + // optional chain would change the runtime behavior of the expression + return null; + } + return [operand]; + } + case gatherLogicalOperands_1.NullishComparisonType.StrictEqualUndefined: { + // handle `x === undefined || x === null` + const nextOperand = chain.at(index + 1); + if (nextOperand?.comparisonType === gatherLogicalOperands_1.NullishComparisonType.StrictEqualNull && + (0, compareNodes_1.compareNodes)(operand.comparedName, nextOperand.comparedName) === + compareNodes_1.NodeComparisonResult.Equal) { + return [operand, nextOperand]; + } + if (includesType(parserServices, operand.comparedName, ts.TypeFlags.Null)) { + // we know the next operand is not a `null` check and that this + // operand includes `null` - which means that making this an + // optional chain would change the runtime behavior of the expression + return null; + } + return [operand]; + } + default: + return null; + } +}; +const resolveOperandSubset = (previousOperand, lastChainOperand) => { + const isNameSubset = (0, compareNodes_1.compareNodes)(previousOperand.comparedName, lastChainOperand.comparedName) === compareNodes_1.NodeComparisonResult.Subset; + if (lastChainOperand.yoda !== gatherLogicalOperands_1.Yoda.Unknown) { + return { + comparedName: lastChainOperand.comparedName, + comparisonValue: lastChainOperand.comparisonValue, + isSubset: isNameSubset, + isYoda: lastChainOperand.yoda === gatherLogicalOperands_1.Yoda.Yes, + }; + } + const isValueSubset = (0, compareNodes_1.compareNodes)(previousOperand.comparedName, lastChainOperand.comparisonValue) === compareNodes_1.NodeComparisonResult.Subset; + if (isNameSubset && !isValueSubset) { + return { + comparedName: lastChainOperand.comparedName, + comparisonValue: lastChainOperand.comparisonValue, + isSubset: true, + isYoda: false, + }; + } + if (!isNameSubset && isValueSubset) { + return { + comparedName: lastChainOperand.comparisonValue, + comparisonValue: lastChainOperand.comparedName, + isSubset: true, + isYoda: true, + }; + } + return { + comparedName: lastChainOperand.comparisonValue, + comparisonValue: lastChainOperand.comparisonValue, + isSubset: false, + isYoda: true, + }; +}; +/** + * Returns the range that needs to be reported from the chain. + * @param chain The chain of logical expressions. + * @param boundary The boundary range that the range to report cannot fall outside. + * @param sourceCode The source code to get tokens. + * @returns The range to report. + */ +function getReportRange(chain, boundary, sourceCode) { + const leftNode = chain[0].node; + const rightNode = chain[chain.length - 1].node; + let leftMost = (0, util_1.nullThrows)(sourceCode.getFirstToken(leftNode), util_1.NullThrowsReasons.MissingToken('any token', leftNode.type)); + let rightMost = (0, util_1.nullThrows)(sourceCode.getLastToken(rightNode), util_1.NullThrowsReasons.MissingToken('any token', rightNode.type)); + while (leftMost.range[0] > boundary[0]) { + const token = sourceCode.getTokenBefore(leftMost); + if (!token || !(0, util_1.isOpeningParenToken)(token) || token.range[0] < boundary[0]) { + break; + } + leftMost = token; + } + while (rightMost.range[1] < boundary[1]) { + const token = sourceCode.getTokenAfter(rightMost); + if (!token || !(0, util_1.isClosingParenToken)(token) || token.range[1] > boundary[1]) { + break; + } + rightMost = token; + } + return [leftMost.range[0], rightMost.range[1]]; +} +function getReportDescriptor(sourceCode, parserServices, node, operator, options, subChain, lastChain) { + const chain = lastChain ? [...subChain, lastChain] : subChain; + const lastOperand = chain[chain.length - 1]; + let useSuggestionFixer; + if (options.allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing === + true) { + // user has opted-in to the unsafe behavior + useSuggestionFixer = false; + } + // optional chain specifically will union `undefined` into the final type + // so we need to make sure that there is at least one operand that includes + // `undefined`, or else we're going to change the final type - which is + // unsafe and might cause downstream type errors. + else if (lastChain || + lastOperand.comparisonType === gatherLogicalOperands_1.NullishComparisonType.EqualNullOrUndefined || + lastOperand.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.NotEqualNullOrUndefined || + lastOperand.comparisonType === gatherLogicalOperands_1.NullishComparisonType.StrictEqualUndefined || + lastOperand.comparisonType === + gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualUndefined || + (operator === '||' && + lastOperand.comparisonType === gatherLogicalOperands_1.NullishComparisonType.NotBoolean)) { + // we know the last operand is an equality check - so the change in types + // DOES NOT matter and will not change the runtime result or cause a type + // check error + useSuggestionFixer = false; + } + else { + useSuggestionFixer = true; + for (const operand of chain) { + if (includesType(parserServices, operand.node, ts.TypeFlags.Undefined)) { + useSuggestionFixer = false; + break; + } + } + // TODO - we could further reduce the false-positive rate of this check by + // checking for cases where the change in types don't matter like + // the test location of an if/while/etc statement. + // but it's quite complex to do this without false-negatives, so + // for now we'll just be over-eager with our matching. + // + // it's MUCH better to false-positive here and only provide a + // suggestion fixer, rather than false-negative and autofix to + // broken code. + } + // In its most naive form we could just slap `?.` for every single part of the + // chain. However this would be undesirable because it'd create unnecessary + // conditions in the user's code where there were none before - and it would + // cause errors with rules like our `no-unnecessary-condition`. + // + // Instead we want to include the minimum number of `?.` required to correctly + // unify the code into a single chain. Naively you might think that we can + // just take the final operand add `?.` after the locations from the previous + // operands - however this won't be correct either because earlier operands + // can include a necessary `?.` that's not needed or included in a later + // operand. + // + // So instead what we need to do is to start at the first operand and + // iteratively diff it against the next operand, and add the difference to the + // first operand. + // + // eg + // `foo && foo.bar && foo.bar.baz?.bam && foo.bar.baz.bam()` + // 1) `foo` + // 2) diff(`foo`, `foo.bar`) = `.bar` + // 3) result = `foo?.bar` + // 4) diff(`foo.bar`, `foo.bar.baz?.bam`) = `.baz?.bam` + // 5) result = `foo?.bar?.baz?.bam` + // 6) diff(`foo.bar.baz?.bam`, `foo.bar.baz.bam()`) = `()` + // 7) result = `foo?.bar?.baz?.bam?.()` + const parts = []; + for (const current of chain) { + const nextOperand = flattenChainExpression(sourceCode, current.comparedName); + const diff = nextOperand.slice(parts.length); + if (diff.length > 0) { + if (parts.length > 0) { + // we need to make the first operand of the diff optional so it matches the + // logic before merging + // foo.bar && foo.bar.baz + // diff = .baz + // result = foo.bar?.baz + diff[0].optional = true; + } + parts.push(...diff); + } + } + let newCode = parts + .map(part => { + let str = ''; + if (part.optional) { + str += '?.'; + } + else { + if (part.nonNull) { + str += '!'; + } + if (part.requiresDot) { + str += '.'; + } + } + if (part.precedence !== util_1.OperatorPrecedence.Invalid && + part.precedence < util_1.OperatorPrecedence.Member) { + str += `(${part.text})`; + } + else { + str += part.text; + } + return str; + }) + .join(''); + if (lastOperand.node.type === utils_1.AST_NODE_TYPES.BinaryExpression) { + // retain the ending comparison for cases like + // x && x.a != null + // x && typeof x.a !== 'undefined' + const operator = lastOperand.node.operator; + const { left, right } = (() => { + if (lastOperand.isYoda) { + const unaryOperator = lastOperand.node.right.type === utils_1.AST_NODE_TYPES.UnaryExpression + ? `${lastOperand.node.right.operator} ` + : ''; + return { + left: sourceCode.getText(lastOperand.node.left), + right: unaryOperator + newCode, + }; + } + const unaryOperator = lastOperand.node.left.type === utils_1.AST_NODE_TYPES.UnaryExpression + ? `${lastOperand.node.left.operator} ` + : ''; + return { + left: unaryOperator + newCode, + right: sourceCode.getText(lastOperand.node.right), + }; + })(); + newCode = `${left} ${operator} ${right}`; + } + else if (lastOperand.comparisonType === gatherLogicalOperands_1.NullishComparisonType.NotBoolean) { + newCode = `!${newCode}`; + } + const reportRange = getReportRange(chain, node.range, sourceCode); + const fix = fixer => { + let unclosedParens = 0; + const tokensInRange = sourceCode.getTokens(node, { + filter: token => token.range[0] >= reportRange[0] && token.range[1] <= reportRange[1], + }); + for (const token of tokensInRange) { + if ((0, util_1.isOpeningParenToken)(token)) { + unclosedParens++; + } + else if ((0, util_1.isClosingParenToken)(token)) { + unclosedParens--; + } + } + if (unclosedParens > 0 && reportRange[1] < node.range[1]) { + const openParensOutsideRange = []; + const unmatchedCloseParens = []; + const tokensOutRange = sourceCode.getTokens(node, { + filter: token => token.range[1] > reportRange[1], + }); + for (const token of tokensOutRange) { + if ((0, util_1.isOpeningParenToken)(token)) { + openParensOutsideRange.push(token.range[0]); + } + if ((0, util_1.isClosingParenToken)(token)) { + if (openParensOutsideRange.length > 0) { + openParensOutsideRange.pop(); + } + else { + unmatchedCloseParens.push(token.range[0]); + } + } + } + let leftCode = sourceCode.getText(node); + unmatchedCloseParens.reverse(); + for (const unmatchedParenIndex of unmatchedCloseParens) { + leftCode = + leftCode.slice(0, unmatchedParenIndex) + + leftCode.slice(unmatchedParenIndex + 1); + } + leftCode = leftCode.slice(reportRange[1]); + return fixer.replaceTextRange(node.range, newCode + leftCode); + } + return fixer.replaceTextRange(reportRange, newCode); + }; + return { + loc: { + end: sourceCode.getLocFromIndex(reportRange[1]), + start: sourceCode.getLocFromIndex(reportRange[0]), + }, + messageId: 'preferOptionalChain', + ...(0, util_1.getFixOrSuggest)({ + fixOrSuggest: useSuggestionFixer ? 'suggest' : 'fix', + suggestion: { + fix, + messageId: 'optionalChainSuggest', + }, + }), + }; + function flattenChainExpression(sourceCode, node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.ChainExpression: + return flattenChainExpression(sourceCode, node.expression); + case utils_1.AST_NODE_TYPES.CallExpression: { + const argumentsText = (() => { + const closingParenToken = (0, util_1.nullThrows)(sourceCode.getLastToken(node), util_1.NullThrowsReasons.MissingToken('closing parenthesis', node.type)); + const openingParenToken = (0, util_1.nullThrows)(sourceCode.getFirstTokenBetween(node.typeArguments ?? node.callee, closingParenToken, util_1.isOpeningParenToken), util_1.NullThrowsReasons.MissingToken('opening parenthesis', node.type)); + return sourceCode.text.substring(openingParenToken.range[0], closingParenToken.range[1]); + })(); + const typeArgumentsText = (() => { + if (node.typeArguments == null) { + return ''; + } + return sourceCode.getText(node.typeArguments); + })(); + return [ + ...flattenChainExpression(sourceCode, node.callee), + { + nonNull: false, + optional: node.optional, + // no precedence for this + precedence: util_1.OperatorPrecedence.Invalid, + requiresDot: false, + text: typeArgumentsText + argumentsText, + }, + ]; + } + case utils_1.AST_NODE_TYPES.MemberExpression: { + const propertyText = sourceCode.getText(node.property); + return [ + ...flattenChainExpression(sourceCode, node.object), + { + nonNull: node.object.type === utils_1.AST_NODE_TYPES.TSNonNullExpression, + optional: node.optional, + precedence: node.computed + ? // computed is already wrapped in [] so no need to wrap in () as well + util_1.OperatorPrecedence.Invalid + : (0, util_1.getOperatorPrecedenceForNode)(node.property), + requiresDot: !node.computed, + text: node.computed ? `[${propertyText}]` : propertyText, + }, + ]; + } + case utils_1.AST_NODE_TYPES.TSNonNullExpression: + return flattenChainExpression(sourceCode, node.expression); + default: + return [ + { + nonNull: false, + optional: false, + precedence: (0, util_1.getOperatorPrecedenceForNode)(node), + requiresDot: false, + text: sourceCode.getText(node), + }, + ]; + } + } +} +function analyzeChain(context, parserServices, options, node, operator, chain, lastChainOperand) { + // need at least 2 operands in a chain for it to be a chain + if (chain.length + (lastChainOperand ? 1 : 0) <= 1 || + /* istanbul ignore next -- previous checks make this unreachable, but keep it for exhaustiveness check */ + operator === '??') { + return; + } + const analyzeOperand = (() => { + switch (operator) { + case '&&': + return analyzeAndChainOperand; + case '||': + return analyzeOrChainOperand; + } + })(); + // Things like x !== null && x !== undefined have two nodes, but they are + // one logical unit here, so we'll allow them to be grouped. + let subChain = []; + let lastChain = undefined; + const maybeReportThenReset = (newChainSeed) => { + if (subChain.length + (lastChain ? 1 : 0) > 1) { + const subChainFlat = subChain.flat(); + const maybeNullishNodes = lastChain + ? subChainFlat.map(({ node }) => node) + : subChainFlat.slice(0, -1).map(({ node }) => node); + (0, checkNullishAndReport_1.checkNullishAndReport)(context, parserServices, options, maybeNullishNodes, getReportDescriptor(context.sourceCode, parserServices, node, operator, options, subChainFlat, lastChain)); + } + // we've reached the end of a chain of logical expressions + // i.e. the current operand doesn't belong to the previous chain. + // + // we don't want to throw away the current operand otherwise we will skip it + // and that can cause us to miss chains. So instead we seed the new chain + // with the current operand + // + // eg this means we can catch cases like: + // unrelated != null && foo != null && foo.bar != null; + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ first "chain" + // ^^^^^^^^^^^ newChainSeed + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ second chain + subChain = newChainSeed ? [newChainSeed] : []; + lastChain = undefined; + }; + for (let i = 0; i < chain.length; i += 1) { + const lastOperand = subChain.flat().at(-1); + const operand = chain[i]; + const validatedOperands = analyzeOperand(parserServices, operand, i, chain); + if (!validatedOperands) { + // TODO - #7170 + // check if the name is a superset/equal - if it is, then it likely + // intended to be part of the chain and something we should include in the + // report, eg + // foo == null || foo.bar; + // ^^^^^^^^^^^ valid OR chain + // ^^^^^^^ invalid OR chain logical, but still part of + // the chain for combination purposes + if (lastOperand) { + const comparisonResult = (0, compareNodes_1.compareNodes)(lastOperand.comparedName, operand.comparedName); + switch (operand.comparisonType) { + case gatherLogicalOperands_1.NullishComparisonType.StrictEqualUndefined: + case gatherLogicalOperands_1.NullishComparisonType.NotStrictEqualUndefined: { + if (comparisonResult === compareNodes_1.NodeComparisonResult.Subset) { + lastChain = operand; + } + break; + } + } + } + maybeReportThenReset(); + continue; + } + // in case multiple operands were consumed - make sure to correctly increment the index + i += validatedOperands.length - 1; + const currentOperand = validatedOperands[0]; + if (lastOperand) { + const comparisonResult = (0, compareNodes_1.compareNodes)(lastOperand.comparedName, + // purposely inspect and push the last operand because the prior operands don't matter + // this also means we won't false-positive in cases like + // foo !== null && foo !== undefined + validatedOperands[validatedOperands.length - 1].comparedName); + if (comparisonResult === compareNodes_1.NodeComparisonResult.Subset) { + // the operands are comparable, so we can continue searching + subChain.push(currentOperand); + } + else if (comparisonResult === compareNodes_1.NodeComparisonResult.Invalid) { + maybeReportThenReset(validatedOperands); + } + else { + // purposely don't push this case because the node is a no-op and if + // we consider it then we might report on things like + // foo && foo + } + } + else { + subChain.push(currentOperand); + } + } + const lastOperand = subChain.flat().at(-1); + if (lastOperand && lastChainOperand) { + const isValidLastChainOperand = operator === '&&' + ? isValidAndLastChainOperand + : isValidOrLastChainOperand; + const { comparedName, comparisonValue, isSubset, isYoda } = resolveOperandSubset(lastOperand, lastChainOperand); + if (isSubset && + isValidLastChainOperand(comparisonValue, lastChainOperand.comparisonType, parserServices)) { + lastChain = { + ...lastChainOperand, + comparedName, + comparisonValue, + isYoda, + }; + } + } + // check the leftovers + maybeReportThenReset(); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..19284f7cefce92b79999a3812888fff813df7ea2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.d.ts @@ -0,0 +1,6 @@ +import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils'; +import type { ReportDescriptor, RuleContext } from '@typescript-eslint/utils/ts-eslint'; +import type { PreferOptionalChainMessageIds, PreferOptionalChainOptions } from './PreferOptionalChainOptions'; +export declare function checkNullishAndReport(context: RuleContext, parserServices: ParserServicesWithTypeInformation, { requireNullish }: PreferOptionalChainOptions, maybeNullishNodes: TSESTree.Expression[], descriptor: ReportDescriptor): void; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.js new file mode 100644 index 0000000000000000000000000000000000000000..55724e0653950ee833499d98bb38f1d1e26571e4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/checkNullishAndReport.js @@ -0,0 +1,45 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkNullishAndReport = checkNullishAndReport; +const type_utils_1 = require("@typescript-eslint/type-utils"); +const ts_api_utils_1 = require("ts-api-utils"); +const ts = __importStar(require("typescript")); +function checkNullishAndReport(context, parserServices, { requireNullish }, maybeNullishNodes, descriptor) { + if (!requireNullish || + maybeNullishNodes.some(node => (0, ts_api_utils_1.unionConstituents)(parserServices.getTypeAtLocation(node)).some(t => (0, type_utils_1.isTypeFlagSet)(t, ts.TypeFlags.Null | ts.TypeFlags.Undefined)))) { + context.report(descriptor); + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40daa8383595e0864d8b7d0828a2cf95252932d4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.d.ts @@ -0,0 +1,15 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +export declare const enum NodeComparisonResult { + /** the two nodes are comparably the same */ + Equal = "Equal", + /** the left node is a subset of the right node */ + Subset = "Subset", + /** the left node is not the same or is a superset of the right node */ + Invalid = "Invalid" +} +type CompareNodesArgument = TSESTree.Node | null | undefined; +/** + * Compares two nodes' ASTs to determine if the A is equal to or a subset of B + */ +export declare function compareNodes(nodeA: CompareNodesArgument, nodeB: CompareNodesArgument): NodeComparisonResult; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.js new file mode 100644 index 0000000000000000000000000000000000000000..8ac09efa2e81bed9837941295eb8d000db53a542 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/compareNodes.js @@ -0,0 +1,326 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.NodeComparisonResult = void 0; +exports.compareNodes = compareNodes; +const utils_1 = require("@typescript-eslint/utils"); +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +var NodeComparisonResult; +(function (NodeComparisonResult) { + /** the two nodes are comparably the same */ + NodeComparisonResult["Equal"] = "Equal"; + /** the left node is a subset of the right node */ + NodeComparisonResult["Subset"] = "Subset"; + /** the left node is not the same or is a superset of the right node */ + NodeComparisonResult["Invalid"] = "Invalid"; +})(NodeComparisonResult || (exports.NodeComparisonResult = NodeComparisonResult = {})); +function compareArrays(arrayA, arrayB) { + if (arrayA.length !== arrayB.length) { + return NodeComparisonResult.Invalid; + } + const result = arrayA.every((elA, idx) => { + const elB = arrayB[idx]; + if (elA == null || elB == null) { + return elA === elB; + } + return compareUnknownValues(elA, elB) === NodeComparisonResult.Equal; + }); + if (result) { + return NodeComparisonResult.Equal; + } + return NodeComparisonResult.Invalid; +} +function isValidNode(x) { + return (typeof x === 'object' && + x != null && + 'type' in x && + typeof x.type === 'string'); +} +function isValidChainExpressionToLookThrough(node) { + return (!(node.parent?.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.parent.object === node) && + !(node.parent?.type === utils_1.AST_NODE_TYPES.CallExpression && + node.parent.callee === node) && + node.type === utils_1.AST_NODE_TYPES.ChainExpression); +} +function compareUnknownValues(valueA, valueB) { + /* istanbul ignore if -- not possible for us to test this - it's just a sanity safeguard */ + if (valueA == null || valueB == null) { + if (valueA !== valueB) { + return NodeComparisonResult.Invalid; + } + return NodeComparisonResult.Equal; + } + /* istanbul ignore if -- not possible for us to test this - it's just a sanity safeguard */ + if (!isValidNode(valueA) || !isValidNode(valueB)) { + return NodeComparisonResult.Invalid; + } + return compareNodes(valueA, valueB); +} +function compareByVisiting(nodeA, nodeB) { + const currentVisitorKeys = visitor_keys_1.visitorKeys[nodeA.type]; + /* istanbul ignore if -- not possible for us to test this - it's just a sanity safeguard */ + if (currentVisitorKeys == null) { + // we don't know how to visit this node, so assume it's invalid to avoid false-positives / broken fixers + return NodeComparisonResult.Invalid; + } + if (currentVisitorKeys.length === 0) { + // assume nodes with no keys are constant things like keywords + return NodeComparisonResult.Equal; + } + for (const key of currentVisitorKeys) { + // @ts-expect-error - dynamic access but it's safe + const nodeAChildOrChildren = nodeA[key]; + // @ts-expect-error - dynamic access but it's safe + const nodeBChildOrChildren = nodeB[key]; + if (Array.isArray(nodeAChildOrChildren)) { + const arrayA = nodeAChildOrChildren; + const arrayB = nodeBChildOrChildren; + const result = compareArrays(arrayA, arrayB); + if (result !== NodeComparisonResult.Equal) { + return NodeComparisonResult.Invalid; + } + // fallthrough to the next key as the key was "equal" + } + else { + const result = compareUnknownValues(nodeAChildOrChildren, nodeBChildOrChildren); + if (result !== NodeComparisonResult.Equal) { + return NodeComparisonResult.Invalid; + } + // fallthrough to the next key as the key was "equal" + } + } + return NodeComparisonResult.Equal; +} +function compareNodesUncached(nodeA, nodeB) { + if (nodeA.type !== nodeB.type) { + // special cases where nodes are allowed to be non-equal + // look through a chain expression node at the top-level because it only + // exists to delimit the end of an optional chain + // + // a?.b && a.b.c + // ^^^^ ChainExpression, MemberExpression + // ^^^^^ MemberExpression + // + // except for in this class of cases + // (a?.b).c && a.b.c + // because the parentheses have runtime meaning (sad face) + if (isValidChainExpressionToLookThrough(nodeA)) { + return compareNodes(nodeA.expression, nodeB); + } + if (isValidChainExpressionToLookThrough(nodeB)) { + return compareNodes(nodeA, nodeB.expression); + } + // look through the type-only non-null assertion because its existence could + // possibly be replaced by an optional chain instead + // + // a.b! && a.b.c + // ^^^^ TSNonNullExpression + if (nodeA.type === utils_1.AST_NODE_TYPES.TSNonNullExpression) { + return compareNodes(nodeA.expression, nodeB); + } + if (nodeB.type === utils_1.AST_NODE_TYPES.TSNonNullExpression) { + return compareNodes(nodeA, nodeB.expression); + } + // special case for subset optional chains where the node types don't match, + // but we want to try comparing by discarding the "extra" code + // + // a && a.b + // ^ compare this + // a && a() + // ^ compare this + // a.b && a.b() + // ^^^ compare this + // a() && a().b + // ^^^ compare this + // import.meta && import.meta.b + // ^^^^^^^^^^^ compare this + if (nodeA.type === utils_1.AST_NODE_TYPES.CallExpression || + nodeA.type === utils_1.AST_NODE_TYPES.Identifier || + nodeA.type === utils_1.AST_NODE_TYPES.MemberExpression || + nodeA.type === utils_1.AST_NODE_TYPES.MetaProperty) { + switch (nodeB.type) { + case utils_1.AST_NODE_TYPES.MemberExpression: + if (nodeB.property.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + // Private identifiers in optional chaining is not currently allowed + // TODO - handle this once TS supports it (https://github.com/microsoft/TypeScript/issues/42734) + return NodeComparisonResult.Invalid; + } + if (compareNodes(nodeA, nodeB.object) !== NodeComparisonResult.Invalid) { + return NodeComparisonResult.Subset; + } + return NodeComparisonResult.Invalid; + case utils_1.AST_NODE_TYPES.CallExpression: + if (compareNodes(nodeA, nodeB.callee) !== NodeComparisonResult.Invalid) { + return NodeComparisonResult.Subset; + } + return NodeComparisonResult.Invalid; + default: + return NodeComparisonResult.Invalid; + } + } + return NodeComparisonResult.Invalid; + } + switch (nodeA.type) { + // these expressions create a new instance each time - so it makes no sense to compare the chain + case utils_1.AST_NODE_TYPES.ArrayExpression: + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.ClassExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: + case utils_1.AST_NODE_TYPES.JSXElement: + case utils_1.AST_NODE_TYPES.JSXFragment: + case utils_1.AST_NODE_TYPES.NewExpression: + case utils_1.AST_NODE_TYPES.ObjectExpression: + return NodeComparisonResult.Invalid; + // chaining from assignments could change the value irrevocably - so it makes no sense to compare the chain + case utils_1.AST_NODE_TYPES.AssignmentExpression: + return NodeComparisonResult.Invalid; + case utils_1.AST_NODE_TYPES.CallExpression: { + const nodeBCall = nodeB; + // check for cases like + // foo() && foo()(bar) + // ^^^^^ nodeA + // ^^^^^^^^^^ nodeB + // we don't want to check the arguments in this case + const aSubsetOfB = compareNodes(nodeA, nodeBCall.callee); + if (aSubsetOfB !== NodeComparisonResult.Invalid) { + return NodeComparisonResult.Subset; + } + const calleeCompare = compareNodes(nodeA.callee, nodeBCall.callee); + if (calleeCompare !== NodeComparisonResult.Equal) { + return NodeComparisonResult.Invalid; + } + // NOTE - we purposely ignore optional flag because for our purposes + // foo?.bar() && foo.bar?.()?.baz + // or + // foo.bar() && foo?.bar?.()?.baz + // are going to be exactly the same + const argumentCompare = compareArrays(nodeA.arguments, nodeBCall.arguments); + if (argumentCompare !== NodeComparisonResult.Equal) { + return NodeComparisonResult.Invalid; + } + const typeParamCompare = compareNodes(nodeA.typeArguments, nodeBCall.typeArguments); + if (typeParamCompare === NodeComparisonResult.Equal) { + return NodeComparisonResult.Equal; + } + return NodeComparisonResult.Invalid; + } + case utils_1.AST_NODE_TYPES.ChainExpression: + // special case handling for ChainExpression because it's allowed to be a subset + return compareNodes(nodeA, nodeB.expression); + case utils_1.AST_NODE_TYPES.Identifier: + case utils_1.AST_NODE_TYPES.PrivateIdentifier: + if (nodeA.name === nodeB.name) { + return NodeComparisonResult.Equal; + } + return NodeComparisonResult.Invalid; + case utils_1.AST_NODE_TYPES.Literal: { + const nodeBLiteral = nodeB; + if (nodeA.raw === nodeBLiteral.raw && + nodeA.value === nodeBLiteral.value) { + return NodeComparisonResult.Equal; + } + return NodeComparisonResult.Invalid; + } + case utils_1.AST_NODE_TYPES.MemberExpression: { + const nodeBMember = nodeB; + if (nodeBMember.property.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + // Private identifiers in optional chaining is not currently allowed + // TODO - handle this once TS supports it (https://github.com/microsoft/TypeScript/issues/42734) + return NodeComparisonResult.Invalid; + } + // check for cases like + // foo.bar && foo.bar.baz + // ^^^^^^^ nodeA + // ^^^^^^^^^^^ nodeB + // result === Equal + // + // foo.bar && foo.bar.baz.bam + // ^^^^^^^ nodeA + // ^^^^^^^^^^^^^^^ nodeB + // result === Subset + // + // we don't want to check the property in this case + const aSubsetOfB = compareNodes(nodeA, nodeBMember.object); + if (aSubsetOfB !== NodeComparisonResult.Invalid) { + return NodeComparisonResult.Subset; + } + if (nodeA.computed !== nodeBMember.computed) { + return NodeComparisonResult.Invalid; + } + // NOTE - we purposely ignore optional flag because for our purposes + // foo?.bar && foo.bar?.baz + // or + // foo.bar && foo?.bar?.baz + // are going to be exactly the same + const objectCompare = compareNodes(nodeA.object, nodeBMember.object); + if (objectCompare !== NodeComparisonResult.Equal) { + return NodeComparisonResult.Invalid; + } + return compareNodes(nodeA.property, nodeBMember.property); + } + case utils_1.AST_NODE_TYPES.TSTemplateLiteralType: + case utils_1.AST_NODE_TYPES.TemplateLiteral: { + const nodeBTemplate = nodeB; + const areQuasisEqual = nodeA.quasis.length === nodeBTemplate.quasis.length && + nodeA.quasis.every((elA, idx) => { + const elB = nodeBTemplate.quasis[idx]; + return elA.value.cooked === elB.value.cooked; + }); + if (!areQuasisEqual) { + return NodeComparisonResult.Invalid; + } + return NodeComparisonResult.Equal; + } + case utils_1.AST_NODE_TYPES.TemplateElement: { + const nodeBElement = nodeB; + if (nodeA.value.cooked === nodeBElement.value.cooked) { + return NodeComparisonResult.Equal; + } + return NodeComparisonResult.Invalid; + } + // these aren't actually valid expressions. + // https://github.com/typescript-eslint/typescript-eslint/blob/20d7caee35ab84ae6381fdf04338c9e2b9e2bc48/packages/ast-spec/src/unions/Expression.ts#L37-L43 + case utils_1.AST_NODE_TYPES.ArrayPattern: + case utils_1.AST_NODE_TYPES.ObjectPattern: + /* istanbul ignore next */ + return NodeComparisonResult.Invalid; + // update expression returns a number and also changes the value each time - so it makes no sense to compare the chain + case utils_1.AST_NODE_TYPES.UpdateExpression: + return NodeComparisonResult.Invalid; + // yield returns the value passed to the `next` function, so it may not be the same each time - so it makes no sense to compare the chain + case utils_1.AST_NODE_TYPES.YieldExpression: + return NodeComparisonResult.Invalid; + // general-case automatic handling of nodes to save us implementing every + // single case by hand. This just iterates the visitor keys to recursively + // check the children. + // + // Any specific logic cases or short-circuits should be listed as separate + // cases so that they don't fall into this generic handling + default: + return compareByVisiting(nodeA, nodeB); + } +} +const COMPARE_NODES_CACHE = new WeakMap(); +/** + * Compares two nodes' ASTs to determine if the A is equal to or a subset of B + */ +function compareNodes(nodeA, nodeB) { + if (nodeA == null || nodeB == null) { + if (nodeA !== nodeB) { + return NodeComparisonResult.Invalid; + } + return NodeComparisonResult.Equal; + } + const cached = COMPARE_NODES_CACHE.get(nodeA)?.get(nodeB); + if (cached) { + return cached; + } + const result = compareNodesUncached(nodeA, nodeB); + let mapA = COMPARE_NODES_CACHE.get(nodeA); + if (mapA == null) { + mapA = new WeakMap(); + COMPARE_NODES_CACHE.set(nodeA, mapA); + } + mapA.set(nodeB, result); + return result; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eb28991f8aa733b5e0c4bae84cd765ce4095e9e2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.d.ts @@ -0,0 +1,61 @@ +import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils'; +import type { SourceCode } from '@typescript-eslint/utils/ts-eslint'; +import type { PreferOptionalChainOptions } from './PreferOptionalChainOptions'; +export declare const enum Yoda { + Yes = 0, + No = 1, + Unknown = 2 +} +export declare const enum OperandValidity { + Valid = "Valid", + Last = "Last", + Invalid = "Invalid" +} +export declare const enum NullishComparisonType { + /** `x != null`, `x != undefined` */ + NotEqualNullOrUndefined = "NotEqualNullOrUndefined", + /** `x == null`, `x == undefined` */ + EqualNullOrUndefined = "EqualNullOrUndefined", + /** `x !== null` */ + NotStrictEqualNull = "NotStrictEqualNull", + /** `x === null` */ + StrictEqualNull = "StrictEqualNull", + /** `x !== undefined`, `typeof x !== 'undefined'` */ + NotStrictEqualUndefined = "NotStrictEqualUndefined", + /** `x === undefined`, `typeof x === 'undefined'` */ + StrictEqualUndefined = "StrictEqualUndefined", + /** `!x` */ + NotBoolean = "NotBoolean", + /** `x` */ + Boolean = "Boolean" +} +export declare const enum ComparisonType { + NotEqual = "NotEqual", + Equal = "Equal", + NotStrictEqual = "NotStrictEqual", + StrictEqual = "StrictEqual" +} +export interface ValidOperand { + comparedName: TSESTree.Node; + comparisonType: NullishComparisonType; + isYoda: boolean; + node: TSESTree.Expression; + type: OperandValidity.Valid; +} +export interface LastChainOperand { + comparedName: TSESTree.Node; + comparisonType: ComparisonType; + comparisonValue: TSESTree.Node; + yoda: Yoda; + node: TSESTree.BinaryExpression; + type: OperandValidity.Last; +} +export interface InvalidOperand { + type: OperandValidity.Invalid; +} +type Operand = InvalidOperand | LastChainOperand | ValidOperand; +export declare function gatherLogicalOperands(node: TSESTree.LogicalExpression, parserServices: ParserServicesWithTypeInformation, sourceCode: Readonly, options: PreferOptionalChainOptions): { + newlySeenLogicals: Set; + operands: Operand[]; +}; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.js new file mode 100644 index 0000000000000000000000000000000000000000..b3571856ec82e8770d4d43973efaa378858c4d2f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain-utils/gatherLogicalOperands.js @@ -0,0 +1,411 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ComparisonType = exports.NullishComparisonType = exports.OperandValidity = exports.Yoda = void 0; +exports.gatherLogicalOperands = gatherLogicalOperands; +const utils_1 = require("@typescript-eslint/utils"); +const ts_api_utils_1 = require("ts-api-utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../../util"); +var Yoda; +(function (Yoda) { + Yoda[Yoda["Yes"] = 0] = "Yes"; + Yoda[Yoda["No"] = 1] = "No"; + Yoda[Yoda["Unknown"] = 2] = "Unknown"; +})(Yoda || (exports.Yoda = Yoda = {})); +var ComparisonValueType; +(function (ComparisonValueType) { + ComparisonValueType["Null"] = "Null"; + ComparisonValueType["Undefined"] = "Undefined"; + ComparisonValueType["UndefinedStringLiteral"] = "UndefinedStringLiteral"; +})(ComparisonValueType || (ComparisonValueType = {})); +var OperandValidity; +(function (OperandValidity) { + OperandValidity["Valid"] = "Valid"; + OperandValidity["Last"] = "Last"; + OperandValidity["Invalid"] = "Invalid"; +})(OperandValidity || (exports.OperandValidity = OperandValidity = {})); +var NullishComparisonType; +(function (NullishComparisonType) { + /** `x != null`, `x != undefined` */ + NullishComparisonType["NotEqualNullOrUndefined"] = "NotEqualNullOrUndefined"; + /** `x == null`, `x == undefined` */ + NullishComparisonType["EqualNullOrUndefined"] = "EqualNullOrUndefined"; + /** `x !== null` */ + NullishComparisonType["NotStrictEqualNull"] = "NotStrictEqualNull"; + /** `x === null` */ + NullishComparisonType["StrictEqualNull"] = "StrictEqualNull"; + /** `x !== undefined`, `typeof x !== 'undefined'` */ + NullishComparisonType["NotStrictEqualUndefined"] = "NotStrictEqualUndefined"; + /** `x === undefined`, `typeof x === 'undefined'` */ + NullishComparisonType["StrictEqualUndefined"] = "StrictEqualUndefined"; + /** `!x` */ + NullishComparisonType["NotBoolean"] = "NotBoolean"; + /** `x` */ + NullishComparisonType["Boolean"] = "Boolean"; +})(NullishComparisonType || (exports.NullishComparisonType = NullishComparisonType = {})); +var ComparisonType; +(function (ComparisonType) { + ComparisonType["NotEqual"] = "NotEqual"; + ComparisonType["Equal"] = "Equal"; + ComparisonType["NotStrictEqual"] = "NotStrictEqual"; + ComparisonType["StrictEqual"] = "StrictEqual"; +})(ComparisonType || (exports.ComparisonType = ComparisonType = {})); +const NULLISH_FLAGS = ts.TypeFlags.Null | ts.TypeFlags.Undefined; +function isValidFalseBooleanCheckType(node, disallowFalseyLiteral, parserServices, options) { + const type = parserServices.getTypeAtLocation(node); + const types = (0, ts_api_utils_1.unionConstituents)(type); + const primitiveAndObjectParts = types.flatMap(type => (0, ts_api_utils_1.intersectionConstituents)(type)); + if (disallowFalseyLiteral && + /* + ``` + declare const x: false | {a: string}; + x && x.a; + !x || x.a; + ``` + + We don't want to consider these two cases because the boolean expression + narrows out the non-nullish falsy cases - so converting the chain to `x?.a` + would introduce a build error + */ (primitiveAndObjectParts.some(t => (0, ts_api_utils_1.isBooleanLiteralType)(t) && t.intrinsicName === 'false') || + primitiveAndObjectParts.some(t => (0, ts_api_utils_1.isStringLiteralType)(t) && t.value === '') || + primitiveAndObjectParts.some(t => (0, ts_api_utils_1.isNumberLiteralType)(t) && t.value === 0) || + primitiveAndObjectParts.some(t => (0, ts_api_utils_1.isBigIntLiteralType)(t) && t.value.base10Value === '0'))) { + return false; + } + let allowedFlags = NULLISH_FLAGS | ts.TypeFlags.Object; + if (options.checkAny === true) { + allowedFlags |= ts.TypeFlags.Any; + } + if (options.checkUnknown === true) { + allowedFlags |= ts.TypeFlags.Unknown; + } + if (options.checkString === true) { + allowedFlags |= ts.TypeFlags.StringLike; + } + if (options.checkNumber === true) { + allowedFlags |= ts.TypeFlags.NumberLike; + } + if (options.checkBoolean === true) { + allowedFlags |= ts.TypeFlags.BooleanLike; + } + if (options.checkBigInt === true) { + allowedFlags |= ts.TypeFlags.BigIntLike; + } + return primitiveAndObjectParts.every(t => (0, util_1.isTypeFlagSet)(t, allowedFlags)); +} +function gatherLogicalOperands(node, parserServices, sourceCode, options) { + const result = []; + const { newlySeenLogicals, operands } = flattenLogicalOperands(node); + for (const operand of operands) { + const areMoreOperands = operand !== operands.at(-1); + switch (operand.type) { + case utils_1.AST_NODE_TYPES.BinaryExpression: { + // check for "yoda" style logical: null != x + const { comparedExpression, comparedValue, isYoda } = (() => { + // non-yoda checks are by far the most common, so check for them first + const comparedValueRight = getComparisonValueType(operand.right); + if (comparedValueRight) { + return { + comparedExpression: operand.left, + comparedValue: comparedValueRight, + isYoda: false, + }; + } + return { + comparedExpression: operand.right, + comparedValue: getComparisonValueType(operand.left), + isYoda: true, + }; + })(); + if (comparedValue === ComparisonValueType.UndefinedStringLiteral) { + if (comparedExpression.type === utils_1.AST_NODE_TYPES.UnaryExpression && + comparedExpression.operator === 'typeof') { + const argument = comparedExpression.argument; + if (argument.type === utils_1.AST_NODE_TYPES.Identifier && + // typeof window === 'undefined' + (0, util_1.isReferenceToGlobalFunction)(argument.name, argument, sourceCode)) { + result.push({ type: OperandValidity.Invalid }); + continue; + } + // typeof x.y === 'undefined' + result.push({ + comparedName: comparedExpression.argument, + comparisonType: operand.operator.startsWith('!') + ? NullishComparisonType.NotStrictEqualUndefined + : NullishComparisonType.StrictEqualUndefined, + isYoda, + node: operand, + type: OperandValidity.Valid, + }); + continue; + } + // y === 'undefined' + result.push({ type: OperandValidity.Invalid }); + continue; + } + if (operand.operator.startsWith('!') !== (node.operator === '||')) { + switch (operand.operator) { + case '!=': + case '==': + if (comparedValue === ComparisonValueType.Null || + comparedValue === ComparisonValueType.Undefined) { + // x == null, x == undefined + result.push({ + comparedName: comparedExpression, + comparisonType: operand.operator.startsWith('!') + ? NullishComparisonType.NotEqualNullOrUndefined + : NullishComparisonType.EqualNullOrUndefined, + isYoda, + node: operand, + type: OperandValidity.Valid, + }); + continue; + } + break; + case '!==': + case '===': { + const comparedName = comparedExpression; + switch (comparedValue) { + case ComparisonValueType.Null: + result.push({ + comparedName, + comparisonType: operand.operator.startsWith('!') + ? NullishComparisonType.NotStrictEqualNull + : NullishComparisonType.StrictEqualNull, + isYoda, + node: operand, + type: OperandValidity.Valid, + }); + continue; + case ComparisonValueType.Undefined: + result.push({ + comparedName, + comparisonType: operand.operator.startsWith('!') + ? NullishComparisonType.NotStrictEqualUndefined + : NullishComparisonType.StrictEqualUndefined, + isYoda, + node: operand, + type: OperandValidity.Valid, + }); + continue; + } + } + } + } + // x == something :( + // x === something :( + // x != something :( + // x !== something :( + const binaryComparisonChain = getBinaryComparisonChain(operand); + if (binaryComparisonChain) { + const { comparedName, comparedValue, yoda } = binaryComparisonChain; + switch (operand.operator) { + case '==': + case '===': { + const comparisonType = operand.operator === '==' + ? ComparisonType.Equal + : ComparisonType.StrictEqual; + result.push({ + comparedName, + comparisonType, + comparisonValue: comparedValue, + node: operand, + type: OperandValidity.Last, + yoda, + }); + continue; + } + case '!=': + case '!==': { + const comparisonType = operand.operator === '!=' + ? ComparisonType.NotEqual + : ComparisonType.NotStrictEqual; + result.push({ + comparedName, + comparisonType, + comparisonValue: comparedValue, + node: operand, + type: OperandValidity.Last, + yoda, + }); + continue; + } + } + } + result.push({ type: OperandValidity.Invalid }); + continue; + } + case utils_1.AST_NODE_TYPES.UnaryExpression: + if (operand.operator === '!' && + (!areMoreOperands || + isValidFalseBooleanCheckType(operand.argument, node.operator === '||', parserServices, options))) { + result.push({ + comparedName: operand.argument, + comparisonType: NullishComparisonType.NotBoolean, + isYoda: false, + node: operand, + type: OperandValidity.Valid, + }); + continue; + } + result.push({ type: OperandValidity.Invalid }); + continue; + case utils_1.AST_NODE_TYPES.LogicalExpression: + // explicitly ignore the mixed logical expression cases + result.push({ type: OperandValidity.Invalid }); + continue; + default: + if (!areMoreOperands || + isValidFalseBooleanCheckType(operand, node.operator === '&&', parserServices, options)) { + result.push({ + comparedName: operand, + comparisonType: NullishComparisonType.Boolean, + isYoda: false, + node: operand, + type: OperandValidity.Valid, + }); + } + else { + result.push({ type: OperandValidity.Invalid }); + } + continue; + } + } + return { + newlySeenLogicals, + operands: result, + }; + /* + The AST is always constructed such the first element is always the deepest element. + I.e. for this code: `foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz` + The AST will look like this: + { + left: { + left: { + left: foo + right: foo.bar + } + right: foo.bar.baz + } + right: foo.bar.baz.buzz + } + + So given any logical expression, we can perform a depth-first traversal to get + the operands in order. + + Note that this function purposely does not inspect mixed logical expressions + like `foo || foo.bar && foo.bar.baz` - separate selector + */ + function flattenLogicalOperands(node) { + const operands = []; + const newlySeenLogicals = new Set([node]); + const stack = [node.right, node.left]; + let current; + while ((current = stack.pop())) { + if (current.type === utils_1.AST_NODE_TYPES.LogicalExpression && + current.operator === node.operator) { + newlySeenLogicals.add(current); + stack.push(current.right); + stack.push(current.left); + } + else { + operands.push(current); + } + } + return { + newlySeenLogicals, + operands, + }; + } + function getComparisonValueType(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.Literal: + // eslint-disable-next-line eqeqeq, @typescript-eslint/internal/eqeq-nullish -- intentional exact comparison against null + if (node.value === null && node.raw === 'null') { + return ComparisonValueType.Null; + } + if (node.value === 'undefined') { + return ComparisonValueType.UndefinedStringLiteral; + } + return null; + case utils_1.AST_NODE_TYPES.Identifier: + if (node.name === 'undefined') { + return ComparisonValueType.Undefined; + } + return null; + } + return null; + } + function isMemberBasedExpression(node) { + if (node.type === utils_1.AST_NODE_TYPES.MemberExpression) { + return true; + } + if (node.type === utils_1.AST_NODE_TYPES.CallExpression && + node.callee.type === utils_1.AST_NODE_TYPES.MemberExpression) { + return true; + } + return false; + } + function getBinaryComparisonChain(node) { + const { left, right } = node; + const isLeftMemberExpression = isMemberBasedExpression(left); + const isRightMemberExpression = isMemberBasedExpression(right); + if (isLeftMemberExpression && !isRightMemberExpression) { + const [comparedName, comparedValue] = [left, right]; + return { + comparedName, + comparedValue, + yoda: Yoda.No, + }; + } + if (!isLeftMemberExpression && isRightMemberExpression) { + const [comparedName, comparedValue] = [right, left]; + return { + comparedName, + comparedValue, + yoda: Yoda.Yes, + }; + } + if (isLeftMemberExpression && isRightMemberExpression) { + return { + comparedName: left, + comparedValue: right, + yoda: Yoda.Unknown, + }; + } + return null; + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2ef7f046d2de13ad8435778bc4693dcde38703a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.d.ts @@ -0,0 +1,5 @@ +import type { PreferOptionalChainMessageIds, PreferOptionalChainOptions } from './prefer-optional-chain-utils/PreferOptionalChainOptions'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js new file mode 100644 index 0000000000000000000000000000000000000000..ac34154d8c1853502a48906a3c4485c95d0ce614 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-optional-chain.js @@ -0,0 +1,150 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const analyzeChain_1 = require("./prefer-optional-chain-utils/analyzeChain"); +const checkNullishAndReport_1 = require("./prefer-optional-chain-utils/checkNullishAndReport"); +const gatherLogicalOperands_1 = require("./prefer-optional-chain-utils/gatherLogicalOperands"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-optional-chain', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: 'code', + hasSuggestions: true, + messages: { + optionalChainSuggest: 'Change to an optional chain.', + preferOptionalChain: "Prefer using an optional chain expression instead, as it's more concise and easier to read.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: { + type: 'boolean', + description: 'Allow autofixers that will change the return type of the expression. This option is considered unsafe as it may break the build.', + }, + checkAny: { + type: 'boolean', + description: 'Check operands that are typed as `any` when inspecting "loose boolean" operands.', + }, + checkBigInt: { + type: 'boolean', + description: 'Check operands that are typed as `bigint` when inspecting "loose boolean" operands.', + }, + checkBoolean: { + type: 'boolean', + description: 'Check operands that are typed as `boolean` when inspecting "loose boolean" operands.', + }, + checkNumber: { + type: 'boolean', + description: 'Check operands that are typed as `number` when inspecting "loose boolean" operands.', + }, + checkString: { + type: 'boolean', + description: 'Check operands that are typed as `string` when inspecting "loose boolean" operands.', + }, + checkUnknown: { + type: 'boolean', + description: 'Check operands that are typed as `unknown` when inspecting "loose boolean" operands.', + }, + requireNullish: { + type: 'boolean', + description: 'Skip operands that are not typed with `null` and/or `undefined` when inspecting "loose boolean" operands.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing: false, + checkAny: true, + checkBigInt: true, + checkBoolean: true, + checkNumber: true, + checkString: true, + checkUnknown: true, + requireNullish: false, + }, + ], + create(context, [options]) { + const parserServices = (0, util_1.getParserServices)(context); + const seenLogicals = new Set(); + return { + 'LogicalExpression[operator!="??"]'(node) { + if (seenLogicals.has(node)) { + return; + } + const { newlySeenLogicals, operands } = (0, gatherLogicalOperands_1.gatherLogicalOperands)(node, parserServices, context.sourceCode, options); + for (const logical of newlySeenLogicals) { + seenLogicals.add(logical); + } + let currentChain = []; + for (const operand of operands) { + if (operand.type === gatherLogicalOperands_1.OperandValidity.Invalid) { + (0, analyzeChain_1.analyzeChain)(context, parserServices, options, node, node.operator, currentChain); + currentChain = []; + } + else if (operand.type === gatherLogicalOperands_1.OperandValidity.Last) { + (0, analyzeChain_1.analyzeChain)(context, parserServices, options, node, node.operator, currentChain, operand); + currentChain = []; + } + else { + currentChain.push(operand); + } + } + // make sure to check whatever's left + if (currentChain.length > 0) { + (0, analyzeChain_1.analyzeChain)(context, parserServices, options, node, node.operator, currentChain); + } + }, + // specific handling for `(foo ?? {}).bar` / `(foo || {}).bar` + 'LogicalExpression[operator="||"], LogicalExpression[operator="??"]'(node) { + const leftNode = node.left; + const rightNode = node.right; + const parentNode = node.parent; + const isRightNodeAnEmptyObjectLiteral = rightNode.type === utils_1.AST_NODE_TYPES.ObjectExpression && + rightNode.properties.length === 0; + if (!isRightNodeAnEmptyObjectLiteral || + parentNode.type !== utils_1.AST_NODE_TYPES.MemberExpression || + parentNode.optional) { + return; + } + seenLogicals.add(node); + function isLeftSideLowerPrecedence() { + const logicalTsNode = parserServices.esTreeNodeToTSNodeMap.get(node); + const leftTsNode = parserServices.esTreeNodeToTSNodeMap.get(leftNode); + const leftPrecedence = (0, util_1.getOperatorPrecedence)(leftTsNode.kind, logicalTsNode.operatorToken.kind); + return leftPrecedence < util_1.OperatorPrecedence.LeftHandSide; + } + (0, checkNullishAndReport_1.checkNullishAndReport)(context, parserServices, options, [leftNode], { + node: parentNode, + messageId: 'preferOptionalChain', + suggest: [ + { + messageId: 'optionalChainSuggest', + fix: (fixer) => { + const leftNodeText = context.sourceCode.getText(leftNode); + // Any node that is made of an operator with higher or equal precedence, + const maybeWrappedLeftNode = isLeftSideLowerPrecedence() + ? `(${leftNodeText})` + : leftNodeText; + const propertyToBeOptionalText = context.sourceCode.getText(parentNode.property); + const maybeWrappedProperty = parentNode.computed + ? `[${propertyToBeOptionalText}]` + : propertyToBeOptionalText; + return fixer.replaceTextRange(parentNode.range, `${maybeWrappedLeftNode}?.${maybeWrappedProperty}`); + }, + }, + ], + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2760f215adb229dbc708774bf97aac7024866680 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.d.ts @@ -0,0 +1,14 @@ +import type { TypeOrValueSpecifier } from '../util'; +export type MessageIds = 'rejectAnError'; +export type Options = [ + { + allow?: TypeOrValueSpecifier[]; + allowEmptyReject?: boolean; + allowThrowingAny?: boolean; + allowThrowingUnknown?: boolean; + } +]; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"rejectAnError", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.js new file mode 100644 index 0000000000000000000000000000000000000000..beb50c073264674205648813078eccc426d12cd1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-promise-reject-errors.js @@ -0,0 +1,124 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-promise-reject-errors', + meta: { + type: 'suggestion', + docs: { + description: 'Require using Error objects as Promise rejection reasons', + extendsBaseRule: true, + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + rejectAnError: 'Expected the Promise rejection reason to be an Error.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + ...util_1.typeOrValueSpecifiersSchema, + description: 'Type specifiers that can be used as Promise rejection reasons.', + }, + allowEmptyReject: { + type: 'boolean', + description: 'Whether to allow calls to `Promise.reject()` with no arguments.', + }, + allowThrowingAny: { + type: 'boolean', + description: 'Whether to always allow throwing values typed as `any`.', + }, + allowThrowingUnknown: { + type: 'boolean', + description: 'Whether to always allow throwing values typed as `unknown`.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [], + allowEmptyReject: false, + allowThrowingAny: false, + allowThrowingUnknown: false, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + function checkRejectCall(callExpression) { + const argument = callExpression.arguments.at(0); + if (argument) { + const type = services.getTypeAtLocation(argument); + if ((0, util_1.typeMatchesSomeSpecifier)(type, options.allow, services.program)) { + return; + } + if (options.allowThrowingAny && (0, util_1.isTypeAnyType)(type)) { + return; + } + if (options.allowThrowingUnknown && (0, util_1.isTypeUnknownType)(type)) { + return; + } + if ((0, util_1.isErrorLike)(services.program, type) || + (0, util_1.isReadonlyErrorLike)(services.program, type)) { + return; + } + } + else if (options.allowEmptyReject) { + return; + } + context.report({ + node: callExpression, + messageId: 'rejectAnError', + }); + } + function typeAtLocationIsLikePromise(node) { + const type = services.getTypeAtLocation(node); + return ((0, util_1.isPromiseConstructorLike)(services.program, type) || + (0, util_1.isPromiseLike)(services.program, type)); + } + return { + CallExpression(node) { + const callee = (0, util_1.skipChainExpression)(node.callee); + if (callee.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return; + } + if (!(0, util_1.isStaticMemberAccessOfValue)(callee, context, 'reject') || + !typeAtLocationIsLikePromise(callee.object)) { + return; + } + checkRejectCall(node); + }, + NewExpression(node) { + const callee = (0, util_1.skipChainExpression)(node.callee); + if (!(0, util_1.isPromiseConstructorLike)(services.program, services.getTypeAtLocation(callee))) { + return; + } + const executor = node.arguments.at(0); + if (!executor || !(0, util_1.isFunction)(executor)) { + return; + } + const rejectParamNode = executor.params.at(1); + if (!rejectParamNode || !(0, util_1.isIdentifier)(rejectParamNode)) { + return; + } + // reject param is always present in variables declared by executor + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const rejectVariable = context.sourceCode + .getDeclaredVariables(executor) + .find(variable => variable.identifiers.includes(rejectParamNode)); + rejectVariable.references.forEach(ref => { + if (ref.identifier.parent.type !== utils_1.AST_NODE_TYPES.CallExpression || + ref.identifier !== ref.identifier.parent.callee) { + return; + } + checkRejectCall(ref.identifier.parent); + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3cc3a867c2a4c22e3771a8dfbeba2c92241663fc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.d.ts @@ -0,0 +1,14 @@ +import type { TypeOrValueSpecifier } from '../util'; +export type Options = [ + { + allow?: TypeOrValueSpecifier[]; + checkParameterProperties?: boolean; + ignoreInferredTypes?: boolean; + treatMethodsAsReadonly?: boolean; + } +]; +export type MessageIds = 'shouldBeReadonly'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldBeReadonly", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js new file mode 100644 index 0000000000000000000000000000000000000000..91b870d4b30704befd4964c290118007e2d6b2e0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly-parameter-types.js @@ -0,0 +1,98 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-readonly-parameter-types', + meta: { + type: 'suggestion', + docs: { + description: 'Require function parameters to be typed as `readonly` to prevent accidental mutation of inputs', + requiresTypeChecking: true, + }, + messages: { + shouldBeReadonly: 'Parameter should be a read only type.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allow: { + ...util_1.readonlynessOptionsSchema.properties.allow, + description: 'An array of type specifiers to ignore.', + }, + checkParameterProperties: { + type: 'boolean', + description: 'Whether to check class parameter properties.', + }, + ignoreInferredTypes: { + type: 'boolean', + description: "Whether to ignore parameters which don't explicitly specify a type.", + }, + treatMethodsAsReadonly: { + ...util_1.readonlynessOptionsSchema.properties.treatMethodsAsReadonly, + description: 'Whether to treat all mutable methods as though they are readonly.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: util_1.readonlynessOptionsDefaults.allow, + checkParameterProperties: true, + ignoreInferredTypes: false, + treatMethodsAsReadonly: util_1.readonlynessOptionsDefaults.treatMethodsAsReadonly, + }, + ], + create(context, [{ allow, checkParameterProperties, ignoreInferredTypes, treatMethodsAsReadonly, },]) { + const services = (0, util_1.getParserServices)(context); + function getParameterType(actualParam) { + if (actualParam.typeAnnotation?.typeAnnotation) { + // Get type from annotation node to preserve aliasSymbol + const checker = services.program.getTypeChecker(); + const tsTypeNode = services.esTreeNodeToTSNodeMap.get(actualParam.typeAnnotation.typeAnnotation); + return checker.getTypeFromTypeNode(tsTypeNode); + } + return services.getTypeAtLocation(actualParam); + } + return { + [[ + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.FunctionExpression, + utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration, + utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration, + utils_1.AST_NODE_TYPES.TSDeclareFunction, + utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression, + utils_1.AST_NODE_TYPES.TSFunctionType, + utils_1.AST_NODE_TYPES.TSMethodSignature, + ].join(', ')](node) { + for (const param of node.params) { + if (!checkParameterProperties && + param.type === utils_1.AST_NODE_TYPES.TSParameterProperty) { + continue; + } + const actualParam = param.type === utils_1.AST_NODE_TYPES.TSParameterProperty + ? param.parameter + : param; + if (ignoreInferredTypes && actualParam.typeAnnotation == null) { + continue; + } + const type = getParameterType(actualParam); + const isReadOnly = (0, util_1.isTypeReadonly)(services.program, type, { + allow, + treatMethodsAsReadonly: !!treatMethodsAsReadonly, + }); + if (!isReadOnly && !(0, util_1.isTypeBrandedLiteralLike)(type)) { + context.report({ + node: actualParam, + messageId: 'shouldBeReadonly', + }); + } + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..848998f5db8dd8d99b5a5a28415959d010696958 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.d.ts @@ -0,0 +1,10 @@ +export type MessageIds = 'preferReadonly'; +export type Options = [ + { + onlyInlineLambdas?: boolean; + } +]; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferReadonly", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js new file mode 100644 index 0000000000000000000000000000000000000000..91e6263a0653bb66b0fce77ac4a7fbf393b900ba --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-readonly.js @@ -0,0 +1,439 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const getMemberHeadLoc_1 = require("../util/getMemberHeadLoc"); +const functionScopeBoundaries = [ + utils_1.AST_NODE_TYPES.ArrowFunctionExpression, + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.FunctionExpression, + utils_1.AST_NODE_TYPES.MethodDefinition, +].join(', '); +exports.default = (0, util_1.createRule)({ + name: 'prefer-readonly', + meta: { + type: 'suggestion', + docs: { + description: "Require private members to be marked as `readonly` if they're never modified outside of the constructor", + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferReadonly: "Member '{{name}}' is never reassigned; mark it as `readonly`.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + onlyInlineLambdas: { + type: 'boolean', + description: 'Whether to restrict checking only to members immediately assigned a lambda value.', + }, + }, + }, + ], + }, + defaultOptions: [{ onlyInlineLambdas: false }], + create(context, [{ onlyInlineLambdas }]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const classScopeStack = []; + function handlePropertyAccessExpression(node, parent, classScope) { + if (ts.isBinaryExpression(parent)) { + handleParentBinaryExpression(node, parent, classScope); + return; + } + if (ts.isDeleteExpression(parent) || isDestructuringAssignment(node)) { + classScope.addVariableModification(node); + return; + } + if (ts.isPostfixUnaryExpression(parent) || + ts.isPrefixUnaryExpression(parent)) { + handleParentPostfixOrPrefixUnaryExpression(parent, classScope); + } + } + function handleParentBinaryExpression(node, parent, classScope) { + if (parent.left === node && + tsutils.isAssignmentKind(parent.operatorToken.kind)) { + classScope.addVariableModification(node); + } + } + function handleParentPostfixOrPrefixUnaryExpression(node, classScope) { + if (node.operator === ts.SyntaxKind.PlusPlusToken || + node.operator === ts.SyntaxKind.MinusMinusToken) { + classScope.addVariableModification(node.operand); + } + } + function isDestructuringAssignment(node) { + let current = node.parent; + while (current) { + const parent = current.parent; + if (ts.isObjectLiteralExpression(parent) || + ts.isArrayLiteralExpression(parent) || + ts.isSpreadAssignment(parent) || + (ts.isSpreadElement(parent) && + ts.isArrayLiteralExpression(parent.parent))) { + current = parent; + } + else if (ts.isBinaryExpression(parent) && + !ts.isPropertyAccessExpression(current)) { + return (parent.left === current && + parent.operatorToken.kind === ts.SyntaxKind.EqualsToken); + } + else { + break; + } + } + return false; + } + function isFunctionScopeBoundaryInStack(node) { + if (classScopeStack.length === 0) { + return false; + } + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (ts.isConstructorDeclaration(tsNode)) { + return false; + } + return tsutils.isFunctionScopeBoundary(tsNode); + } + function getEsNodesFromViolatingNode(violatingNode) { + return { + esNode: services.tsNodeToESTreeNodeMap.get(violatingNode), + nameNode: services.tsNodeToESTreeNodeMap.get(violatingNode.name), + }; + } + function getTypeAnnotationForViolatingNode(node, type, initializerType) { + const annotation = checker.typeToString(type); + // verify the about-to-be-added type annotation is in-scope + if (tsutils.isTypeFlagSet(initializerType, ts.TypeFlags.EnumLiteral)) { + const scope = context.sourceCode.getScope(node); + const variable = utils_1.ASTUtils.findVariable(scope, annotation); + if (variable == null) { + return null; + } + const definition = variable.defs.find(def => def.isTypeDefinition); + if (definition == null) { + return null; + } + const definitionType = services.getTypeAtLocation(definition.node); + if (definitionType !== type) { + return null; + } + } + return annotation; + } + return { + [`${functionScopeBoundaries}:exit`](node) { + if (utils_1.ASTUtils.isConstructor(node)) { + classScopeStack[classScopeStack.length - 1].exitConstructor(); + } + else if (isFunctionScopeBoundaryInStack(node)) { + classScopeStack[classScopeStack.length - 1].exitNonConstructor(); + } + }, + 'ClassDeclaration, ClassExpression'(node) { + classScopeStack.push(new ClassScope(checker, services.esTreeNodeToTSNodeMap.get(node), onlyInlineLambdas)); + }, + 'ClassDeclaration, ClassExpression:exit'() { + const finalizedClassScope = (0, util_1.nullThrows)(classScopeStack.pop(), 'Stack should exist on class exit'); + for (const violatingNode of finalizedClassScope.finalizeUnmodifiedPrivateNonReadonlys()) { + const { esNode, nameNode } = getEsNodesFromViolatingNode(violatingNode); + const reportNodeOrLoc = (() => { + switch (esNode.type) { + case utils_1.AST_NODE_TYPES.MethodDefinition: + case utils_1.AST_NODE_TYPES.PropertyDefinition: + case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + return { loc: (0, getMemberHeadLoc_1.getMemberHeadLoc)(context.sourceCode, esNode) }; + case utils_1.AST_NODE_TYPES.TSParameterProperty: + return { + loc: (0, getMemberHeadLoc_1.getParameterPropertyHeadLoc)(context.sourceCode, esNode, nameNode.name), + }; + default: + return { node: esNode }; + } + })(); + const typeAnnotation = (() => { + if (esNode.type !== utils_1.AST_NODE_TYPES.PropertyDefinition) { + return null; + } + if (esNode.typeAnnotation || !esNode.value) { + return null; + } + if (nameNode.type !== utils_1.AST_NODE_TYPES.Identifier) { + return null; + } + const hasConstructorModifications = finalizedClassScope.memberHasConstructorModifications(nameNode.name); + if (!hasConstructorModifications) { + return null; + } + const violatingType = services.getTypeAtLocation(esNode); + const initializerType = services.getTypeAtLocation(esNode.value); + // if the RHS is a literal, its type would be narrowed, while the + // type of the initializer (which isn't `readonly`) would be the + // widened type + if (initializerType === violatingType) { + return null; + } + if (!tsutils.isLiteralType(initializerType)) { + return null; + } + return getTypeAnnotationForViolatingNode(esNode, violatingType, initializerType); + })(); + context.report({ + ...reportNodeOrLoc, + messageId: 'preferReadonly', + data: { + name: context.sourceCode.getText(nameNode), + }, + *fix(fixer) { + const readonlyInsertionTarget = esNode.type === utils_1.AST_NODE_TYPES.PropertyDefinition && + esNode.computed + ? (0, util_1.nullThrows)(context.sourceCode.getTokenBefore(nameNode), 'Expected to find a token before computed property name') + : nameNode; + yield fixer.insertTextBefore(readonlyInsertionTarget, 'readonly '); + if (typeAnnotation) { + yield fixer.insertTextAfter(nameNode, `: ${typeAnnotation}`); + } + }, + }); + } + }, + [functionScopeBoundaries](node) { + if (utils_1.ASTUtils.isConstructor(node)) { + classScopeStack[classScopeStack.length - 1].enterConstructor(services.esTreeNodeToTSNodeMap.get(node)); + } + else if (isFunctionScopeBoundaryInStack(node)) { + classScopeStack[classScopeStack.length - 1].enterNonConstructor(); + } + }, + MemberExpression(node) { + if (classScopeStack.length === 0) { + return; + } + const classScope = classScopeStack[classScopeStack.length - 1]; + if (!node.computed) { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + handlePropertyAccessExpression(tsNode, tsNode.parent, classScope); + } + else { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + if (ts.isElementAccessExpression(tsNode) && + ts.isBinaryExpression(tsNode.parent) && + tsNode.parent.left === tsNode && + tsutils.isAssignmentKind(tsNode.parent.operatorToken.kind)) { + const memberName = (0, util_1.getStaticMemberAccessValue)(node, context); + if (typeof memberName === 'string') { + classScope.addVariableModificationByName(tsNode.expression, memberName); + } + } + } + }, + }; + }, +}); +const OUTSIDE_CONSTRUCTOR = -1; +const DIRECTLY_INSIDE_CONSTRUCTOR = 0; +var TypeToClassRelation; +(function (TypeToClassRelation) { + TypeToClassRelation[TypeToClassRelation["ClassAndInstance"] = 0] = "ClassAndInstance"; + TypeToClassRelation[TypeToClassRelation["Class"] = 1] = "Class"; + TypeToClassRelation[TypeToClassRelation["Instance"] = 2] = "Instance"; + TypeToClassRelation[TypeToClassRelation["None"] = 3] = "None"; +})(TypeToClassRelation || (TypeToClassRelation = {})); +class ClassScope { + checker; + onlyInlineLambdas; + classType; + constructorScopeDepth = OUTSIDE_CONSTRUCTOR; + memberVariableModifications = new Set(); + memberVariableWithConstructorModifications = new Set(); + privateModifiableMembers = new Map(); + privateModifiableStatics = new Map(); + staticVariableModifications = new Set(); + constructor(checker, classNode, onlyInlineLambdas) { + this.checker = checker; + this.onlyInlineLambdas = onlyInlineLambdas; + const classType = checker.getTypeAtLocation(classNode); + if (tsutils.isIntersectionType(classType)) { + this.classType = classType.types[0]; + } + else { + this.classType = classType; + } + for (const member of classNode.members) { + if (ts.isPropertyDeclaration(member)) { + this.addDeclaredVariable(member); + } + } + } + addDeclaredVariable(node) { + if (!(tsutils.isModifierFlagSet(node, ts.ModifierFlags.Private) || + node.name.kind === ts.SyntaxKind.PrivateIdentifier) || + tsutils.isModifierFlagSet(node, ts.ModifierFlags.Accessor | ts.ModifierFlags.Readonly)) { + return; + } + if (this.onlyInlineLambdas && + node.initializer != null && + !ts.isArrowFunction(node.initializer)) { + return; + } + const memberName = getMemberName(node.name); + if (memberName == null) { + return; + } + (tsutils.isModifierFlagSet(node, ts.ModifierFlags.Static) + ? this.privateModifiableStatics + : this.privateModifiableMembers).set(memberName, node); + } + addVariableModification(node) { + this.addVariableModificationByName(node.expression, node.name.text); + } + addVariableModificationByName(expression, memberName) { + const modifierType = this.checker.getTypeAtLocation(expression); + const relationOfModifierTypeToClass = this.getTypeToClassRelation(modifierType); + if (relationOfModifierTypeToClass === TypeToClassRelation.Instance && + this.constructorScopeDepth === DIRECTLY_INSIDE_CONSTRUCTOR) { + this.memberVariableWithConstructorModifications.add(memberName); + return; + } + if (relationOfModifierTypeToClass === TypeToClassRelation.Instance || + relationOfModifierTypeToClass === TypeToClassRelation.ClassAndInstance) { + this.memberVariableModifications.add(memberName); + } + if (relationOfModifierTypeToClass === TypeToClassRelation.Class || + relationOfModifierTypeToClass === TypeToClassRelation.ClassAndInstance) { + this.staticVariableModifications.add(memberName); + } + } + enterConstructor(node) { + this.constructorScopeDepth = DIRECTLY_INSIDE_CONSTRUCTOR; + for (const parameter of node.parameters) { + if (tsutils.isModifierFlagSet(parameter, ts.ModifierFlags.Private)) { + this.addDeclaredVariable(parameter); + } + } + } + enterNonConstructor() { + if (this.constructorScopeDepth !== OUTSIDE_CONSTRUCTOR) { + this.constructorScopeDepth += 1; + } + } + exitConstructor() { + this.constructorScopeDepth = OUTSIDE_CONSTRUCTOR; + } + exitNonConstructor() { + if (this.constructorScopeDepth !== OUTSIDE_CONSTRUCTOR) { + this.constructorScopeDepth -= 1; + } + } + finalizeUnmodifiedPrivateNonReadonlys() { + this.memberVariableModifications.forEach(variableName => { + this.privateModifiableMembers.delete(variableName); + }); + this.staticVariableModifications.forEach(variableName => { + this.privateModifiableStatics.delete(variableName); + }); + return [ + ...this.privateModifiableMembers.values(), + ...this.privateModifiableStatics.values(), + ]; + } + getTypeToClassRelation(type) { + if (type.isIntersection()) { + let result = TypeToClassRelation.None; + for (const subType of type.types) { + const subTypeResult = this.getTypeToClassRelation(subType); + switch (subTypeResult) { + case TypeToClassRelation.Class: + if (result === TypeToClassRelation.Instance) { + return TypeToClassRelation.ClassAndInstance; + } + result = TypeToClassRelation.Class; + break; + case TypeToClassRelation.Instance: + if (result === TypeToClassRelation.Class) { + return TypeToClassRelation.ClassAndInstance; + } + result = TypeToClassRelation.Instance; + break; + } + } + return result; + } + if (type.isUnion()) { + // any union of class/instance and something else will prevent access to + // private members, so we assume that union consists only of classes + // or class instances, because otherwise tsc will report an error + return this.getTypeToClassRelation(type.types[0]); + } + if (!type.getSymbol() || !(0, util_1.typeIsOrHasBaseType)(type, this.classType)) { + return TypeToClassRelation.None; + } + const typeIsClass = tsutils.isObjectType(type) && + tsutils.isObjectFlagSet(type, ts.ObjectFlags.Anonymous); + if (typeIsClass) { + return TypeToClassRelation.Class; + } + return TypeToClassRelation.Instance; + } + memberHasConstructorModifications(name) { + return this.memberVariableWithConstructorModifications.has(name); + } +} +function getMemberName(name) { + if (ts.isIdentifier(name) || + ts.isPrivateIdentifier(name) || + ts.isStringLiteral(name) || + ts.isNoSubstitutionTemplateLiteral(name) || + ts.isNumericLiteral(name)) { + return name.text; + } + if (ts.isComputedPropertyName(name)) { + const expression = name.expression; + if (ts.isNumericLiteral(expression)) { + return expression.text; + } + if (ts.isPropertyAccessExpression(expression) && + ts.isIdentifier(expression.expression) && + expression.expression.text === 'Symbol') { + return expression.getText(); + } + } + return undefined; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..960932ac58ccb22d75305deb7f36d3af484347c7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferTypeParameter", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js new file mode 100644 index 0000000000000000000000000000000000000000..ec6f6a79a934902690f23f18596f1b374bfb66c3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-reduce-type-parameter.js @@ -0,0 +1,114 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-reduce-type-parameter', + meta: { + type: 'problem', + docs: { + description: 'Enforce using type parameter when calling `Array#reduce` instead of using a type assertion', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferTypeParameter: 'Unnecessary assertion: Array#reduce accepts a type parameter for the default value.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function isArrayType(type) { + return tsutils + .unionConstituents(type) + .every(unionPart => tsutils + .intersectionConstituents(unionPart) + .every(t => checker.isArrayType(t) || checker.isTupleType(t))); + } + return { + 'CallExpression > MemberExpression.callee'(callee) { + if (!(0, util_1.isStaticMemberAccessOfValue)(callee, context, 'reduce')) { + return; + } + const [, secondArg] = callee.parent.arguments; + if (callee.parent.arguments.length < 2) { + return; + } + if ((0, util_1.isTypeAssertion)(secondArg)) { + const initializerType = services.getTypeAtLocation(secondArg.expression); + const assertedType = services.getTypeAtLocation(secondArg.typeAnnotation); + const isAssertionNecessary = !checker.isTypeAssignableTo(initializerType, assertedType); + // don't report this if the resulting fix will be a type error + if (isAssertionNecessary) { + return; + } + } + else { + return; + } + // Get the symbol of the `reduce` method. + const calleeObjType = (0, util_1.getConstrainedTypeAtLocation)(services, callee.object); + // Check the owner type of the `reduce` method. + if (isArrayType(calleeObjType)) { + context.report({ + node: secondArg, + messageId: 'preferTypeParameter', + fix: fixer => { + const fixes = [ + fixer.removeRange([ + secondArg.range[0], + secondArg.expression.range[0], + ]), + fixer.removeRange([ + secondArg.expression.range[1], + secondArg.range[1], + ]), + ]; + if (!callee.parent.typeArguments) { + fixes.push(fixer.insertTextAfter(callee, `<${context.sourceCode.getText(secondArg.typeAnnotation)}>`)); + } + return fixes; + }, + }); + return; + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..411c2a1d1418bdd3e2152ec9eb685069fc0a58c0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"regExpExecOverStringMatch", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js new file mode 100644 index 0000000000000000000000000000000000000000..98392be5bbb9ecaf8caa40c1204dd233bbbde8b9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-regexp-exec.js @@ -0,0 +1,182 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +var ArgumentType; +(function (ArgumentType) { + ArgumentType[ArgumentType["Other"] = 0] = "Other"; + ArgumentType[ArgumentType["String"] = 1] = "String"; + ArgumentType[ArgumentType["RegExp"] = 2] = "RegExp"; + ArgumentType[ArgumentType["Both"] = 3] = "Both"; +})(ArgumentType || (ArgumentType = {})); +exports.default = (0, util_1.createRule)({ + name: 'prefer-regexp-exec', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce `RegExp#exec` over `String#match` if no global flag is provided', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + regExpExecOverStringMatch: 'Use the `RegExp#exec()` method instead.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const globalScope = context.sourceCode.getScope(context.sourceCode.ast); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + /** + * Check if a given node type is a string. + * @param type The node type to check. + */ + function isStringType(type) { + return (0, util_1.getTypeName)(checker, type) === 'string'; + } + /** + * Check if a given node type is a RegExp. + * @param type The node type to check. + */ + function isRegExpType(type) { + return (0, util_1.getTypeName)(checker, type) === 'RegExp'; + } + function collectArgumentTypes(types) { + let result = ArgumentType.Other; + for (const type of types) { + if (isRegExpType(type)) { + result |= ArgumentType.RegExp; + } + else if (isStringType(type)) { + result |= ArgumentType.String; + } + } + return result; + } + /** + * Returns true if and only if we have syntactic proof that the /g flag is + * absent. Returns false in all other cases (i.e. it still might or might + * not contain the global flag). + */ + function definitelyDoesNotContainGlobalFlag(node) { + if ((node.type === utils_1.AST_NODE_TYPES.CallExpression || + node.type === utils_1.AST_NODE_TYPES.NewExpression) && + node.callee.type === utils_1.AST_NODE_TYPES.Identifier && + node.callee.name === 'RegExp') { + const flags = node.arguments.at(1); + if (!flags) { + return true; + } + const flagsValue = (0, util_1.getStaticValue)(flags, globalScope); + return (!!flagsValue && + (typeof flagsValue.value !== 'string' || + !flagsValue.value.includes('g'))); + } + return false; + } + return { + 'CallExpression[arguments.length=1] > MemberExpression'(memberNode) { + if (!(0, util_1.isStaticMemberAccessOfValue)(memberNode, context, 'match')) { + return; + } + const objectNode = memberNode.object; + const callNode = memberNode.parent; + const [argumentNode] = callNode.arguments; + const argumentValue = (0, util_1.getStaticValue)(argumentNode, globalScope); + if (!isStringType(services.getTypeAtLocation(objectNode))) { + return; + } + // Don't report regular expressions with global flag. + if ((!argumentValue && + !definitelyDoesNotContainGlobalFlag(argumentNode)) || + (argumentValue && + argumentValue.value instanceof RegExp && + argumentValue.value.flags.includes('g'))) { + return; + } + if (argumentNode.type === utils_1.AST_NODE_TYPES.Literal && + typeof argumentNode.value === 'string') { + let regExp; + try { + regExp = RegExp(argumentNode.value); + } + catch { + return; + } + return context.report({ + node: memberNode.property, + messageId: 'regExpExecOverStringMatch', + fix: (0, util_1.getWrappingFixer)({ + node: callNode, + innerNode: [objectNode], + sourceCode: context.sourceCode, + wrap: objectCode => `${regExp.toString()}.exec(${objectCode})`, + }), + }); + } + const argumentType = services.getTypeAtLocation(argumentNode); + const argumentTypes = collectArgumentTypes(tsutils.unionConstituents(argumentType)); + switch (argumentTypes) { + case ArgumentType.RegExp: + return context.report({ + node: memberNode.property, + messageId: 'regExpExecOverStringMatch', + fix: (0, util_1.getWrappingFixer)({ + node: callNode, + innerNode: [objectNode, argumentNode], + sourceCode: context.sourceCode, + wrap: (objectCode, argumentCode) => `${argumentCode}.exec(${objectCode})`, + }), + }); + case ArgumentType.String: + return context.report({ + node: memberNode.property, + messageId: 'regExpExecOverStringMatch', + fix: (0, util_1.getWrappingFixer)({ + node: callNode, + innerNode: [objectNode, argumentNode], + sourceCode: context.sourceCode, + wrap: (objectCode, argumentCode) => `RegExp(${argumentCode}).exec(${objectCode})`, + }), + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fa654080da104f2bccfc2a65212f30dae5aabf74 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"useThisType", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.js new file mode 100644 index 0000000000000000000000000000000000000000..4344adf2f4308b7264ea64daf64f31bd4188f53f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-return-this-type.js @@ -0,0 +1,154 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const ts_api_utils_1 = require("ts-api-utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-return-this-type', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce that `this` is used when only `this` type is returned', + recommended: 'strict', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + useThisType: 'Use `this` type instead.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function tryGetNameInType(name, typeNode) { + if (typeNode.type === utils_1.AST_NODE_TYPES.TSTypeReference && + typeNode.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + typeNode.typeName.name === name) { + return typeNode; + } + if (typeNode.type === utils_1.AST_NODE_TYPES.TSUnionType) { + for (const type of typeNode.types) { + const found = tryGetNameInType(name, type); + if (found) { + return found; + } + } + } + return undefined; + } + function isThisSpecifiedInParameters(originalFunc) { + const firstArg = originalFunc.params.at(0); + return (firstArg?.type === utils_1.AST_NODE_TYPES.Identifier && firstArg.name === 'this'); + } + function isFunctionReturningThis(originalFunc, originalClass) { + if (isThisSpecifiedInParameters(originalFunc)) { + return false; + } + const func = services.esTreeNodeToTSNodeMap.get(originalFunc); + if (!func.body) { + return false; + } + const classType = services.getTypeAtLocation(originalClass); + if (func.body.kind !== ts.SyntaxKind.Block) { + const type = checker.getTypeAtLocation(func.body); + return classType.thisType === type; + } + let hasReturnThis = false; + let hasReturnClassType = false; + (0, util_1.forEachReturnStatement)(func.body, stmt => { + const expr = stmt.expression; + if (!expr) { + return; + } + // fast check + if (expr.kind === ts.SyntaxKind.ThisKeyword) { + hasReturnThis = true; + return; + } + const type = checker.getTypeAtLocation(expr); + if (classType === type) { + hasReturnClassType = true; + return true; + } + if (classType.thisType === type) { + hasReturnThis = true; + return; + } + if ((0, ts_api_utils_1.isUnionType)(type) && + type.types.some(typePart => typePart === classType)) { + hasReturnClassType = true; + return true; + } + return; + }); + return !hasReturnClassType && hasReturnThis; + } + function checkFunction(originalFunc, originalClass) { + const className = originalClass.id?.name; + if (!className || !originalFunc.returnType) { + return; + } + const node = tryGetNameInType(className, originalFunc.returnType.typeAnnotation); + if (!node) { + return; + } + if (isFunctionReturningThis(originalFunc, originalClass)) { + context.report({ + node, + messageId: 'useThisType', + fix: fixer => fixer.replaceText(node, 'this'), + }); + } + } + function checkProperty(node) { + if (!(node.value?.type === utils_1.AST_NODE_TYPES.FunctionExpression || + node.value?.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression)) { + return; + } + checkFunction(node.value, node.parent.parent); + } + return { + 'ClassBody > AccessorProperty': checkProperty, + 'ClassBody > MethodDefinition'(node) { + checkFunction(node.value, node.parent.parent); + }, + 'ClassBody > PropertyDefinition': checkProperty, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e152a125ba06a1501a5c531394058e57522f0aa0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.d.ts @@ -0,0 +1,12 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +type AllowedSingleElementEquality = 'always' | 'never'; +export type Options = [ + { + allowSingleElementEquality?: AllowedSingleElementEquality; + } +]; +export type MessageIds = 'preferEndsWith' | 'preferStartsWith'; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js new file mode 100644 index 0000000000000000000000000000000000000000..363b8de73e1c393df6b79b099c97c6c2a4bf97ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-string-starts-ends-with.js @@ -0,0 +1,512 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const regexpp_1 = require("@eslint-community/regexpp"); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +const EQ_OPERATORS = /^[=!]=/; +const regexpp = new regexpp_1.RegExpParser(); +exports.default = (0, util_1.createRule)({ + name: 'prefer-string-starts-ends-with', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce using `String#startsWith` and `String#endsWith` over other equivalent methods of checking substrings', + recommended: 'stylistic', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + preferEndsWith: "Use the 'String#endsWith' method instead.", + preferStartsWith: "Use 'String#startsWith' method instead.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowSingleElementEquality: { + type: 'string', + description: 'Whether to allow equality checks against the first or last element of a string.', + enum: ['always', 'never'], + }, + }, + }, + ], + }, + defaultOptions: [{ allowSingleElementEquality: 'never' }], + create(context, [{ allowSingleElementEquality }]) { + const globalScope = context.sourceCode.getScope(context.sourceCode.ast); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + /** + * Check if a given node is a string. + * @param node The node to check. + */ + function isStringType(node) { + const objectType = services.getTypeAtLocation(node); + return (0, util_1.getTypeName)(checker, objectType) === 'string'; + } + /** + * Check if a given node is a `Literal` node that is null. + * @param node The node to check. + */ + function isNull(node) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + return evaluated != null && evaluated.value == null; + } + /** + * Check if a given node is a `Literal` node that is a given value. + * @param node The node to check. + * @param value The expected value of the `Literal` node. + */ + function isNumber(node, value) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + return evaluated?.value === value; + } + /** + * Check if a given node is a `Literal` node that is a character. + * @param node The node to check. + */ + function isCharacter(node) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + return (evaluated != null && + typeof evaluated.value === 'string' && + // checks if the string is a character long + evaluated.value[0] === evaluated.value); + } + /** + * Check if a given node is `==`, `===`, `!=`, or `!==`. + * @param node The node to check. + */ + function isEqualityComparison(node) { + return (node.type === utils_1.AST_NODE_TYPES.BinaryExpression && + EQ_OPERATORS.test(node.operator)); + } + /** + * Check if two given nodes are the same meaning. + * @param node1 A node to compare. + * @param node2 Another node to compare. + */ + function isSameTokens(node1, node2) { + const tokens1 = context.sourceCode.getTokens(node1); + const tokens2 = context.sourceCode.getTokens(node2); + if (tokens1.length !== tokens2.length) { + return false; + } + for (let i = 0; i < tokens1.length; ++i) { + const token1 = tokens1[i]; + const token2 = tokens2[i]; + if (token1.type !== token2.type || token1.value !== token2.value) { + return false; + } + } + return true; + } + /** + * Check if a given node is the expression of the length of a string. + * + * - If `length` property access of `expectedObjectNode`, it's `true`. + * E.g., `foo` → `foo.length` / `"foo"` → `"foo".length` + * - If `expectedObjectNode` is a string literal, `node` can be a number. + * E.g., `"foo"` → `3` + * + * @param node The node to check. + * @param expectedObjectNode The node which is expected as the receiver of `length` property. + */ + function isLengthExpression(node, expectedObjectNode) { + if (node.type === utils_1.AST_NODE_TYPES.MemberExpression) { + return ((0, util_1.getPropertyName)(node, globalScope) === 'length' && + isSameTokens(node.object, expectedObjectNode)); + } + const evaluatedLength = (0, util_1.getStaticValue)(node, globalScope); + const evaluatedString = (0, util_1.getStaticValue)(expectedObjectNode, globalScope); + return (evaluatedLength != null && + evaluatedString != null && + typeof evaluatedLength.value === 'number' && + typeof evaluatedString.value === 'string' && + evaluatedLength.value === evaluatedString.value.length); + } + /** + * Returns true if `node` is `-substring.length` or + * `parentString.length - substring.length` + */ + function isLengthAheadOfEnd(node, substring, parentString) { + return ((node.type === utils_1.AST_NODE_TYPES.UnaryExpression && + node.operator === '-' && + isLengthExpression(node.argument, substring)) || + (node.type === utils_1.AST_NODE_TYPES.BinaryExpression && + node.operator === '-' && + isLengthExpression(node.left, parentString) && + isLengthExpression(node.right, substring))); + } + /** + * Check if a given node is the expression of the last index. + * + * E.g. `foo.length - 1` + * + * @param node The node to check. + * @param expectedObjectNode The node which is expected as the receiver of `length` property. + */ + function isLastIndexExpression(node, expectedObjectNode) { + return (node.type === utils_1.AST_NODE_TYPES.BinaryExpression && + node.operator === '-' && + isLengthExpression(node.left, expectedObjectNode) && + isNumber(node.right, 1)); + } + /** + * Get the range of the property of a given `MemberExpression` node. + * + * - `obj[foo]` → the range of `[foo]` + * - `obf.foo` → the range of `.foo` + * - `(obj).foo` → the range of `.foo` + * + * @param node The member expression node to get. + */ + function getPropertyRange(node) { + const dotOrOpenBracket = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.object, util_1.isNotClosingParenToken), util_1.NullThrowsReasons.MissingToken('closing parenthesis', 'member')); + return [dotOrOpenBracket.range[0], node.range[1]]; + } + /** + * Parse a given `RegExp` pattern to that string if it's a static string. + * @param pattern The RegExp pattern text to parse. + * @param unicode Whether the RegExp is unicode. + */ + function parseRegExpText(pattern, unicode) { + // Parse it. + const ast = regexpp.parsePattern(pattern, undefined, undefined, { + unicode, + }); + if (ast.alternatives.length !== 1) { + return null; + } + // Drop `^`/`$` assertion. + const chars = ast.alternatives[0].elements; + const first = chars[0]; + if (first.type === 'Assertion' && first.kind === 'start') { + chars.shift(); + } + else { + chars.pop(); + } + // Check if it can determine a unique string. + if (!chars.every(c => c.type === 'Character')) { + return null; + } + // To string. + return String.fromCodePoint(...chars.map(c => c.value)); + } + /** + * Parse a given node if it's a `RegExp` instance. + * @param node The node to parse. + */ + function parseRegExp(node) { + const evaluated = (0, util_1.getStaticValue)(node, globalScope); + if (evaluated == null || !(evaluated.value instanceof RegExp)) { + return null; + } + const { flags, source } = evaluated.value; + const isStartsWith = source.startsWith('^'); + const isEndsWith = source.endsWith('$'); + if (isStartsWith === isEndsWith || + flags.includes('i') || + flags.includes('m')) { + return null; + } + const text = parseRegExpText(source, flags.includes('u')); + if (text == null) { + return null; + } + return { isEndsWith, isStartsWith, text }; + } + function getLeftNode(init) { + const node = (0, util_1.skipChainExpression)(init); + const leftNode = node.type === utils_1.AST_NODE_TYPES.CallExpression ? node.callee : node; + if (leftNode.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + throw new Error(`Expected a MemberExpression, got ${leftNode.type}`); + } + return leftNode; + } + /** + * Fix code with using the right operand as the search string. + * For example: `foo.slice(0, 3) === 'bar'` → `foo.startsWith('bar')` + * @param fixer The rule fixer. + * @param node The node which was reported. + * @param kind The kind of the report. + * @param isNegative The flag to fix to negative condition. + */ + function* fixWithRightOperand(fixer, node, kind, isNegative, isOptional) { + // left is CallExpression or MemberExpression. + const leftNode = getLeftNode(node.left); + const propertyRange = getPropertyRange(leftNode); + if (isNegative) { + yield fixer.insertTextBefore(node, '!'); + } + yield fixer.replaceTextRange([propertyRange[0], node.right.range[0]], `${isOptional ? '?.' : '.'}${kind}sWith(`); + yield fixer.replaceTextRange([node.right.range[1], node.range[1]], ')'); + } + /** + * Fix code with using the first argument as the search string. + * For example: `foo.indexOf('bar') === 0` → `foo.startsWith('bar')` + * @param fixer The rule fixer. + * @param node The node which was reported. + * @param kind The kind of the report. + * @param negative The flag to fix to negative condition. + */ + function* fixWithArgument(fixer, node, callNode, calleeNode, kind, negative, isOptional) { + if (negative) { + yield fixer.insertTextBefore(node, '!'); + } + yield fixer.replaceTextRange(getPropertyRange(calleeNode), `${isOptional ? '?.' : '.'}${kind}sWith`); + yield fixer.removeRange([callNode.range[1], node.range[1]]); + } + function getParent(node) { + return node.parent.type === utils_1.AST_NODE_TYPES.ChainExpression + ? node.parent.parent + : node.parent; + } + return { + // foo[0] === "a" + // foo.charAt(0) === "a" + // foo[foo.length - 1] === "a" + // foo.charAt(foo.length - 1) === "a" + [[ + 'BinaryExpression > MemberExpression.left[computed=true]', + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="charAt"][computed=false]', + 'BinaryExpression > ChainExpression.left > MemberExpression[computed=true]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="charAt"][computed=false]', + ].join(', ')](node) { + let parentNode = getParent(node); + let indexNode = null; + if (parentNode.type === utils_1.AST_NODE_TYPES.CallExpression) { + if (parentNode.arguments.length === 1) { + indexNode = parentNode.arguments[0]; + } + parentNode = getParent(parentNode); + } + else { + indexNode = node.property; + } + if (indexNode == null || + !isEqualityComparison(parentNode) || + !isStringType(node.object)) { + return; + } + const isEndsWith = isLastIndexExpression(indexNode, node.object); + if (allowSingleElementEquality === 'always' && isEndsWith) { + return; + } + const isStartsWith = !isEndsWith && isNumber(indexNode, 0); + if ((allowSingleElementEquality === 'always' && isStartsWith) || + (!isStartsWith && !isEndsWith)) { + return; + } + const eqNode = parentNode; + context.report({ + node: parentNode, + messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith', + fix(fixer) { + // Don't fix if it can change the behavior. + if (!isCharacter(eqNode.right)) { + return null; + } + return fixWithRightOperand(fixer, eqNode, isStartsWith ? 'start' : 'end', eqNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // foo.indexOf('bar') === 0 + [[ + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="indexOf"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="indexOf"][computed=false]', + ].join(', ')](node) { + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (callNode.arguments.length !== 1 || + !isEqualityComparison(parentNode) || + !isNumber(parentNode.right, 0) || + !isStringType(node.object)) { + return; + } + context.report({ + node: parentNode, + messageId: 'preferStartsWith', + fix(fixer) { + return fixWithArgument(fixer, parentNode, callNode, node, 'start', parentNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // foo.lastIndexOf('bar') === foo.length - 3 + // foo.lastIndexOf(bar) === foo.length - bar.length + [[ + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="lastIndexOf"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="lastIndexOf"][computed=false]', + ].join(', ')](node) { + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (callNode.arguments.length !== 1 || + !isEqualityComparison(parentNode) || + parentNode.right.type !== utils_1.AST_NODE_TYPES.BinaryExpression || + parentNode.right.operator !== '-' || + !isLengthExpression(parentNode.right.left, node.object) || + !isLengthExpression(parentNode.right.right, callNode.arguments[0]) || + !isStringType(node.object)) { + return; + } + context.report({ + node: parentNode, + messageId: 'preferEndsWith', + fix(fixer) { + return fixWithArgument(fixer, parentNode, callNode, node, 'end', parentNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // foo.match(/^bar/) === null + // foo.match(/bar$/) === null + [[ + 'BinaryExpression > CallExpression.left > MemberExpression.callee[property.name="match"][computed=false]', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression.callee[property.name="match"][computed=false]', + ].join(', ')](node) { + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (!isNull(parentNode.right) || !isStringType(node.object)) { + return; + } + const parsed = callNode.arguments.length === 1 + ? parseRegExp(callNode.arguments[0]) + : null; + if (parsed == null) { + return; + } + const { isStartsWith, text } = parsed; + context.report({ + node: callNode, + messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith', + *fix(fixer) { + if (!parentNode.operator.startsWith('!')) { + yield fixer.insertTextBefore(parentNode, '!'); + } + yield fixer.replaceTextRange(getPropertyRange(node), `${node.optional ? '?.' : '.'}${isStartsWith ? 'start' : 'end'}sWith`); + yield fixer.replaceText(callNode.arguments[0], JSON.stringify(text)); + yield fixer.removeRange([callNode.range[1], parentNode.range[1]]); + }, + }); + }, + // foo.slice(0, 3) === 'bar' + // foo.slice(-3) === 'bar' + // foo.slice(-3, foo.length) === 'bar' + // foo.substring(0, 3) === 'bar' + // foo.substring(foo.length - 3) === 'bar' + // foo.substring(foo.length - 3, foo.length) === 'bar' + [[ + 'BinaryExpression > CallExpression.left > MemberExpression', + 'BinaryExpression > ChainExpression.left > CallExpression > MemberExpression', + ].join(', ')](node) { + if (!(0, util_1.isStaticMemberAccessOfValue)(node, context, 'slice', 'substring')) { + return; + } + const callNode = getParent(node); + const parentNode = getParent(callNode); + if (!isEqualityComparison(parentNode) || !isStringType(node.object)) { + return; + } + let isEndsWith = false; + let isStartsWith = false; + if (callNode.arguments.length === 1) { + if ( + // foo.slice(-bar.length) === bar + // foo.slice(foo.length - bar.length) === bar + isLengthAheadOfEnd(callNode.arguments[0], parentNode.right, node.object)) { + isEndsWith = true; + } + } + else if (callNode.arguments.length === 2) { + if ( + // foo.slice(0, bar.length) === bar + isNumber(callNode.arguments[0], 0) && + isLengthExpression(callNode.arguments[1], parentNode.right)) { + isStartsWith = true; + } + else if ( + // foo.slice(foo.length - bar.length, foo.length) === bar + // foo.slice(foo.length - bar.length, 0) === bar + // foo.slice(-bar.length, foo.length) === bar + // foo.slice(-bar.length, 0) === bar + (isLengthExpression(callNode.arguments[1], node.object) || + isNumber(callNode.arguments[1], 0)) && + isLengthAheadOfEnd(callNode.arguments[0], parentNode.right, node.object)) { + isEndsWith = true; + } + } + if (!isStartsWith && !isEndsWith) { + return; + } + const eqNode = parentNode; + const negativeIndexSupported = node.property.name === 'slice'; + context.report({ + node: parentNode, + messageId: isStartsWith ? 'preferStartsWith' : 'preferEndsWith', + fix(fixer) { + // Don't fix if it can change the behavior. + if (eqNode.operator.length === 2 && + (eqNode.right.type !== utils_1.AST_NODE_TYPES.Literal || + typeof eqNode.right.value !== 'string')) { + return null; + } + // code being checked is likely mistake: + // unequal length of strings being checked for equality + // or reliant on behavior of substring (negative indices interpreted as 0) + if (isStartsWith) { + if (!isLengthExpression(callNode.arguments[1], eqNode.right)) { + return null; + } + } + else { + const posNode = callNode.arguments[0]; + const posNodeIsAbsolutelyValid = (posNode.type === utils_1.AST_NODE_TYPES.BinaryExpression && + posNode.operator === '-' && + isLengthExpression(posNode.left, node.object) && + isLengthExpression(posNode.right, eqNode.right)) || + (negativeIndexSupported && + posNode.type === utils_1.AST_NODE_TYPES.UnaryExpression && + posNode.operator === '-' && + isLengthExpression(posNode.argument, eqNode.right)); + if (!posNodeIsAbsolutelyValid) { + return null; + } + } + return fixWithRightOperand(fixer, parentNode, isStartsWith ? 'start' : 'end', parentNode.operator.startsWith('!'), node.optional); + }, + }); + }, + // /^bar/.test(foo) + // /bar$/.test(foo) + 'CallExpression > MemberExpression.callee[property.name="test"][computed=false]'(node) { + const callNode = getParent(node); + const parsed = callNode.arguments.length === 1 ? parseRegExp(node.object) : null; + if (parsed == null) { + return; + } + const { isStartsWith, text } = parsed; + const messageId = isStartsWith ? 'preferStartsWith' : 'preferEndsWith'; + const methodName = isStartsWith ? 'startsWith' : 'endsWith'; + context.report({ + node: callNode, + messageId, + *fix(fixer) { + const argNode = callNode.arguments[0]; + const needsParen = argNode.type !== utils_1.AST_NODE_TYPES.Literal && + argNode.type !== utils_1.AST_NODE_TYPES.TemplateLiteral && + argNode.type !== utils_1.AST_NODE_TYPES.Identifier && + argNode.type !== utils_1.AST_NODE_TYPES.MemberExpression && + argNode.type !== utils_1.AST_NODE_TYPES.CallExpression; + yield fixer.removeRange([callNode.range[0], argNode.range[0]]); + if (needsParen) { + yield fixer.insertTextBefore(argNode, '('); + yield fixer.insertTextAfter(argNode, ')'); + } + yield fixer.insertTextAfter(argNode, `${node.optional ? '?.' : '.'}${methodName}(${JSON.stringify(text)}`); + }, + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95bb56307b7f1f316cb650a77f9e75892ad02740 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.d.ts @@ -0,0 +1,5 @@ +export type MessageIds = 'preferExpectErrorComment'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferExpectErrorComment", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js new file mode 100644 index 0000000000000000000000000000000000000000..4a07f164c6dc76afe089a0b95d7c7b4fc77265f1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/prefer-ts-expect-error.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'prefer-ts-expect-error', + meta: { + type: 'problem', + deprecated: { + deprecatedSince: '7.11.0', + replacedBy: [ + { + rule: { + name: '@typescript-eslint/ban-ts-comment', + url: 'https://typescript-eslint.io/rules/ban-ts-comment', + }, + }, + ], + url: 'https://github.com/typescript-eslint/typescript-eslint/pull/9081', + }, + docs: { + description: 'Enforce using `@ts-expect-error` over `@ts-ignore`', + }, + fixable: 'code', + messages: { + preferExpectErrorComment: 'Use "@ts-expect-error" to ensure an error is actually being suppressed.', + }, + replacedBy: ['@typescript-eslint/ban-ts-comment'], + schema: [], + }, + defaultOptions: [], + create(context) { + const tsIgnoreRegExpSingleLine = /^\s*\/?\s*@ts-ignore/; + const tsIgnoreRegExpMultiLine = /^\s*(?:\/|\*)*\s*@ts-ignore/; + function isLineComment(comment) { + return comment.type === utils_1.AST_TOKEN_TYPES.Line; + } + function getLastCommentLine(comment) { + if (isLineComment(comment)) { + return comment.value; + } + // For multiline comments - we look at only the last line. + const commentlines = comment.value.split(utils_1.ASTUtils.LINEBREAK_MATCHER); + return commentlines[commentlines.length - 1]; + } + function isValidTsIgnorePresent(comment) { + const line = getLastCommentLine(comment); + return isLineComment(comment) + ? tsIgnoreRegExpSingleLine.test(line) + : tsIgnoreRegExpMultiLine.test(line); + } + return { + Program() { + const comments = context.sourceCode.getAllComments(); + comments.forEach(comment => { + if (isValidTsIgnorePresent(comment)) { + const lineCommentRuleFixer = (fixer) => fixer.replaceText(comment, `//${comment.value.replace('@ts-ignore', '@ts-expect-error')}`); + const blockCommentRuleFixer = (fixer) => fixer.replaceText(comment, `/*${comment.value.replace('@ts-ignore', '@ts-expect-error')}*/`); + context.report({ + node: comment, + messageId: 'preferExpectErrorComment', + fix: isLineComment(comment) + ? lineCommentRuleFixer + : blockCommentRuleFixer, + }); + } + }); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..60ae3b7d76d416cf01f0cac59f9220ec62522eab --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.d.ts @@ -0,0 +1,15 @@ +export type Options = [ + { + allowAny?: boolean; + allowedPromiseNames?: string[]; + checkArrowFunctions?: boolean; + checkFunctionDeclarations?: boolean; + checkFunctionExpressions?: boolean; + checkMethodDeclarations?: boolean; + } +]; +export type MessageIds = 'missingAsync' | 'missingAsyncHybridReturn'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js new file mode 100644 index 0000000000000000000000000000000000000000..b7418ad358a791d1b8b87078b6fda1566b36b2e0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/promise-function-async.js @@ -0,0 +1,204 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'promise-function-async', + meta: { + type: 'suggestion', + docs: { + description: 'Require any function or method that returns a Promise to be marked async', + requiresTypeChecking: true, + }, + fixable: 'code', + messages: { + missingAsync: 'Functions that return promises must be async.', + missingAsyncHybridReturn: 'Functions that return promises must be async. Consider adding an explicit return type annotation if the function is intended to return a union of promise and non-promise types.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowAny: { + type: 'boolean', + description: 'Whether to consider `any` and `unknown` to be Promises.', + }, + allowedPromiseNames: { + type: 'array', + description: 'Any extra names of classes or interfaces to be considered Promises.', + items: { + type: 'string', + }, + }, + checkArrowFunctions: { + type: 'boolean', + description: 'Whether to check arrow functions.', + }, + checkFunctionDeclarations: { + type: 'boolean', + description: 'Whether to check standalone function declarations.', + }, + checkFunctionExpressions: { + type: 'boolean', + description: 'Whether to check inline function expressions', + }, + checkMethodDeclarations: { + type: 'boolean', + description: 'Whether to check methods on classes and object literals.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowAny: true, + allowedPromiseNames: [], + checkArrowFunctions: true, + checkFunctionDeclarations: true, + checkFunctionExpressions: true, + checkMethodDeclarations: true, + }, + ], + create(context, [{ allowAny, allowedPromiseNames, checkArrowFunctions, checkFunctionDeclarations, checkFunctionExpressions, checkMethodDeclarations, },]) { + const allAllowedPromiseNames = new Set([ + 'Promise', + // https://github.com/typescript-eslint/typescript-eslint/issues/5439 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + ...allowedPromiseNames, + ]); + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + function validateNode(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition) { + // Abstract method can't be async + return; + } + if ((node.parent.type === utils_1.AST_NODE_TYPES.Property || + node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition) && + (node.parent.kind === 'get' || node.parent.kind === 'set')) { + // Getters and setters can't be async + return; + } + const signatures = services.getTypeAtLocation(node).getCallSignatures(); + if (!signatures.length) { + return; + } + const returnTypes = signatures.map(signature => checker.getReturnTypeOfSignature(signature)); + if (!allowAny && + returnTypes.some(type => (0, util_1.isTypeFlagSet)(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown))) { + // Report without auto fixer because the return type is unknown + return context.report({ + loc: (0, util_1.getFunctionHeadLoc)(node, context.sourceCode), + node, + messageId: 'missingAsync', + }); + } + if ( + // require all potential return types to be promise/any/unknown + returnTypes.every(type => (0, util_1.containsAllTypesByName)(type, true, allAllowedPromiseNames, + // If no return type is explicitly set, we check if any parts of the return type match a Promise (instead of requiring all to match). + node.returnType == null))) { + const isHybridReturnType = returnTypes.some(type => type.isUnion() && + !type.types.every(part => (0, util_1.containsAllTypesByName)(part, true, allAllowedPromiseNames))); + context.report({ + loc: (0, util_1.getFunctionHeadLoc)(node, context.sourceCode), + node, + messageId: isHybridReturnType + ? 'missingAsyncHybridReturn' + : 'missingAsync', + fix: fixer => { + if (node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition || + (node.parent.type === utils_1.AST_NODE_TYPES.Property && + node.parent.method)) { + // this function is a class method or object function property shorthand + const method = node.parent; + // the token to put `async` before + let keyToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(method), util_1.NullThrowsReasons.MissingToken('key token', 'method')); + // if there are decorators then skip past them + if (method.type === utils_1.AST_NODE_TYPES.MethodDefinition && + method.decorators.length) { + const lastDecorator = method.decorators[method.decorators.length - 1]; + keyToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(lastDecorator), util_1.NullThrowsReasons.MissingToken('key token', 'last decorator')); + } + // if current token is a keyword like `static` or `public`, or the `override` modifier, then skip it + while ((keyToken.type === utils_1.AST_TOKEN_TYPES.Keyword || + (keyToken.type === utils_1.AST_TOKEN_TYPES.Identifier && + keyToken.value === 'override')) && + keyToken.range[0] < method.key.range[0]) { + keyToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(keyToken), util_1.NullThrowsReasons.MissingToken('token', 'modifier keyword')); + } + // check if there is a space between key and previous token + const insertSpace = !context.sourceCode.isSpaceBetween((0, util_1.nullThrows)(context.sourceCode.getTokenBefore(keyToken), util_1.NullThrowsReasons.MissingToken('token', 'keyword')), keyToken); + let code = 'async '; + if (insertSpace) { + code = ` ${code}`; + } + return fixer.insertTextBefore(keyToken, code); + } + return fixer.insertTextBefore(node, 'async '); + }, + }); + } + } + return { + ...(checkArrowFunctions && { + 'ArrowFunctionExpression[async = false]'(node) { + validateNode(node); + }, + }), + ...(checkFunctionDeclarations && { + 'FunctionDeclaration[async = false]'(node) { + validateNode(node); + }, + }), + 'FunctionExpression[async = false]'(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition && + node.parent.kind === 'method') { + if (checkMethodDeclarations) { + validateNode(node); + } + return; + } + if (checkFunctionExpressions) { + validateNode(node); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3878d5b6611b2be5ef72b5c67c1a88e39fe6add9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"mismatch", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.js new file mode 100644 index 0000000000000000000000000000000000000000..b0328ce1616fa0b951b49a3845d6e99f6b570d50 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/related-getter-setter-pairs.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'related-getter-setter-pairs', + meta: { + type: 'problem', + docs: { + description: 'Enforce that `get()` types should be assignable to their equivalent `set()` type', + recommended: 'strict', + requiresTypeChecking: true, + }, + messages: { + mismatch: '`get()` type should be assignable to its equivalent `set()` type.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const methodPairsStack = []; + function addPropertyNode(member, inner, kind) { + const methodPairs = methodPairsStack[methodPairsStack.length - 1]; + const { name } = (0, util_1.getNameFromMember)(member, context.sourceCode); + methodPairs.set(name, { + ...methodPairs.get(name), + [kind]: inner, + }); + } + return { + ':matches(ClassBody, TSInterfaceBody, TSTypeLiteral):exit'() { + const methodPairs = methodPairsStack[methodPairsStack.length - 1]; + for (const pair of methodPairs.values()) { + if (!pair.get || !pair.set) { + continue; + } + const getter = pair.get; + const getType = services.getTypeAtLocation(getter); + const setType = services.getTypeAtLocation(pair.set.params[0]); + if (!checker.isTypeAssignableTo(getType, setType)) { + context.report({ + node: getter.returnType.typeAnnotation, + messageId: 'mismatch', + }); + } + } + methodPairsStack.pop(); + }, + ':matches(MethodDefinition, TSMethodSignature)[kind=get]'(node) { + const getter = getMethodFromNode(node); + if (getter.returnType) { + addPropertyNode(node, getter, 'get'); + } + }, + ':matches(MethodDefinition, TSMethodSignature)[kind=set]'(node) { + const setter = getMethodFromNode(node); + if (setter.params.length === 1) { + addPropertyNode(node, setter, 'set'); + } + }, + 'ClassBody, TSInterfaceBody, TSTypeLiteral'() { + methodPairsStack.push(new Map()); + }, + }; + }, +}); +function getMethodFromNode(node) { + return node.type === utils_1.AST_NODE_TYPES.TSMethodSignature ? node : node.value; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..59d778e438c7bded6cd0314cef4a6a104986a8a4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.d.ts @@ -0,0 +1,10 @@ +export type Options = [ + { + ignoreStringArrays?: boolean; + } +]; +export type MessageIds = 'requireCompare'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"requireCompare", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js new file mode 100644 index 0000000000000000000000000000000000000000..eff6280bcb91f02c9949303267c00001d5f7c90c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-array-sort-compare.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'require-array-sort-compare', + meta: { + type: 'problem', + docs: { + description: 'Require `Array#sort` and `Array#toSorted` calls to always provide a `compareFunction`', + requiresTypeChecking: true, + }, + messages: { + requireCompare: "Require 'compare' argument.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoreStringArrays: { + type: 'boolean', + description: 'Whether to ignore arrays in which all elements are strings.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoreStringArrays: true, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + /** + * Check if a given node is an array which all elements are string. + */ + function isStringArrayNode(node) { + const type = services.getTypeAtLocation(node); + if (checker.isArrayType(type) || checker.isTupleType(type)) { + const typeArgs = checker.getTypeArguments(type); + return typeArgs.every(arg => (0, util_1.getTypeName)(checker, arg) === 'string'); + } + return false; + } + function checkSortArgument(callee) { + if (!(0, util_1.isStaticMemberAccessOfValue)(callee, context, 'sort', 'toSorted')) { + return; + } + const calleeObjType = (0, util_1.getConstrainedTypeAtLocation)(services, callee.object); + if (options.ignoreStringArrays && isStringArrayNode(callee.object)) { + return; + } + if ((0, util_1.isTypeArrayTypeOrUnionOfArrayTypes)(calleeObjType, checker)) { + context.report({ node: callee.parent, messageId: 'requireCompare' }); + } + } + return { + 'CallExpression[arguments.length=0] > MemberExpression': checkSortArgument, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b28e80673b41bb7f165becaee520d2c286cddbf --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingAwait" | "removeAsync", [], import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js new file mode 100644 index 0000000000000000000000000000000000000000..afc5dffe97058856389ec9f77bb68e262c9dd016 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/require-await.js @@ -0,0 +1,263 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'require-await', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow async functions which do not return promises and have no `await` expression', + extendsBaseRule: true, + recommended: 'recommended', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + missingAwait: "{{name}} has no 'await' expression.", + removeAsync: "Remove 'async'.", + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + let scopeInfo = null; + /** + * Push the scope info object to the stack. + */ + function enterFunction(node) { + scopeInfo = { + hasAsync: node.async, + hasAwait: false, + isAsyncYield: false, + isGen: node.generator || false, + upper: scopeInfo, + }; + } + /** + * Pop the top scope info object from the stack. + * Also, it reports the function if needed. + */ + function exitFunction(node) { + /* istanbul ignore if */ if (!scopeInfo) { + // this shouldn't ever happen, as we have to exit a function after we enter it + return; + } + if (node.async && + !scopeInfo.hasAwait && + !isEmptyFunction(node) && + !(scopeInfo.isGen && scopeInfo.isAsyncYield)) { + // If the function belongs to a method definition or + // property, then the function's range may not include the + // `async` keyword and we should look at the parent instead. + const nodeWithAsyncKeyword = (node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition && + node.parent.value === node) || + (node.parent.type === utils_1.AST_NODE_TYPES.Property && + node.parent.method && + node.parent.value === node) + ? node.parent + : node; + const asyncToken = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(nodeWithAsyncKeyword, token => token.value === 'async'), 'The node is an async function, so it must have an "async" token.'); + const asyncRange = [ + asyncToken.range[0], + (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(asyncToken, { + includeComments: true, + }), 'There will always be a token after the "async" keyword.').range[0], + ]; + // Removing the `async` keyword can cause parsing errors if the + // current statement is relying on automatic semicolon insertion. + // If ASI is currently being used, then we should replace the + // `async` keyword with a semicolon. + const nextToken = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(asyncToken), 'There will always be a token after the "async" keyword.'); + const addSemiColon = nextToken.type === utils_1.AST_TOKEN_TYPES.Punctuator && + (nextToken.value === '[' || nextToken.value === '(') && + (nodeWithAsyncKeyword.type === utils_1.AST_NODE_TYPES.MethodDefinition || + (0, util_1.isStartOfExpressionStatement)(nodeWithAsyncKeyword)) && + (0, util_1.needsPrecedingSemicolon)(context.sourceCode, nodeWithAsyncKeyword); + const changes = [ + { range: asyncRange, replacement: addSemiColon ? ';' : undefined }, + ]; + // If there's a return type annotation and it's a + // `Promise`, we can also change the return type + // annotation to just `T` as part of the suggestion. + // Alternatively, if the function is a generator and + // the return type annotation is `AsyncGenerator`, + // then we can change it to `Generator`. + if (node.returnType?.typeAnnotation.type === + utils_1.AST_NODE_TYPES.TSTypeReference) { + if (scopeInfo.isGen) { + if (hasTypeName(node.returnType.typeAnnotation, 'AsyncGenerator')) { + changes.push({ + range: node.returnType.typeAnnotation.typeName.range, + replacement: 'Generator', + }); + } + } + else if (hasTypeName(node.returnType.typeAnnotation, 'Promise') && + node.returnType.typeAnnotation.typeArguments != null) { + const openAngle = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(node.returnType.typeAnnotation, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === '<'), 'There are type arguments, so the angle bracket will exist.'); + const closeAngle = (0, util_1.nullThrows)(context.sourceCode.getLastToken(node.returnType.typeAnnotation, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator && + token.value === '>'), 'There are type arguments, so the angle bracket will exist.'); + changes.push( + // Remove the closing angled bracket. + { range: closeAngle.range, replacement: undefined }, + // Remove the "Promise" identifier + // and the opening angled bracket. + { + range: [ + node.returnType.typeAnnotation.typeName.range[0], + openAngle.range[1], + ], + replacement: undefined, + }); + } + } + context.report({ + loc: (0, util_1.getFunctionHeadLoc)(node, context.sourceCode), + node, + messageId: 'missingAwait', + data: { + name: (0, util_1.upperCaseFirst)((0, util_1.getFunctionNameWithKind)(node)), + }, + suggest: [ + { + messageId: 'removeAsync', + fix: (fixer) => changes.map(change => change.replacement != null + ? fixer.replaceTextRange(change.range, change.replacement) + : fixer.removeRange(change.range)), + }, + ], + }); + } + scopeInfo = scopeInfo.upper; + } + /** + * Checks if the node returns a thenable type + */ + function isThenableType(node) { + const type = checker.getTypeAtLocation(node); + return tsutils.isThenableType(checker, node, type); + } + /** + * Marks the current scope as having an await + */ + function markAsHasAwait() { + if (!scopeInfo) { + return; + } + scopeInfo.hasAwait = true; + } + /** + * Mark `scopeInfo.isAsyncYield` to `true` if it + * 1) delegates async generator function + * or + * 2) yields thenable type + */ + function visitYieldExpression(node) { + if (!scopeInfo?.isGen || !node.argument) { + return; + } + if (node.argument.type === utils_1.AST_NODE_TYPES.Literal) { + // ignoring this as for literals we don't need to check the definition + // eg : async function* run() { yield* 1 } + return; + } + if (!node.delegate) { + if (isThenableType(services.esTreeNodeToTSNodeMap.get(node.argument))) { + scopeInfo.isAsyncYield = true; + } + return; + } + const type = services.getTypeAtLocation(node.argument); + const typesToCheck = expandUnionOrIntersectionType(type); + for (const type of typesToCheck) { + const asyncIterator = tsutils.getWellKnownSymbolPropertyOfType(type, 'asyncIterator', checker); + if (asyncIterator != null) { + scopeInfo.isAsyncYield = true; + break; + } + } + } + return { + ArrowFunctionExpression: enterFunction, + 'ArrowFunctionExpression:exit': exitFunction, + AwaitExpression: markAsHasAwait, + 'ForOfStatement[await = true]': markAsHasAwait, + FunctionDeclaration: enterFunction, + 'FunctionDeclaration:exit': exitFunction, + FunctionExpression: enterFunction, + 'FunctionExpression:exit': exitFunction, + 'VariableDeclaration[kind = "await using"]': markAsHasAwait, + YieldExpression: visitYieldExpression, + // check body-less async arrow function. + // ignore `async () => await foo` because it's obviously correct + 'ArrowFunctionExpression[async = true] > :not(BlockStatement, AwaitExpression)'(node) { + const expression = services.esTreeNodeToTSNodeMap.get(node); + if (isThenableType(expression)) { + markAsHasAwait(); + } + }, + ReturnStatement(node) { + // short circuit early to avoid unnecessary type checks + if (!scopeInfo || scopeInfo.hasAwait || !scopeInfo.hasAsync) { + return; + } + const { expression } = services.esTreeNodeToTSNodeMap.get(node); + if (expression && isThenableType(expression)) { + markAsHasAwait(); + } + }, + }; + }, +}); +function isEmptyFunction(node) { + return (node.body.type === utils_1.AST_NODE_TYPES.BlockStatement && + node.body.body.length === 0); +} +function expandUnionOrIntersectionType(type) { + if (type.isUnionOrIntersection()) { + return type.types.flatMap(expandUnionOrIntersectionType); + } + return [type]; +} +function hasTypeName(typeReference, typeName) { + return (typeReference.typeName.type === utils_1.AST_NODE_TYPES.Identifier && + typeReference.typeName.name === typeName); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4b2ceb56991f633716aa029784257c00cd1559d7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.d.ts @@ -0,0 +1,15 @@ +export type Options = [ + { + allowAny?: boolean; + allowBoolean?: boolean; + allowNullish?: boolean; + allowNumberAndString?: boolean; + allowRegExp?: boolean; + skipCompoundAssignments?: boolean; + } +]; +export type MessageIds = 'bigintAndNumber' | 'invalid' | 'mismatched'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js new file mode 100644 index 0000000000000000000000000000000000000000..8b05a736e091f898a2c55de010882ce0f9ec8af6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-plus-operands.js @@ -0,0 +1,231 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'restrict-plus-operands', + meta: { + type: 'problem', + docs: { + description: 'Require both operands of addition to be the same type and be `bigint`, `number`, or `string`', + recommended: { + recommended: true, + strict: [ + { + allowAny: false, + allowBoolean: false, + allowNullish: false, + allowNumberAndString: false, + allowRegExp: false, + }, + ], + }, + requiresTypeChecking: true, + }, + messages: { + bigintAndNumber: "Numeric '+' operations must either be both bigints or both numbers. Got `{{left}}` + `{{right}}`.", + invalid: "Invalid operand for a '+' operation. Operands must each be a number or {{stringLike}}. Got `{{type}}`.", + mismatched: "Operands of '+' operations must be a number or {{stringLike}}. Got `{{left}}` + `{{right}}`.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowAny: { + type: 'boolean', + description: 'Whether to allow `any` typed values.', + }, + allowBoolean: { + type: 'boolean', + description: 'Whether to allow `boolean` typed values.', + }, + allowNullish: { + type: 'boolean', + description: 'Whether to allow potentially `null` or `undefined` typed values.', + }, + allowNumberAndString: { + type: 'boolean', + description: 'Whether to allow `bigint`/`number` typed values and `string` typed values to be added together.', + }, + allowRegExp: { + type: 'boolean', + description: 'Whether to allow `regexp` typed values.', + }, + skipCompoundAssignments: { + type: 'boolean', + description: 'Whether to skip compound assignments such as `+=`.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowAny: true, + allowBoolean: true, + allowNullish: true, + allowNumberAndString: true, + allowRegExp: true, + skipCompoundAssignments: false, + }, + ], + create(context, [{ allowAny, allowBoolean, allowNullish, allowNumberAndString, allowRegExp, skipCompoundAssignments, },]) { + const services = (0, util_1.getParserServices)(context); + const typeChecker = services.program.getTypeChecker(); + const stringLikes = [ + allowAny && '`any`', + allowBoolean && '`boolean`', + allowNullish && '`null`', + allowRegExp && '`RegExp`', + allowNullish && '`undefined`', + ].filter((value) => typeof value === 'string'); + const stringLike = stringLikes.length + ? stringLikes.length === 1 + ? `string, allowing a string + ${stringLikes[0]}` + : `string, allowing a string + any of: ${stringLikes.join(', ')}` + : 'string'; + function getTypeConstrained(node) { + return typeChecker.getBaseTypeOfLiteralType((0, util_1.getConstrainedTypeAtLocation)(services, node)); + } + function checkPlusOperands(node) { + const leftType = getTypeConstrained(node.left); + const rightType = getTypeConstrained(node.right); + if (leftType === rightType && + tsutils.isTypeFlagSet(leftType, ts.TypeFlags.BigIntLike | + ts.TypeFlags.NumberLike | + ts.TypeFlags.StringLike)) { + return; + } + let hadIndividualComplaint = false; + for (const [baseNode, baseType, otherType] of [ + [node.left, leftType, rightType], + [node.right, rightType, leftType], + ]) { + if (isTypeFlagSetInUnion(baseType, ts.TypeFlags.ESSymbolLike | + ts.TypeFlags.Never | + ts.TypeFlags.Unknown) || + (!allowAny && isTypeFlagSetInUnion(baseType, ts.TypeFlags.Any)) || + (!allowBoolean && + isTypeFlagSetInUnion(baseType, ts.TypeFlags.BooleanLike)) || + (!allowNullish && + (0, util_1.isTypeFlagSet)(baseType, ts.TypeFlags.Null | ts.TypeFlags.Undefined))) { + context.report({ + node: baseNode, + messageId: 'invalid', + data: { + type: typeChecker.typeToString(baseType), + stringLike, + }, + }); + hadIndividualComplaint = true; + continue; + } + // RegExps also contain ts.TypeFlags.Any & ts.TypeFlags.Object + for (const subBaseType of tsutils.unionConstituents(baseType)) { + const typeName = (0, util_1.getTypeName)(typeChecker, subBaseType); + if (typeName === 'RegExp' + ? !allowRegExp || + tsutils.isTypeFlagSet(otherType, ts.TypeFlags.NumberLike) + : (!allowAny && (0, util_1.isTypeAnyType)(subBaseType)) || + isDeeplyObjectType(subBaseType)) { + context.report({ + node: baseNode, + messageId: 'invalid', + data: { + type: typeChecker.typeToString(subBaseType), + stringLike, + }, + }); + hadIndividualComplaint = true; + continue; + } + } + } + if (hadIndividualComplaint) { + return; + } + for (const [baseType, otherType] of [ + [leftType, rightType], + [rightType, leftType], + ]) { + if (!allowNumberAndString && + isTypeFlagSetInUnion(baseType, ts.TypeFlags.StringLike) && + isTypeFlagSetInUnion(otherType, ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike)) { + return context.report({ + node, + messageId: 'mismatched', + data: { + left: typeChecker.typeToString(leftType), + right: typeChecker.typeToString(rightType), + stringLike, + }, + }); + } + if (isTypeFlagSetInUnion(baseType, ts.TypeFlags.NumberLike) && + isTypeFlagSetInUnion(otherType, ts.TypeFlags.BigIntLike)) { + return context.report({ + node, + messageId: 'bigintAndNumber', + data: { + left: typeChecker.typeToString(leftType), + right: typeChecker.typeToString(rightType), + }, + }); + } + } + } + return { + "BinaryExpression[operator='+']": checkPlusOperands, + ...(!skipCompoundAssignments && { + "AssignmentExpression[operator='+=']"(node) { + checkPlusOperands(node); + }, + }), + }; + }, +}); +function isDeeplyObjectType(type) { + return type.isIntersection() + ? tsutils.intersectionConstituents(type).every(tsutils.isObjectType) + : tsutils.unionConstituents(type).every(tsutils.isObjectType); +} +function isTypeFlagSetInUnion(type, flag) { + return tsutils + .unionConstituents(type) + .some(subType => tsutils.isTypeFlagSet(subType, flag)); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e0ccecd059ebccc89d6a928153ecc0470fb3fd4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.d.ts @@ -0,0 +1,19 @@ +import type { Type, TypeChecker } from 'typescript'; +import type { TypeOrValueSpecifier } from '../util'; +import { isTypeAnyType, isTypeNeverType } from '../util'; +type OptionTester = (type: Type, checker: TypeChecker, recursivelyCheckType: (type: Type) => boolean) => boolean; +declare const optionTesters: { + type: "Array" | "RegExp" | "Boolean" | "Number" | "Any" | "Nullish" | "Never"; + option: "allowAny" | "allowBoolean" | "allowNullish" | "allowRegExp" | "allowNever" | "allowNumber" | "allowArray"; + tester: typeof isTypeAnyType | typeof isTypeNeverType | OptionTester | ((type: Type, checker: TypeChecker, recursivelyCheckType: (type: Type) => boolean) => boolean) | ((type: Type, checker: TypeChecker) => boolean); +}[]; +export type Options = [ + { + allow?: TypeOrValueSpecifier[]; + } & Partial> +]; +export type MessageId = 'invalidType'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidType", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js new file mode 100644 index 0000000000000000000000000000000000000000..95d3e2b804c5a138a4994ac664cd947e6e526ba9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/restrict-template-expressions.js @@ -0,0 +1,119 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const type_utils_1 = require("@typescript-eslint/type-utils"); +const utils_1 = require("@typescript-eslint/utils"); +const typescript_1 = require("typescript"); +const util_1 = require("../util"); +const testTypeFlag = (flagsToCheck) => type => (0, util_1.isTypeFlagSet)(type, flagsToCheck); +const optionTesters = [ + ['Any', util_1.isTypeAnyType], + [ + 'Array', + (type, checker, recursivelyCheckType) => (checker.isArrayType(type) || checker.isTupleType(type)) && + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + recursivelyCheckType(type.getNumberIndexType()), + ], + // eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum + ['Boolean', testTypeFlag(typescript_1.TypeFlags.BooleanLike)], + ['Nullish', testTypeFlag(typescript_1.TypeFlags.Null | typescript_1.TypeFlags.Undefined)], + ['Number', testTypeFlag(typescript_1.TypeFlags.NumberLike | typescript_1.TypeFlags.BigIntLike)], + [ + 'RegExp', + (type, checker) => (0, util_1.getTypeName)(checker, type) === 'RegExp', + ], + ['Never', util_1.isTypeNeverType], +].map(([type, tester]) => ({ + type, + option: `allow${type}`, + tester, +})); +exports.default = (0, util_1.createRule)({ + name: 'restrict-template-expressions', + meta: { + type: 'problem', + docs: { + description: 'Enforce template literal expressions to be of `string` type', + recommended: { + recommended: true, + strict: [ + { + allowAny: false, + allowBoolean: false, + allowNever: false, + allowNullish: false, + allowNumber: false, + allowRegExp: false, + }, + ], + }, + requiresTypeChecking: true, + }, + messages: { + invalidType: 'Invalid type "{{type}}" of template literal expression.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ...Object.fromEntries(optionTesters.map(({ type, option }) => [ + option, + { + type: 'boolean', + description: `Whether to allow \`${type.toLowerCase()}\` typed values in template expressions.`, + }, + ])), + allow: { + description: `Types to allow in template expressions.`, + ...type_utils_1.typeOrValueSpecifiersSchema, + }, + }, + }, + ], + }, + defaultOptions: [ + { + allow: [{ name: ['Error', 'URL', 'URLSearchParams'], from: 'lib' }], + allowAny: true, + allowBoolean: true, + allowNullish: true, + allowNumber: true, + allowRegExp: true, + }, + ], + create(context, [{ allow, ...options }]) { + const services = (0, util_1.getParserServices)(context); + const { program } = services; + const checker = program.getTypeChecker(); + const enabledOptionTesters = optionTesters.filter(({ option }) => options[option]); + return { + TemplateLiteral(node) { + // don't check tagged template literals + if (node.parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression) { + return; + } + for (const expression of node.expressions) { + const expressionType = (0, util_1.getConstrainedTypeAtLocation)(services, expression); + if (!recursivelyCheckType(expressionType)) { + context.report({ + node: expression, + messageId: 'invalidType', + data: { type: checker.typeToString(expressionType) }, + }); + } + } + }, + }; + function recursivelyCheckType(innerType) { + if (innerType.isUnion()) { + return innerType.types.every(recursivelyCheckType); + } + if (innerType.isIntersection()) { + return innerType.types.some(recursivelyCheckType); + } + return ((0, util_1.isTypeFlagSet)(innerType, typescript_1.TypeFlags.StringLike) || + (0, util_1.matchesTypeOrBaseType)(services, type => (0, type_utils_1.typeMatchesSomeSpecifier)(type, allow, program), innerType) || + enabledOptionTesters.some(({ tester }) => tester(innerType, checker, recursivelyCheckType))); + } + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e865c0c4f1b3e5a7576c5e79549301ed7d5506e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.d.ts @@ -0,0 +1,5 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule<"disallowedPromiseAwait" | "disallowedPromiseAwaitSuggestion" | "nonPromiseAwait" | "requiredPromiseAwait" | "requiredPromiseAwaitSuggestion", [string], import("../../rules").ESLintPluginDocs, TSESLint.RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js new file mode 100644 index 0000000000000000000000000000000000000000..954a50d028532139484ea00135c5b035ab5d2166 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/return-await.js @@ -0,0 +1,363 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'return-await', + meta: { + type: 'problem', + docs: { + description: 'Enforce consistent awaiting of returned promises', + recommended: { + strict: ['error-handling-correctness-only'], + }, + requiresTypeChecking: true, + }, + fixable: 'code', + // eslint-disable-next-line eslint-plugin/require-meta-has-suggestions -- suggestions are exposed through a helper. + hasSuggestions: true, + messages: { + disallowedPromiseAwait: 'Returning an awaited promise is not allowed in this context.', + disallowedPromiseAwaitSuggestion: 'Remove `await` before the expression. Use caution as this may impact control flow.', + nonPromiseAwait: 'Returning an awaited value that is not a promise is not allowed.', + requiredPromiseAwait: 'Returning an awaited promise is required in this context.', + requiredPromiseAwaitSuggestion: 'Add `await` before the expression. Use caution as this may impact control flow.', + }, + schema: [ + { + type: 'string', + oneOf: [ + { + type: 'string', + description: 'Requires that all returned promises be awaited.', + enum: ['always'], + }, + { + type: 'string', + description: 'In error-handling contexts, the rule enforces that returned promises must be awaited. In ordinary contexts, the rule does not enforce any particular behavior around whether returned promises are awaited.', + enum: ['error-handling-correctness-only'], + }, + { + type: 'string', + description: 'In error-handling contexts, the rule enforces that returned promises must be awaited. In ordinary contexts, the rule enforces that returned promises _must not_ be awaited.', + enum: ['in-try-catch'], + }, + { + type: 'string', + description: 'Disallows awaiting any returned promises.', + enum: ['never'], + }, + ], + }, + ], + }, + defaultOptions: ['in-try-catch'], + create(context, [option]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const scopeInfoStack = []; + function enterFunction(node) { + scopeInfoStack.push({ + hasAsync: node.async, + owningFunc: node, + }); + } + function exitFunction() { + scopeInfoStack.pop(); + } + function affectsExplicitResourceManagement(node) { + // just need to determine if there is a `using` declaration in scope. + let scope = context.sourceCode.getScope(node); + const functionScope = scope.variableScope; + while (true) { + for (const variable of scope.variables) { + if (variable.defs.length !== 1) { + // This can't be the case for `using` or `await using` since it's + // an error to redeclare those more than once in the same scope, + // unlike, say, `var` declarations. + continue; + } + const declaration = variable.defs[0]; + const declaratorNode = declaration.node; + const declarationNode = declaratorNode.parent; + // if it's a using/await using declaration, and it comes _before_ the + // node we're checking, it affects control flow for that node. + if (['await using', 'using'].includes(declarationNode.kind) && + declaratorNode.range[1] < node.range[0]) { + return true; + } + } + if (scope === functionScope) { + // We've checked all the relevant scopes + break; + } + // This should always exist, since the rule should only be checking + // contexts in which `return` statements are legal, which should always + // be inside a function. + scope = (0, util_1.nullThrows)(scope.upper, 'Expected parent scope to exist. return-await should only operate on return statements within functions'); + } + return false; + } + /** + * Tests whether a node is inside of an explicit error handling context + * (try/catch/finally) in a way that throwing an exception will have an + * impact on the program's control flow. + */ + function affectsExplicitErrorHandling(node) { + // If an error-handling block is followed by another error-handling block, + // control flow is affected by whether promises in it are awaited or not. + // Otherwise, we need to check recursively for nested try statements until + // we get to the top level of a function or the program. If by then, + // there's no offending error-handling blocks, it doesn't affect control + // flow. + const tryAncestorResult = findContainingTryStatement(node); + if (tryAncestorResult == null) { + return false; + } + const { block, tryStatement } = tryAncestorResult; + switch (block) { + case 'catch': + // Exceptions thrown in catch blocks followed by a finally block affect + // control flow. + if (tryStatement.finallyBlock != null) { + return true; + } + // Otherwise recurse. + return affectsExplicitErrorHandling(tryStatement); + case 'finally': + return affectsExplicitErrorHandling(tryStatement); + case 'try': + // Try blocks are always followed by either a catch or finally, + // so exceptions thrown here always affect control flow. + return true; + default: { + const __never = block; + throw new Error(`Unexpected block type: ${String(__never)}`); + } + } + } + /** + * A try _statement_ is the whole thing that encompasses try block, + * catch clause, and finally block. This function finds the nearest + * enclosing try statement (if present) for a given node, and reports which + * part of the try statement the node is in. + */ + function findContainingTryStatement(node) { + let child = node; + let ancestor = node.parent; + while (ancestor && !ts.isFunctionLike(ancestor)) { + if (ts.isTryStatement(ancestor)) { + let block; + if (child === ancestor.tryBlock) { + block = 'try'; + } + else if (child === ancestor.catchClause) { + block = 'catch'; + } + else if (child === ancestor.finallyBlock) { + block = 'finally'; + } + return { + block: (0, util_1.nullThrows)(block, 'Child of a try statement must be a try block, catch clause, or finally block'), + tryStatement: ancestor, + }; + } + child = ancestor; + ancestor = ancestor.parent; + } + return undefined; + } + function removeAwait(fixer, node) { + // Should always be an await node; but let's be safe. + /* istanbul ignore if */ if (!(0, util_1.isAwaitExpression)(node)) { + return null; + } + const awaitToken = context.sourceCode.getFirstToken(node, util_1.isAwaitKeyword); + // Should always be the case; but let's be safe. + /* istanbul ignore if */ if (!awaitToken) { + return null; + } + const startAt = awaitToken.range[0]; + let endAt = awaitToken.range[1]; + // Also remove any extraneous whitespace after `await`, if there is any. + const nextToken = context.sourceCode.getTokenAfter(awaitToken, { + includeComments: true, + }); + if (nextToken) { + endAt = nextToken.range[0]; + } + return fixer.removeRange([startAt, endAt]); + } + function insertAwait(fixer, node, isHighPrecedence) { + if (isHighPrecedence) { + return fixer.insertTextBefore(node, 'await '); + } + return [ + fixer.insertTextBefore(node, 'await ('), + fixer.insertTextAfter(node, ')'), + ]; + } + function test(node, expression) { + let child; + const isAwait = ts.isAwaitExpression(expression); + if (isAwait) { + child = expression.getChildAt(1); + } + else { + child = expression; + } + const type = checker.getTypeAtLocation(child); + const certainty = (0, util_1.needsToBeAwaited)(checker, expression, type); + // handle awaited _non_thenables + if (certainty !== util_1.Awaitable.Always) { + if (isAwait) { + if (certainty === util_1.Awaitable.May) { + return; + } + context.report({ + node, + messageId: 'nonPromiseAwait', + fix: fixer => removeAwait(fixer, node), + }); + } + return; + } + // At this point it's definitely a thenable. + const affectsErrorHandling = affectsExplicitErrorHandling(expression) || + affectsExplicitResourceManagement(node); + const useAutoFix = !affectsErrorHandling; + const ruleConfiguration = getConfiguration(option); + const shouldAwaitInCurrentContext = affectsErrorHandling + ? ruleConfiguration.errorHandlingContext + : ruleConfiguration.ordinaryContext; + switch (shouldAwaitInCurrentContext) { + case 'await': + if (!isAwait) { + context.report({ + node, + messageId: 'requiredPromiseAwait', + ...(0, util_1.getFixOrSuggest)({ + fixOrSuggest: useAutoFix ? 'fix' : 'suggest', + suggestion: { + messageId: 'requiredPromiseAwaitSuggestion', + fix: fixer => insertAwait(fixer, node, (0, util_1.isHigherPrecedenceThanAwait)(expression)), + }, + }), + }); + } + break; + case "don't-care": + break; + case 'no-await': + if (isAwait) { + context.report({ + node, + messageId: 'disallowedPromiseAwait', + ...(0, util_1.getFixOrSuggest)({ + fixOrSuggest: useAutoFix ? 'fix' : 'suggest', + suggestion: { + messageId: 'disallowedPromiseAwaitSuggestion', + fix: fixer => removeAwait(fixer, node), + }, + }), + }); + } + break; + } + } + function findPossiblyReturnedNodes(node) { + if (node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) { + return [ + ...findPossiblyReturnedNodes(node.alternate), + ...findPossiblyReturnedNodes(node.consequent), + ]; + } + return [node]; + } + return { + ArrowFunctionExpression: enterFunction, + 'ArrowFunctionExpression:exit': exitFunction, + FunctionDeclaration: enterFunction, + 'FunctionDeclaration:exit': exitFunction, + FunctionExpression: enterFunction, + 'FunctionExpression:exit': exitFunction, + // executes after less specific handler, so exitFunction is called + 'ArrowFunctionExpression[async = true]:exit'(node) { + if (node.body.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + findPossiblyReturnedNodes(node.body).forEach(node => { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + test(node, tsNode); + }); + } + }, + ReturnStatement(node) { + const scopeInfo = scopeInfoStack.at(-1); + if (!scopeInfo?.hasAsync || !node.argument) { + return; + } + findPossiblyReturnedNodes(node.argument).forEach(node => { + const tsNode = services.esTreeNodeToTSNodeMap.get(node); + test(node, tsNode); + }); + }, + }; + }, +}); +function getConfiguration(option) { + switch (option) { + case 'always': + return { + errorHandlingContext: 'await', + ordinaryContext: 'await', + }; + case 'error-handling-correctness-only': + return { + errorHandlingContext: 'await', + ordinaryContext: "don't-care", + }; + case 'in-try-catch': + return { + errorHandlingContext: 'await', + ordinaryContext: 'no-await', + }; + case 'never': + return { + errorHandlingContext: 'no-await', + ordinaryContext: 'no-await', + }; + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87603aa8547d7e3f01b0d273bf54302c6410b447 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.d.ts @@ -0,0 +1,14 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type Options = [ + { + caseSensitive?: boolean; + checkIntersections?: boolean; + checkUnions?: boolean; + groupOrder?: string[]; + } +]; +export type MessageIds = 'notSorted' | 'notSortedNamed' | 'suggestFix'; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js new file mode 100644 index 0000000000000000000000000000000000000000..c4a51cce72a1b7a2a7e0ad4bc3cf10907decab1e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/sort-type-constituents.js @@ -0,0 +1,272 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +var Group; +(function (Group) { + Group["conditional"] = "conditional"; + Group["function"] = "function"; + Group["import"] = "import"; + Group["intersection"] = "intersection"; + Group["keyword"] = "keyword"; + Group["nullish"] = "nullish"; + Group["literal"] = "literal"; + Group["named"] = "named"; + Group["object"] = "object"; + Group["operator"] = "operator"; + Group["tuple"] = "tuple"; + Group["union"] = "union"; +})(Group || (Group = {})); +function getGroup(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSConditionalType: + return Group.conditional; + case utils_1.AST_NODE_TYPES.TSConstructorType: + case utils_1.AST_NODE_TYPES.TSFunctionType: + return Group.function; + case utils_1.AST_NODE_TYPES.TSImportType: + return Group.import; + case utils_1.AST_NODE_TYPES.TSIntersectionType: + return Group.intersection; + case utils_1.AST_NODE_TYPES.TSAnyKeyword: + case utils_1.AST_NODE_TYPES.TSBigIntKeyword: + case utils_1.AST_NODE_TYPES.TSBooleanKeyword: + case utils_1.AST_NODE_TYPES.TSNeverKeyword: + case utils_1.AST_NODE_TYPES.TSNumberKeyword: + case utils_1.AST_NODE_TYPES.TSObjectKeyword: + case utils_1.AST_NODE_TYPES.TSStringKeyword: + case utils_1.AST_NODE_TYPES.TSSymbolKeyword: + case utils_1.AST_NODE_TYPES.TSThisType: + case utils_1.AST_NODE_TYPES.TSUnknownKeyword: + case utils_1.AST_NODE_TYPES.TSIntrinsicKeyword: + return Group.keyword; + case utils_1.AST_NODE_TYPES.TSNullKeyword: + case utils_1.AST_NODE_TYPES.TSUndefinedKeyword: + case utils_1.AST_NODE_TYPES.TSVoidKeyword: + return Group.nullish; + case utils_1.AST_NODE_TYPES.TSLiteralType: + case utils_1.AST_NODE_TYPES.TSTemplateLiteralType: + return Group.literal; + case utils_1.AST_NODE_TYPES.TSArrayType: + case utils_1.AST_NODE_TYPES.TSIndexedAccessType: + case utils_1.AST_NODE_TYPES.TSInferType: + case utils_1.AST_NODE_TYPES.TSTypeReference: + case utils_1.AST_NODE_TYPES.TSQualifiedName: + return Group.named; + case utils_1.AST_NODE_TYPES.TSMappedType: + case utils_1.AST_NODE_TYPES.TSTypeLiteral: + return Group.object; + case utils_1.AST_NODE_TYPES.TSTypeOperator: + case utils_1.AST_NODE_TYPES.TSTypeQuery: + return Group.operator; + case utils_1.AST_NODE_TYPES.TSTupleType: + return Group.tuple; + case utils_1.AST_NODE_TYPES.TSUnionType: + return Group.union; + // These types should never occur as part of a union/intersection + case utils_1.AST_NODE_TYPES.TSAbstractKeyword: + case utils_1.AST_NODE_TYPES.TSAsyncKeyword: + case utils_1.AST_NODE_TYPES.TSDeclareKeyword: + case utils_1.AST_NODE_TYPES.TSExportKeyword: + case utils_1.AST_NODE_TYPES.TSNamedTupleMember: + case utils_1.AST_NODE_TYPES.TSOptionalType: + case utils_1.AST_NODE_TYPES.TSPrivateKeyword: + case utils_1.AST_NODE_TYPES.TSProtectedKeyword: + case utils_1.AST_NODE_TYPES.TSPublicKeyword: + case utils_1.AST_NODE_TYPES.TSReadonlyKeyword: + case utils_1.AST_NODE_TYPES.TSRestType: + case utils_1.AST_NODE_TYPES.TSStaticKeyword: + case utils_1.AST_NODE_TYPES.TSTypePredicate: + /* istanbul ignore next */ + throw new Error(`Unexpected Type ${node.type}`); + } +} +function caseSensitiveSort(a, b) { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + return 0; +} +exports.default = (0, util_1.createRule)({ + name: 'sort-type-constituents', + meta: { + type: 'suggestion', + deprecated: { + deprecatedSince: '7.13.0', + replacedBy: [ + { + plugin: { + name: 'eslint-plugin-perfectionist', + url: 'https://perfectionist.dev', + }, + rule: { + name: 'perfectionist/sort-intersection-types', + url: 'https://perfectionist.dev/rules/sort-intersection-types', + }, + }, + { + plugin: { + name: 'eslint-plugin-perfectionist', + url: 'https://perfectionist.dev', + }, + rule: { + name: 'perfectionist/sort-union-types', + url: 'https://perfectionist.dev/rules/sort-union-types', + }, + }, + ], + url: 'https://github.com/typescript-eslint/typescript-eslint/pull/9253', + }, + docs: { + description: 'Enforce constituents of a type union/intersection to be sorted alphabetically', + }, + fixable: 'code', + hasSuggestions: true, + messages: { + notSorted: '{{type}} type constituents must be sorted.', + notSortedNamed: '{{type}} type {{name}} constituents must be sorted.', + suggestFix: 'Sort constituents of type (removes all comments).', + }, + replacedBy: [ + 'perfectionist/sort-intersection-types', + 'perfectionist/sort-union-types', + ], + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + caseSensitive: { + type: 'boolean', + description: 'Whether to sort using case sensitive string comparisons.', + }, + checkIntersections: { + type: 'boolean', + description: 'Whether to check intersection types (`&`).', + }, + checkUnions: { + type: 'boolean', + description: 'Whether to check union types (`|`).', + }, + groupOrder: { + type: 'array', + description: 'Ordering of the groups.', + items: { + type: 'string', + enum: (0, util_1.getEnumNames)(Group), + }, + }, + }, + }, + ], + }, + defaultOptions: [ + { + caseSensitive: false, + checkIntersections: true, + checkUnions: true, + groupOrder: [ + Group.named, + Group.keyword, + Group.operator, + Group.literal, + Group.function, + Group.import, + Group.conditional, + Group.object, + Group.tuple, + Group.intersection, + Group.union, + Group.nullish, + ], + }, + ], + create(context, [{ caseSensitive, checkIntersections, checkUnions, groupOrder }]) { + const collator = new Intl.Collator('en', { + numeric: true, + sensitivity: 'base', + }); + function checkSorting(node) { + const sourceOrder = node.types.map(type => { + const group = groupOrder?.indexOf(getGroup(type)) ?? -1; + return { + node: type, + group: group === -1 ? Number.MAX_SAFE_INTEGER : group, + text: context.sourceCode.getText(type), + }; + }); + const expectedOrder = [...sourceOrder].sort((a, b) => { + if (a.group !== b.group) { + return a.group - b.group; + } + if (caseSensitive) { + return caseSensitiveSort(a.text, b.text); + } + return (collator.compare(a.text, b.text) || + (a.text < b.text ? -1 : a.text > b.text ? 1 : 0)); + }); + const hasComments = node.types.some(type => { + const count = context.sourceCode.getCommentsBefore(type).length + + context.sourceCode.getCommentsAfter(type).length; + return count > 0; + }); + for (let i = 0; i < expectedOrder.length; i += 1) { + if (expectedOrder[i].node !== sourceOrder[i].node) { + let messageId = 'notSorted'; + const data = { + name: '', + type: node.type === utils_1.AST_NODE_TYPES.TSIntersectionType + ? 'Intersection' + : 'Union', + }; + if (node.parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration) { + messageId = 'notSortedNamed'; + data.name = node.parent.id.name; + } + const fix = fixer => { + const sorted = expectedOrder + .map(t => (0, util_1.typeNodeRequiresParentheses)(t.node, t.text) || + (node.type === utils_1.AST_NODE_TYPES.TSIntersectionType && + t.node.type === utils_1.AST_NODE_TYPES.TSUnionType) + ? `(${t.text})` + : t.text) + .join(node.type === utils_1.AST_NODE_TYPES.TSIntersectionType ? ' & ' : ' | '); + return fixer.replaceText(node, sorted); + }; + return context.report({ + node, + messageId, + data, + // don't autofix if any of the types have leading/trailing comments + // the logic for preserving them correctly is a pain - we may implement this later + ...(hasComments + ? { + suggest: [ + { + messageId: 'suggestFix', + fix, + }, + ], + } + : { fix }), + }); + } + } + } + return { + ...(checkIntersections && { + TSIntersectionType(node) { + checkSorting(node); + }, + }), + ...(checkUnions && { + TSUnionType(node) { + checkSorting(node); + }, + }), + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf4a4cc3526c4ca7b824d55089ddc3b45535e6c3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.d.ts @@ -0,0 +1,19 @@ +export type Options = [ + { + allowAny?: boolean; + allowNullableBoolean?: boolean; + allowNullableEnum?: boolean; + allowNullableNumber?: boolean; + allowNullableObject?: boolean; + allowNullableString?: boolean; + allowNumber?: boolean; + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean; + allowString?: boolean; + } +]; +type ConditionErrorMessageId = 'conditionErrorAny' | 'conditionErrorNullableBoolean' | 'conditionErrorNullableEnum' | 'conditionErrorNullableNumber' | 'conditionErrorNullableObject' | 'conditionErrorNullableString' | 'conditionErrorNullish' | 'conditionErrorNumber' | 'conditionErrorObject' | 'conditionErrorOther' | 'conditionErrorString'; +export type MessageId = 'conditionFixCastBoolean' | 'conditionFixCompareArrayLengthNonzero' | 'conditionFixCompareArrayLengthZero' | 'conditionFixCompareEmptyString' | 'conditionFixCompareFalse' | 'conditionFixCompareNaN' | 'conditionFixCompareNullish' | 'conditionFixCompareStringLength' | 'conditionFixCompareTrue' | 'conditionFixCompareZero' | 'conditionFixDefaultEmptyString' | 'conditionFixDefaultFalse' | 'conditionFixDefaultZero' | 'explicitBooleanReturnType' | 'noStrictNullCheck' | 'predicateCannotBeAsync' | ConditionErrorMessageId; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js new file mode 100644 index 0000000000000000000000000000000000000000..14074655a0336a900c5c589211c89b0cae62d1d8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-boolean-expressions.js @@ -0,0 +1,882 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const assertionFunctionUtils_1 = require("../util/assertionFunctionUtils"); +exports.default = (0, util_1.createRule)({ + name: 'strict-boolean-expressions', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow certain types in boolean expressions', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + conditionErrorAny: 'Unexpected any value in {{context}}. ' + + 'An explicit comparison or type conversion is required.', + conditionErrorNullableBoolean: 'Unexpected nullable boolean value in {{context}}. ' + + 'Please handle the nullish case explicitly.', + conditionErrorNullableEnum: 'Unexpected nullable enum value in {{context}}. ' + + 'Please handle the nullish/zero/NaN cases explicitly.', + conditionErrorNullableNumber: 'Unexpected nullable number value in {{context}}. ' + + 'Please handle the nullish/zero/NaN cases explicitly.', + conditionErrorNullableObject: 'Unexpected nullable object value in {{context}}. ' + + 'An explicit null check is required.', + conditionErrorNullableString: 'Unexpected nullable string value in {{context}}. ' + + 'Please handle the nullish/empty cases explicitly.', + conditionErrorNullish: 'Unexpected nullish value in conditional. ' + + 'The condition is always false.', + conditionErrorNumber: 'Unexpected number value in {{context}}. ' + + 'An explicit zero/NaN check is required.', + conditionErrorObject: 'Unexpected object value in {{context}}. ' + + 'The condition is always true.', + conditionErrorOther: 'Unexpected value in conditional. ' + + 'A boolean expression is required.', + conditionErrorString: 'Unexpected string value in {{context}}. ' + + 'An explicit empty string check is required.', + conditionFixCastBoolean: 'Explicitly convert value to a boolean (`Boolean(value)`)', + conditionFixCompareArrayLengthNonzero: "Change condition to check array's length (`value.length > 0`)", + conditionFixCompareArrayLengthZero: "Change condition to check array's length (`value.length === 0`)", + conditionFixCompareEmptyString: 'Change condition to check for empty string (`value !== ""`)', + conditionFixCompareFalse: 'Change condition to check if false (`value === false`)', + conditionFixCompareNaN: 'Change condition to check for NaN (`!Number.isNaN(value)`)', + conditionFixCompareNullish: 'Change condition to check for null/undefined (`value != null`)', + conditionFixCompareStringLength: "Change condition to check string's length (`value.length !== 0`)", + conditionFixCompareTrue: 'Change condition to check if true (`value === true`)', + conditionFixCompareZero: 'Change condition to check for 0 (`value !== 0`)', + conditionFixDefaultEmptyString: 'Explicitly treat nullish value the same as an empty string (`value ?? ""`)', + conditionFixDefaultFalse: 'Explicitly treat nullish value the same as false (`value ?? false`)', + conditionFixDefaultZero: 'Explicitly treat nullish value the same as 0 (`value ?? 0`)', + explicitBooleanReturnType: 'Add an explicit `boolean` return type annotation.', + noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', + predicateCannotBeAsync: "Predicate function should not be 'async'; expected a boolean return type.", + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowAny: { + type: 'boolean', + description: 'Whether to allow `any`s in a boolean context.', + }, + allowNullableBoolean: { + type: 'boolean', + description: 'Whether to allow nullable `boolean`s in a boolean context.', + }, + allowNullableEnum: { + type: 'boolean', + description: 'Whether to allow nullable `enum`s in a boolean context.', + }, + allowNullableNumber: { + type: 'boolean', + description: 'Whether to allow nullable `number`s in a boolean context.', + }, + allowNullableObject: { + type: 'boolean', + description: 'Whether to allow nullable `object`s, `symbol`s, and functions in a boolean context.', + }, + allowNullableString: { + type: 'boolean', + description: 'Whether to allow nullable `string`s in a boolean context.', + }, + allowNumber: { + type: 'boolean', + description: 'Whether to allow `number`s in a boolean context.', + }, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + type: 'boolean', + description: 'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.', + }, + allowString: { + type: 'boolean', + description: 'Whether to allow `string`s in a boolean context.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowAny: false, + allowNullableBoolean: false, + allowNullableEnum: false, + allowNullableNumber: false, + allowNullableObject: true, + allowNullableString: false, + allowNumber: true, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, + allowString: true, + }, + ], + create(context, [options]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks'); + if (!isStrictNullChecks && + options.allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) { + context.report({ + loc: { + start: { column: 0, line: 0 }, + end: { column: 0, line: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } + const traversedNodes = new Set(); + return { + CallExpression: traverseCallExpression, + ConditionalExpression: traverseTestExpression, + DoWhileStatement: traverseTestExpression, + ForStatement: traverseTestExpression, + IfStatement: traverseTestExpression, + 'LogicalExpression[operator!="??"]': traverseLogicalExpression, + 'UnaryExpression[operator="!"]': traverseUnaryLogicalExpression, + WhileStatement: traverseTestExpression, + }; + /** + * Inspects condition of a test expression. (`if`, `while`, `for`, etc.) + */ + function traverseTestExpression(node) { + if (node.test == null) { + return; + } + traverseNode(node.test, true); + } + /** + * Inspects the argument of a unary logical expression (`!`). + */ + function traverseUnaryLogicalExpression(node) { + traverseNode(node.argument, true); + } + /** + * Inspects the arguments of a logical expression (`&&`, `||`). + * + * If the logical expression is a descendant of a test expression, + * the `isCondition` flag should be set to true. + * Otherwise, if the logical expression is there on it's own, + * it's used for control flow and is not a condition itself. + */ + function traverseLogicalExpression(node, isCondition = false) { + // left argument is always treated as a condition + traverseNode(node.left, true); + // if the logical expression is used for control flow, + // then its right argument is used for its side effects only + traverseNode(node.right, isCondition); + } + function traverseCallExpression(node) { + const assertedArgument = (0, assertionFunctionUtils_1.findTruthinessAssertedArgument)(services, node); + if (assertedArgument != null) { + traverseNode(assertedArgument, true); + } + if ((0, util_1.isArrayMethodCallWithPredicate)(context, services, node)) { + const predicate = node.arguments.at(0); + if (predicate) { + checkArrayMethodCallPredicate(predicate); + } + } + } + /** + * Dedicated function to check array method predicate calls. Reports predicate + * arguments that don't return a boolean value. + */ + function checkArrayMethodCallPredicate(predicateNode) { + const isFunctionExpression = utils_1.ASTUtils.isFunction(predicateNode); + // custom message for accidental `async` function expressions + if (isFunctionExpression && predicateNode.async) { + return context.report({ + node: predicateNode, + messageId: 'predicateCannotBeAsync', + }); + } + const returnTypes = services + .getTypeAtLocation(predicateNode) + .getCallSignatures() + .map(signature => { + const type = signature.getReturnType(); + if (tsutils.isTypeParameter(type)) { + return checker.getBaseConstraintOfType(type) ?? type; + } + return type; + }); + const flattenTypes = [ + ...new Set(returnTypes.flatMap(type => tsutils.unionConstituents(type))), + ]; + const types = inspectVariantTypes(flattenTypes); + const reportType = determineReportType(types); + if (reportType == null) { + return; + } + const suggestions = []; + if (isFunctionExpression && + predicateNode.body.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + suggestions.push(...getSuggestionsForConditionError(predicateNode.body, reportType)); + } + if (isFunctionExpression && !predicateNode.returnType) { + suggestions.push({ + messageId: 'explicitBooleanReturnType', + fix: fixer => { + if (predicateNode.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + (0, util_1.isParenlessArrowFunction)(predicateNode, context.sourceCode)) { + return [ + fixer.insertTextBefore(predicateNode.params[0], '('), + fixer.insertTextAfter(predicateNode.params[0], '): boolean'), + ]; + } + if (predicateNode.params.length === 0) { + const closingBracket = (0, util_1.nullThrows)(context.sourceCode.getFirstToken(predicateNode, token => token.value === ')'), 'function expression has to have a closing parenthesis.'); + return fixer.insertTextAfter(closingBracket, ': boolean'); + } + const lastClosingParenthesis = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(predicateNode.params[predicateNode.params.length - 1], token => token.value === ')'), 'function expression has to have a closing parenthesis.'); + return fixer.insertTextAfter(lastClosingParenthesis, ': boolean'); + }, + }); + } + return context.report({ + node: predicateNode, + messageId: reportType, + data: { + context: 'array predicate return type', + }, + suggest: suggestions, + }); + } + /** + * Inspects any node. + * + * If it's a logical expression then it recursively traverses its arguments. + * If it's any other kind of node then it's type is finally checked against the rule, + * unless `isCondition` flag is set to false, in which case + * it's assumed to be used for side effects only and is skipped. + */ + function traverseNode(node, isCondition) { + // prevent checking the same node multiple times + if (traversedNodes.has(node)) { + return; + } + traversedNodes.add(node); + // for logical operator, we check its operands + if (node.type === utils_1.AST_NODE_TYPES.LogicalExpression && + node.operator !== '??') { + traverseLogicalExpression(node, isCondition); + return; + } + // skip if node is not a condition + if (!isCondition) { + return; + } + checkNode(node); + } + function determineReportType(types) { + const is = (...wantedTypes) => types.size === wantedTypes.length && + wantedTypes.every(type => types.has(type)); + // boolean + if (is('boolean') || is('truthy boolean')) { + // boolean is always ok + return undefined; + } + // never + if (is('never')) { + // never is always okay + return undefined; + } + // nullish + if (is('nullish')) { + // condition is always false + return 'conditionErrorNullish'; + } + // Known edge case: boolean `true` and nullish values are always valid boolean expressions + if (is('nullish', 'truthy boolean')) { + return; + } + // nullable boolean + if (is('nullish', 'boolean')) { + return !options.allowNullableBoolean + ? 'conditionErrorNullableBoolean' + : undefined; + } + // Known edge case: truthy primitives and nullish values are always valid boolean expressions + if ((options.allowNumber && is('nullish', 'truthy number')) || + (options.allowString && is('nullish', 'truthy string'))) { + return; + } + // string + if (is('string') || is('truthy string')) { + return !options.allowString ? 'conditionErrorString' : undefined; + } + // nullable string + if (is('nullish', 'string')) { + return !options.allowNullableString + ? 'conditionErrorNullableString' + : undefined; + } + // number + if (is('number') || is('truthy number')) { + return !options.allowNumber ? 'conditionErrorNumber' : undefined; + } + // nullable number + if (is('nullish', 'number')) { + return !options.allowNullableNumber + ? 'conditionErrorNullableNumber' + : undefined; + } + // object + if (is('object')) { + return 'conditionErrorObject'; + } + // nullable object + if (is('nullish', 'object')) { + return !options.allowNullableObject + ? 'conditionErrorNullableObject' + : undefined; + } + // nullable enum + if (is('nullish', 'number', 'enum') || + is('nullish', 'string', 'enum') || + is('nullish', 'truthy number', 'enum') || + is('nullish', 'truthy string', 'enum') || + // mixed enums + is('nullish', 'truthy number', 'truthy string', 'enum') || + is('nullish', 'truthy number', 'string', 'enum') || + is('nullish', 'truthy string', 'number', 'enum') || + is('nullish', 'number', 'string', 'enum')) { + return !options.allowNullableEnum + ? 'conditionErrorNullableEnum' + : undefined; + } + // any + if (is('any')) { + return !options.allowAny ? 'conditionErrorAny' : undefined; + } + return 'conditionErrorOther'; + } + function getSuggestionsForConditionError(node, conditionError) { + switch (conditionError) { + case 'conditionErrorAny': + return [ + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `Boolean(${code})`, + }), + }, + ]; + case 'conditionErrorNullableBoolean': + if (isLogicalNegationExpression(node.parent)) { + // if (!nullableBoolean) + return [ + { + messageId: 'conditionFixDefaultFalse', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? false`, + }), + }, + { + messageId: 'conditionFixCompareFalse', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} === false`, + }), + }, + ]; + } + // if (nullableBoolean) + return [ + { + messageId: 'conditionFixDefaultFalse', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? false`, + }), + }, + { + messageId: 'conditionFixCompareTrue', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} === true`, + }), + }, + ]; + case 'conditionErrorNullableEnum': + if (isLogicalNegationExpression(node.parent)) { + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} == null`, + }), + }, + ]; + } + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} != null`, + }), + }, + ]; + case 'conditionErrorNullableNumber': + if (isLogicalNegationExpression(node.parent)) { + // if (!nullableNumber) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} == null`, + }), + }, + { + messageId: 'conditionFixDefaultZero', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? 0`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `!Boolean(${code})`, + }), + }, + ]; + } + // if (nullableNumber) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} != null`, + }), + }, + { + messageId: 'conditionFixDefaultZero', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? 0`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `Boolean(${code})`, + }), + }, + ]; + case 'conditionErrorNullableObject': + if (isLogicalNegationExpression(node.parent)) { + // if (!nullableObject) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} == null`, + }), + }, + ]; + } + // if (nullableObject) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} != null`, + }), + }, + ]; + case 'conditionErrorNullableString': + if (isLogicalNegationExpression(node.parent)) { + // if (!nullableString) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} == null`, + }), + }, + { + messageId: 'conditionFixDefaultEmptyString', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? ""`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `!Boolean(${code})`, + }), + }, + ]; + } + // if (nullableString) + return [ + { + messageId: 'conditionFixCompareNullish', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} != null`, + }), + }, + { + messageId: 'conditionFixDefaultEmptyString', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} ?? ""`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `Boolean(${code})`, + }), + }, + ]; + case 'conditionErrorNumber': + if (isArrayLengthExpression(node, checker, services)) { + if (isLogicalNegationExpression(node.parent)) { + // if (!array.length) + return [ + { + messageId: 'conditionFixCompareArrayLengthZero', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} === 0`, + }), + }, + ]; + } + // if (array.length) + return [ + { + messageId: 'conditionFixCompareArrayLengthNonzero', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} > 0`, + }), + }, + ]; + } + if (isLogicalNegationExpression(node.parent)) { + // if (!number) + return [ + { + messageId: 'conditionFixCompareZero', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + // TODO: we have to compare to 0n if the type is bigint + wrap: code => `${code} === 0`, + }), + }, + { + // TODO: don't suggest this for bigint because it can't be NaN + messageId: 'conditionFixCompareNaN', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `Number.isNaN(${code})`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `!Boolean(${code})`, + }), + }, + ]; + } + // if (number) + return [ + { + messageId: 'conditionFixCompareZero', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} !== 0`, + }), + }, + { + messageId: 'conditionFixCompareNaN', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `!Number.isNaN(${code})`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `Boolean(${code})`, + }), + }, + ]; + case 'conditionErrorString': + if (isLogicalNegationExpression(node.parent)) { + // if (!string) + return [ + { + messageId: 'conditionFixCompareStringLength', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code}.length === 0`, + }), + }, + { + messageId: 'conditionFixCompareEmptyString', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `${code} === ""`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node: node.parent, + innerNode: node, + sourceCode: context.sourceCode, + wrap: code => `!Boolean(${code})`, + }), + }, + ]; + } + // if (string) + return [ + { + messageId: 'conditionFixCompareStringLength', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code}.length > 0`, + }), + }, + { + messageId: 'conditionFixCompareEmptyString', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `${code} !== ""`, + }), + }, + { + messageId: 'conditionFixCastBoolean', + fix: (0, util_1.getWrappingFixer)({ + node, + sourceCode: context.sourceCode, + wrap: code => `Boolean(${code})`, + }), + }, + ]; + case 'conditionErrorObject': + case 'conditionErrorNullish': + case 'conditionErrorOther': + return []; + default: + conditionError; + throw new Error('Unreachable'); + } + } + /** + * This function does the actual type check on a node. + * It analyzes the type of a node and checks if it is allowed in a boolean context. + */ + function checkNode(node) { + const type = (0, util_1.getConstrainedTypeAtLocation)(services, node); + const types = inspectVariantTypes(tsutils.unionConstituents(type)); + const reportType = determineReportType(types); + if (reportType != null) { + context.report({ + node, + messageId: reportType, + data: { + context: 'conditional', + }, + suggest: getSuggestionsForConditionError(node, reportType), + }); + } + } + /** + * Check union variants for the types we care about + */ + function inspectVariantTypes(types) { + const variantTypes = new Set(); + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.VoidLike))) { + variantTypes.add('nullish'); + } + const booleans = types.filter(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.BooleanLike)); + // If incoming type is either "true" or "false", there will be one type + // object with intrinsicName set accordingly + // If incoming type is boolean, there will be two type objects with + // intrinsicName set "true" and "false" each because of ts-api-utils.unionConstituents() + if (booleans.length === 1) { + variantTypes.add(tsutils.isTrueLiteralType(booleans[0]) ? 'truthy boolean' : 'boolean'); + } + else if (booleans.length === 2) { + variantTypes.add('boolean'); + } + const strings = types.filter(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.StringLike)); + if (strings.length) { + if (strings.every(type => type.isStringLiteral() && type.value !== '')) { + variantTypes.add('truthy string'); + } + else { + variantTypes.add('string'); + } + } + const numbers = types.filter(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.NumberLike | ts.TypeFlags.BigIntLike)); + if (numbers.length) { + if (numbers.every(type => type.isNumberLiteral() && type.value !== 0)) { + variantTypes.add('truthy number'); + } + else { + variantTypes.add('number'); + } + } + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.EnumLike))) { + variantTypes.add('enum'); + } + if (types.some(type => !tsutils.isTypeFlagSet(type, ts.TypeFlags.Null | + ts.TypeFlags.Undefined | + ts.TypeFlags.VoidLike | + ts.TypeFlags.BooleanLike | + ts.TypeFlags.StringLike | + ts.TypeFlags.NumberLike | + ts.TypeFlags.BigIntLike | + ts.TypeFlags.TypeParameter | + ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.Never))) { + variantTypes.add(types.some(isBrandedBoolean) ? 'boolean' : 'object'); + } + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.TypeParameter | + ts.TypeFlags.Any | + ts.TypeFlags.Unknown))) { + variantTypes.add('any'); + } + if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.Never))) { + variantTypes.add('never'); + } + return variantTypes; + } + }, +}); +function isLogicalNegationExpression(node) { + return node.type === utils_1.AST_NODE_TYPES.UnaryExpression && node.operator === '!'; +} +function isArrayLengthExpression(node, typeChecker, services) { + if (node.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return false; + } + if (node.computed) { + return false; + } + if (node.property.name !== 'length') { + return false; + } + const objectType = (0, util_1.getConstrainedTypeAtLocation)(services, node.object); + return (0, util_1.isTypeArrayTypeOrUnionOfArrayTypes)(objectType, typeChecker); +} +/** + * Verify is the type is a branded boolean (e.g. `type Foo = boolean & { __brand: 'Foo' }`) + * + * @param type The type checked + */ +function isBrandedBoolean(type) { + return (type.isIntersection() && + type.types.some(childType => isBooleanType(childType))); +} +function isBooleanType(expressionType) { + return tsutils.isTypeFlagSet(expressionType, ts.TypeFlags.Boolean | ts.TypeFlags.BooleanLiteral); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-void-return.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-void-return.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..73666586cdca67ffb021740cd97e52053c4cbf2a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-void-return.d.ts @@ -0,0 +1,10 @@ +type Options = [ + { + allowReturnAny?: boolean; + } +]; +type MessageId = `asyncFunc` | `nonVoidFunc` | `nonVoidReturn`; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-void-return.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-void-return.js new file mode 100644 index 0000000000000000000000000000000000000000..8539764d17c0bb655eeef6819d9396e71656f6e3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/strict-void-return.js @@ -0,0 +1,377 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util = __importStar(require("../util")); +exports.default = util.createRule({ + name: 'strict-void-return', + meta: { + type: 'problem', + docs: { + description: 'Disallow passing a value-returning function in a position accepting a void function', + requiresTypeChecking: true, + }, + messages: { + asyncFunc: 'Async function used in a context where a void function is expected.', + nonVoidFunc: 'Value-returning function used in a context where a void function is expected.', + nonVoidReturn: 'Value returned in a context where a void return is expected.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowReturnAny: { + type: 'boolean', + description: 'Whether to allow functions returning `any` to be used in place expecting a `void` function.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowReturnAny: false, + }, + ], + create(context, [options]) { + const sourceCode = context.sourceCode; + const parserServices = util.getParserServices(context); + const checker = parserServices.program.getTypeChecker(); + return { + ArrayExpression: (node) => { + for (const elemNode of node.elements) { + if (elemNode != null && + elemNode.type !== utils_1.AST_NODE_TYPES.SpreadElement) { + checkExpressionNode(elemNode); + } + } + }, + ArrowFunctionExpression: (node) => { + if (node.body.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + checkExpressionNode(node.body); + } + }, + AssignmentExpression: (node) => { + checkExpressionNode(node.right); // should ignore operators like `+=` or `-=` automatically + }, + 'CallExpression, NewExpression': checkFunctionCallNode, + JSXAttribute: (node) => { + if (node.value?.type === utils_1.AST_NODE_TYPES.JSXExpressionContainer && + node.value.expression.type !== utils_1.AST_NODE_TYPES.JSXEmptyExpression) { + checkExpressionNode(node.value.expression); + } + }, + MethodDefinition: checkClassMethodNode, + ObjectExpression: (node) => { + for (const propNode of node.properties) { + if (propNode.type !== utils_1.AST_NODE_TYPES.SpreadElement) { + checkObjectPropertyNode(propNode); + } + } + }, + PropertyDefinition: checkClassPropertyNode, + ReturnStatement: (node) => { + if (node.argument != null) { + checkExpressionNode(node.argument); + } + }, + VariableDeclarator: (node) => { + if (node.init != null) { + checkExpressionNode(node.init); + } + }, + }; + function isVoidReturningFunctionType(type) { + const returnTypes = tsutils + .getCallSignaturesOfType(type) + .flatMap(signature => tsutils.unionConstituents(signature.getReturnType())); + return (returnTypes.length > 0 && + returnTypes.every(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.Void))); + } + /** + * Finds errors in any expression node. + * + * Compares the type of the node against the contextual (expected) type. + * + * @returns `true` if the expected type was void function. + */ + function checkExpressionNode(node) { + const expectedType = parserServices.getContextualType(node); + if (expectedType != null && isVoidReturningFunctionType(expectedType)) { + reportIfNonVoidFunction(node); + return true; + } + return false; + } + /** + * Finds errors in function calls. + * + * When checking arguments, we also manually figure out the argument types + * by iterating over all the function signatures. + * Thanks to this, we can find arguments like `(() => void) | (() => any)` + * and treat them as void too. + * This is done to also support checking functions like `addEventListener` + * which have overloads where one callback returns any. + * + * Implementation mostly based on no-misused-promises, + * which does this to find `(() => void) | (() => NotThenable)` + * and report them too. + */ + function checkFunctionCallNode(callNode) { + if (callNode.arguments.length === 0) { + return; + } + const callTsNode = parserServices.esTreeNodeToTSNodeMap.get(callNode); + const funcType = checker.getTypeAtLocation(callTsNode.expression); + const funcSignatures = tsutils + .unionConstituents(funcType) + .flatMap(type => ts.isCallExpression(callTsNode) + ? type.getCallSignatures() + : type.getConstructSignatures()); + for (const [argIdx, argNode] of callNode.arguments.entries()) { + if (argNode.type === utils_1.AST_NODE_TYPES.SpreadElement) { + continue; + } + // Collect the types from all of the call signatures + const argExpectedReturnTypes = funcSignatures + .map(s => s.parameters[argIdx]) + .filter(Boolean) + .map(param => checker.getTypeOfSymbolAtLocation(param, callTsNode.expression)) + .flatMap(paramType => tsutils.unionConstituents(paramType)) + .flatMap(paramType => paramType.getCallSignatures()) + .map(paramSignature => paramSignature.getReturnType()); + const hasSingleSignature = funcSignatures.length === 1; + const allSignaturesReturnVoid = argExpectedReturnTypes.every(type => isVoid(type) || + // Treat as void even though it might be technically any. + isNullishOrAny(type) || + // `getTypeOfSymbolAtLocation` returns unresolved type parameters + // (e.g. `T`), even for overloads that match the call. + // + // Since we can't tell whether a generic overload currently matches, + // we treat TypeParameters similar to void. + tsutils.isTypeParameter(type)); + // Check against the contextual type first, but only when there is a + // single signature or when all signatures return void, because + // `getContextualType` resolves to the first overload's return type even + // though there may be another one that matches the call. + if ((hasSingleSignature || allSignaturesReturnVoid) && + checkExpressionNode(argNode)) { + continue; + } + if ( + // At least one return type is void + argExpectedReturnTypes.some(isVoid) && + // The rest are nullish or any + argExpectedReturnTypes.every(isNullishOrAny)) { + // We treat this argument as void even though it might be technically any. + reportIfNonVoidFunction(argNode); + } + } + } + function isNullishOrAny(type) { + return tsutils.isTypeFlagSet(type, ts.TypeFlags.VoidLike | + ts.TypeFlags.Undefined | + ts.TypeFlags.Null | + ts.TypeFlags.Any | + ts.TypeFlags.Never); + } + function isVoid(type) { + return tsutils.isTypeFlagSet(type, ts.TypeFlags.Void); + } + /** + * Finds errors in an object property. + * + * Object properties require different logic + * when the property is a method shorthand. + */ + function checkObjectPropertyNode(propNode) { + const valueNode = propNode.value; + const propTsNode = parserServices.esTreeNodeToTSNodeMap.get(propNode); + if (propTsNode.kind === ts.SyntaxKind.MethodDeclaration) { + // Object property is a method shorthand. + if (propTsNode.name.kind === ts.SyntaxKind.ComputedPropertyName) { + // Don't check object methods with computed name. + return; + } + const objType = parserServices.getContextualType(propNode.parent); + if (objType == null) { + // Expected object type is unknown. + return; + } + const propSymbol = checker.getPropertyOfType(objType, propTsNode.name.text); + if (propSymbol == null) { + // Expected object type is known, but it doesn't have this method. + return; + } + const propExpectedType = checker.getTypeOfSymbolAtLocation(propSymbol, propTsNode); + if (isVoidReturningFunctionType(propExpectedType)) { + reportIfNonVoidFunction(valueNode); + } + return; + } + // Object property is a regular property. + checkExpressionNode(valueNode); + } + /** + * Finds errors in a class property. + * + * In addition to the regular check against the contextual type, + * we also check against the base class property (when the class extends another class) + * and the implemented interfaces (when the class implements an interface). + */ + function checkClassPropertyNode(propNode) { + if (propNode.value == null) { + return; + } + // Check in comparison to the base types. + for (const { baseMemberType } of util.getBaseTypesOfClassMember(parserServices, propNode)) { + if (isVoidReturningFunctionType(baseMemberType)) { + reportIfNonVoidFunction(propNode.value); + return; // Report at most one error. + } + } + // Check in comparison to the contextual type. + checkExpressionNode(propNode.value); + } + /** + * Finds errors in a class method. + * + * We check against the base class method (when the class extends another class) + * and the implemented interfaces (when the class implements an interface). + */ + function checkClassMethodNode(methodNode) { + if (methodNode.value.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + return; + } + // Check in comparison to the base types. + for (const { baseMemberType } of util.getBaseTypesOfClassMember(parserServices, methodNode)) { + if (isVoidReturningFunctionType(baseMemberType)) { + reportIfNonVoidFunction(methodNode.value); + return; // Report at most one error. + } + } + } + /** + * Reports an error if the provided node is not allowed in a void function context. + */ + function reportIfNonVoidFunction(funcNode) { + const allowedReturnType = ts.TypeFlags.Void | + ts.TypeFlags.Never | + ts.TypeFlags.Undefined | + (options.allowReturnAny ? ts.TypeFlags.Any : 0); + const tsNode = parserServices.esTreeNodeToTSNodeMap.get(funcNode); + const actualType = checker.getApparentType(checker.getTypeAtLocation(tsNode)); + if (tsutils + .getCallSignaturesOfType(actualType) + .map(signature => signature.getReturnType()) + .flatMap(returnType => tsutils.unionConstituents(returnType)) + .every(type => tsutils.isTypeFlagSet(type, allowedReturnType))) { + // The function is already void. + return; + } + if (funcNode.type !== utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + funcNode.type !== utils_1.AST_NODE_TYPES.FunctionExpression) { + // The provided function is not a function literal. + // Report a generic error. + return context.report({ + node: funcNode, + messageId: `nonVoidFunc`, + }); + } + // The provided function is a function literal. + if (funcNode.generator) { + // The provided function is a generator function. + // Generator functions are not allowed. + return context.report({ + loc: util.getFunctionHeadLoc(funcNode, sourceCode), + messageId: `nonVoidFunc`, + }); + } + if (funcNode.async) { + // The provided function is an async function. + // Async functions aren't allowed. + return context.report({ + loc: util.getFunctionHeadLoc(funcNode, sourceCode), + messageId: `asyncFunc`, + }); + } + if (funcNode.body.type !== utils_1.AST_NODE_TYPES.BlockStatement) { + // The provided function is an arrow function shorthand without braces. + return context.report({ + node: funcNode.body, + messageId: `nonVoidReturn`, + }); + } + // The function is a regular or arrow function with a block body. + // Check return type annotation. + if (funcNode.returnType != null) { + // The provided function has an explicit return type annotation. + const typeAnnotationNode = funcNode.returnType.typeAnnotation; + if (typeAnnotationNode.type !== utils_1.AST_NODE_TYPES.TSVoidKeyword) { + // The explicit return type is not `void`. + return context.report({ + node: typeAnnotationNode, + messageId: `nonVoidFunc`, + }); + } + } + // Iterate over all function's return statements. + for (const statement of util.walkStatements(funcNode.body.body)) { + if (statement.type !== utils_1.AST_NODE_TYPES.ReturnStatement || + statement.argument == null) { + // We only care about return statements with a value. + continue; + } + const returnType = checker.getTypeAtLocation(parserServices.esTreeNodeToTSNodeMap.get(statement.argument)); + if (tsutils.isTypeFlagSet(returnType, allowedReturnType)) { + // Only visit return statements with invalid type. + continue; + } + // This return statement causes the non-void return type. + const returnKeyword = util.nullThrows(sourceCode.getFirstToken(statement, { + filter: token => token.value === 'return', + }), util.NullThrowsReasons.MissingToken('return keyword', statement.type)); + context.report({ + node: returnKeyword, + messageId: `nonVoidReturn`, + }); + } + // No invalid returns found. The function is allowed. + } + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d4549f17d418e31029585206d5f8faa273594041 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.d.ts @@ -0,0 +1,33 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type Options = [ + { + /** + * If `true`, allow `default` cases on switch statements with exhaustive + * cases. + * + * @default true + */ + allowDefaultCaseForExhaustiveSwitch?: boolean; + /** + * If `true`, require a `default` clause for switches on non-union types. + * + * @default false + */ + requireDefaultForNonUnion?: boolean; + /** + * Regular expression for a comment that can indicate an intentionally omitted default case. + */ + defaultCaseCommentPattern?: string; + /** + * If `true`, the `default` clause is used to determine whether the switch statement is exhaustive for union types. + * + * @default false + */ + considerDefaultExhaustiveForUnions?: boolean; + } +]; +export type MessageIds = 'addMissingCases' | 'dangerousDefaultCase' | 'switchIsNotExhaustive'; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js new file mode 100644 index 0000000000000000000000000000000000000000..cce57df8d3748c50d47fda992141bbf787e37531 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/switch-exhaustiveness-check.js @@ -0,0 +1,291 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +const DEFAULT_COMMENT_PATTERN = /^no default$/iu; +exports.default = (0, util_1.createRule)({ + name: 'switch-exhaustiveness-check', + meta: { + type: 'suggestion', + docs: { + description: 'Require switch-case statements to be exhaustive', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + addMissingCases: 'Add branches for missing cases.', + dangerousDefaultCase: 'The switch statement is exhaustive, so the default case is unnecessary.', + switchIsNotExhaustive: 'Switch is not exhaustive. Cases not matched: {{missingBranches}}', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + allowDefaultCaseForExhaustiveSwitch: { + type: 'boolean', + description: `If 'true', allow 'default' cases on switch statements with exhaustive cases.`, + }, + considerDefaultExhaustiveForUnions: { + type: 'boolean', + description: `If 'true', the 'default' clause is used to determine whether the switch statement is exhaustive for union type`, + }, + defaultCaseCommentPattern: { + type: 'string', + description: `Regular expression for a comment that can indicate an intentionally omitted default case.`, + }, + requireDefaultForNonUnion: { + type: 'boolean', + description: `If 'true', require a 'default' clause for switches on non-union types.`, + }, + }, + }, + ], + }, + defaultOptions: [ + { + allowDefaultCaseForExhaustiveSwitch: true, + considerDefaultExhaustiveForUnions: false, + requireDefaultForNonUnion: false, + }, + ], + create(context, [{ allowDefaultCaseForExhaustiveSwitch, considerDefaultExhaustiveForUnions, defaultCaseCommentPattern, requireDefaultForNonUnion, },]) { + const services = (0, util_1.getParserServices)(context); + const checker = services.program.getTypeChecker(); + const compilerOptions = services.program.getCompilerOptions(); + const commentRegExp = defaultCaseCommentPattern != null + ? new RegExp(defaultCaseCommentPattern, 'u') + : DEFAULT_COMMENT_PATTERN; + function getCommentDefaultCase(node) { + const lastCase = node.cases.at(-1); + const commentsAfterLastCase = lastCase + ? context.sourceCode.getCommentsAfter(lastCase) + : []; + const defaultCaseComment = commentsAfterLastCase.at(-1); + if (commentRegExp.test(defaultCaseComment?.value.trim() || '')) { + return defaultCaseComment; + } + return; + } + function typeToString(type) { + return checker.typeToString(type, undefined, ts.TypeFormatFlags.AllowUniqueESSymbolType | + ts.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope | + ts.TypeFormatFlags.UseFullyQualifiedType); + } + function getSwitchMetadata(node) { + const defaultCase = node.cases.find(switchCase => switchCase.test == null); + const discriminantType = (0, util_1.getConstrainedTypeAtLocation)(services, node.discriminant); + const symbolName = discriminantType.getSymbol()?.escapedName; + const containsNonLiteralType = doesTypeContainNonLiteralType(discriminantType); + const caseTypes = new Set(); + for (const switchCase of node.cases) { + // If the `test` property of the switch case is `null`, then we are on a + // `default` case. + if (switchCase.test == null) { + continue; + } + const caseType = (0, util_1.getConstrainedTypeAtLocation)(services, switchCase.test); + caseTypes.add(caseType); + } + const missingLiteralBranchTypes = []; + for (const unionPart of tsutils.unionConstituents(discriminantType)) { + for (const intersectionPart of tsutils.intersectionConstituents(unionPart)) { + if (caseTypes.has(intersectionPart) || + !isTypeLiteralLikeType(intersectionPart)) { + continue; + } + // "missing", "optional" and "undefined" types are different runtime objects, + // but all of them have TypeFlags.Undefined type flag + if ([...caseTypes].some(tsutils.isIntrinsicUndefinedType) && + tsutils.isIntrinsicUndefinedType(intersectionPart)) { + continue; + } + missingLiteralBranchTypes.push(intersectionPart); + } + } + return { + containsNonLiteralType, + defaultCase: defaultCase ?? getCommentDefaultCase(node), + missingLiteralBranchTypes, + symbolName, + }; + } + function checkSwitchExhaustive(node, switchMetadata) { + const { defaultCase, missingLiteralBranchTypes, symbolName } = switchMetadata; + // If considerDefaultExhaustiveForUnions is enabled, the presence of a default case + // always makes the switch exhaustive. + if (considerDefaultExhaustiveForUnions && defaultCase != null) { + return; + } + if (missingLiteralBranchTypes.length > 0) { + context.report({ + node: node.discriminant, + messageId: 'switchIsNotExhaustive', + data: { + missingBranches: missingLiteralBranchTypes + .map(missingType => tsutils.isTypeFlagSet(missingType, ts.TypeFlags.ESSymbolLike) + ? `typeof ${missingType.getSymbol()?.escapedName}` + : typeToString(missingType)) + .join(' | '), + }, + suggest: [ + { + messageId: 'addMissingCases', + fix(fixer) { + return fixSwitch(fixer, node, missingLiteralBranchTypes, defaultCase, symbolName?.toString()); + }, + }, + ], + }); + } + } + function fixSwitch(fixer, node, missingBranchTypes, // null means default branch + defaultCase, symbolName) { + const lastCase = node.cases.length > 0 ? node.cases[node.cases.length - 1] : null; + const caseIndent = lastCase + ? ' '.repeat(lastCase.loc.start.column) + : // If there are no cases, use indentation of the switch statement and + // leave it to the user to format it correctly. + ' '.repeat(node.loc.start.column); + const missingCases = []; + for (const missingBranchType of missingBranchTypes) { + if (missingBranchType == null) { + missingCases.push(`default: { throw new Error('default case') }`); + continue; + } + const missingBranchName = missingBranchType.getSymbol()?.escapedName; + let caseTest = tsutils.isTypeFlagSet(missingBranchType, ts.TypeFlags.ESSymbolLike) + ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + missingBranchName + : typeToString(missingBranchType); + if (symbolName && + (missingBranchName || missingBranchName === '') && + (0, util_1.requiresQuoting)(missingBranchName.toString(), compilerOptions.target)) { + const escapedBranchName = missingBranchName + .replaceAll("'", "\\'") + .replaceAll('\n', '\\n') + .replaceAll('\r', '\\r'); + caseTest = `${symbolName}['${escapedBranchName}']`; + } + missingCases.push(`case ${caseTest}: { throw new Error('Not implemented yet: ${caseTest + .replaceAll('\\', '\\\\') + .replaceAll("'", "\\'")} case') }`); + } + const fixString = missingCases + .map(code => `${caseIndent}${code}`) + .join('\n'); + if (lastCase) { + if (defaultCase) { + const beforeFixString = missingCases + .map(code => `${code}\n${caseIndent}`) + .join(''); + return fixer.insertTextBefore(defaultCase, beforeFixString); + } + return fixer.insertTextAfter(lastCase, `\n${fixString}`); + } + // There were no existing cases. + const openingBrace = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.discriminant, util_1.isOpeningBraceToken), util_1.NullThrowsReasons.MissingToken('{', 'discriminant')); + const closingBrace = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.discriminant, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', 'discriminant')); + return fixer.replaceTextRange([openingBrace.range[0], closingBrace.range[1]], ['{', fixString, `${caseIndent}}`].join('\n')); + } + function checkSwitchUnnecessaryDefaultCase(switchMetadata) { + if (allowDefaultCaseForExhaustiveSwitch) { + return; + } + const { containsNonLiteralType, defaultCase, missingLiteralBranchTypes } = switchMetadata; + if (missingLiteralBranchTypes.length === 0 && + defaultCase != null && + !containsNonLiteralType) { + context.report({ + node: defaultCase, + messageId: 'dangerousDefaultCase', + }); + } + } + function checkSwitchNoUnionDefaultCase(node, switchMetadata) { + if (!requireDefaultForNonUnion) { + return; + } + const { containsNonLiteralType, defaultCase } = switchMetadata; + if (containsNonLiteralType && defaultCase == null) { + context.report({ + node: node.discriminant, + messageId: 'switchIsNotExhaustive', + data: { missingBranches: 'default' }, + suggest: [ + { + messageId: 'addMissingCases', + fix(fixer) { + return fixSwitch(fixer, node, [null], defaultCase); + }, + }, + ], + }); + } + } + return { + SwitchStatement(node) { + const switchMetadata = getSwitchMetadata(node); + checkSwitchExhaustive(node, switchMetadata); + checkSwitchUnnecessaryDefaultCase(switchMetadata); + checkSwitchNoUnionDefaultCase(node, switchMetadata); + }, + }; + }, +}); +function isTypeLiteralLikeType(type) { + return tsutils.isTypeFlagSet(type, ts.TypeFlags.Literal | + ts.TypeFlags.Undefined | + ts.TypeFlags.Null | + ts.TypeFlags.UniqueESSymbol); +} +/** + * For example: + * + * - `"foo" | "bar"` is a type with all literal types. + * - `"foo" | number` is a type that contains non-literal types. + * - `"foo" & { bar: 1 }` is a type that contains non-literal types. + * + * Default cases are never superfluous in switches with non-literal types. + */ +function doesTypeContainNonLiteralType(type) { + return tsutils + .unionConstituents(type) + .some(type => tsutils + .intersectionConstituents(type) + .every(subType => !isTypeLiteralLikeType(subType))); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..abddeec2d3d8a4853d96127311839b0bf036861d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.d.ts @@ -0,0 +1,12 @@ +export type Options = [ + { + lib?: 'always' | 'never'; + path?: 'always' | 'never'; + types?: 'always' | 'never' | 'prefer-import'; + } +]; +export type MessageIds = 'tripleSlashReference'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"tripleSlashReference", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js new file mode 100644 index 0000000000000000000000000000000000000000..edc8d3f098d76d21c7ce06b7a5b9931c2f12c1f2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/triple-slash-reference.js @@ -0,0 +1,110 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'triple-slash-reference', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow certain triple slash directives in favor of ES6-style import declarations', + recommended: 'recommended', + }, + messages: { + tripleSlashReference: 'Do not use a triple slash reference for {{module}}, use `import` style instead.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + lib: { + type: 'string', + description: 'What to enforce for `/// ` references.', + enum: ['always', 'never'], + }, + path: { + type: 'string', + description: 'What to enforce for `/// ` references.', + enum: ['always', 'never'], + }, + types: { + type: 'string', + description: 'What to enforce for `/// ` references.', + enum: ['always', 'never', 'prefer-import'], + }, + }, + }, + ], + }, + defaultOptions: [ + { + lib: 'always', + path: 'never', + types: 'prefer-import', + }, + ], + create(context, [{ lib, path, types }]) { + let programNode; + const references = []; + function hasMatchingReference(source) { + references.forEach(reference => { + if (reference.importName === source.value) { + context.report({ + node: reference.comment, + messageId: 'tripleSlashReference', + data: { + module: reference.importName, + }, + }); + } + }); + } + return { + ImportDeclaration(node) { + if (programNode) { + hasMatchingReference(node.source); + } + }, + Program(node) { + if (lib === 'always' && path === 'always' && types === 'always') { + return; + } + programNode = node; + const referenceRegExp = /^\/\s* { + if (comment.type !== utils_1.AST_TOKEN_TYPES.Line) { + return; + } + const referenceResult = referenceRegExp.exec(comment.value); + if (referenceResult) { + if ((referenceResult[1] === 'types' && types === 'never') || + (referenceResult[1] === 'path' && path === 'never') || + (referenceResult[1] === 'lib' && lib === 'never')) { + context.report({ + node: comment, + messageId: 'tripleSlashReference', + data: { + module: referenceResult[2], + }, + }); + return; + } + if (referenceResult[1] === 'types' && types === 'prefer-import') { + references.push({ comment, importName: referenceResult[2] }); + } + } + }); + }, + TSImportEqualsDeclaration(node) { + if (programNode) { + const reference = node.moduleReference; + if (reference.type === utils_1.AST_NODE_TYPES.TSExternalModuleReference) { + hasMatchingReference(reference.expression); + } + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f61f165de29090e819fb569117e9182da32028a6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.d.ts @@ -0,0 +1,16 @@ +export declare const enum OptionKeys { + ArrayDestructuring = "arrayDestructuring", + ArrowParameter = "arrowParameter", + MemberVariableDeclaration = "memberVariableDeclaration", + ObjectDestructuring = "objectDestructuring", + Parameter = "parameter", + PropertyDeclaration = "propertyDeclaration", + VariableDeclaration = "variableDeclaration", + VariableDeclarationIgnoreFunction = "variableDeclarationIgnoreFunction" +} +export type Options = [Partial>]; +export type MessageIds = 'expectedTypedef' | 'expectedTypedefNamed'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js new file mode 100644 index 0000000000000000000000000000000000000000..1e9b27b95a34599f97a8f6477a7bd3efccd0223d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/typedef.js @@ -0,0 +1,239 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OptionKeys = void 0; +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +var OptionKeys; +(function (OptionKeys) { + OptionKeys["ArrayDestructuring"] = "arrayDestructuring"; + OptionKeys["ArrowParameter"] = "arrowParameter"; + OptionKeys["MemberVariableDeclaration"] = "memberVariableDeclaration"; + OptionKeys["ObjectDestructuring"] = "objectDestructuring"; + OptionKeys["Parameter"] = "parameter"; + OptionKeys["PropertyDeclaration"] = "propertyDeclaration"; + OptionKeys["VariableDeclaration"] = "variableDeclaration"; + OptionKeys["VariableDeclarationIgnoreFunction"] = "variableDeclarationIgnoreFunction"; +})(OptionKeys || (exports.OptionKeys = OptionKeys = {})); +exports.default = (0, util_1.createRule)({ + name: 'typedef', + meta: { + type: 'suggestion', + deprecated: { + deprecatedSince: '8.33.0', + message: 'This is an old rule that is no longer recommended for use.', + }, + docs: { + description: 'Require type annotations in certain places', + }, + messages: { + expectedTypedef: 'Expected a type annotation.', + expectedTypedefNamed: 'Expected {{name}} to have a type annotation.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + [OptionKeys.ArrayDestructuring]: { + type: 'boolean', + description: 'Whether to enforce type annotations on variables declared using array destructuring.', + }, + [OptionKeys.ArrowParameter]: { + type: 'boolean', + description: 'Whether to enforce type annotations for parameters of arrow functions.', + }, + [OptionKeys.MemberVariableDeclaration]: { + type: 'boolean', + description: 'Whether to enforce type annotations on member variables of classes.', + }, + [OptionKeys.ObjectDestructuring]: { + type: 'boolean', + description: 'Whether to enforce type annotations on variables declared using object destructuring.', + }, + [OptionKeys.Parameter]: { + type: 'boolean', + description: 'Whether to enforce type annotations for parameters of functions and methods.', + }, + [OptionKeys.PropertyDeclaration]: { + type: 'boolean', + description: 'Whether to enforce type annotations for properties of interfaces and types.', + }, + [OptionKeys.VariableDeclaration]: { + type: 'boolean', + description: 'Whether to enforce type annotations for variable declarations, excluding array and object destructuring.', + }, + [OptionKeys.VariableDeclarationIgnoreFunction]: { + type: 'boolean', + description: 'Whether to ignore variable declarations for non-arrow and arrow functions.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + [OptionKeys.ArrayDestructuring]: false, + [OptionKeys.ArrowParameter]: false, + [OptionKeys.MemberVariableDeclaration]: false, + [OptionKeys.ObjectDestructuring]: false, + [OptionKeys.Parameter]: false, + [OptionKeys.PropertyDeclaration]: false, + [OptionKeys.VariableDeclaration]: false, + [OptionKeys.VariableDeclarationIgnoreFunction]: false, + }, + ], + create(context, [{ arrayDestructuring, arrowParameter, memberVariableDeclaration, objectDestructuring, parameter, propertyDeclaration, variableDeclaration, variableDeclarationIgnoreFunction, },]) { + function report(location, name) { + context.report({ + node: location, + messageId: name ? 'expectedTypedefNamed' : 'expectedTypedef', + data: { name }, + }); + } + function getNodeName(node) { + return node.type === utils_1.AST_NODE_TYPES.Identifier ? node.name : undefined; + } + function isForOfStatementContext(node) { + let current = node.parent; + while (current) { + switch (current.type) { + case utils_1.AST_NODE_TYPES.VariableDeclarator: + case utils_1.AST_NODE_TYPES.VariableDeclaration: + case utils_1.AST_NODE_TYPES.ObjectPattern: + case utils_1.AST_NODE_TYPES.ArrayPattern: + case utils_1.AST_NODE_TYPES.Property: + current = current.parent; + break; + case utils_1.AST_NODE_TYPES.ForOfStatement: + return true; + default: + current = undefined; + } + } + return false; + } + function checkParameters(params) { + for (const param of params) { + let annotationNode; + switch (param.type) { + case utils_1.AST_NODE_TYPES.AssignmentPattern: + annotationNode = param.left; + break; + case utils_1.AST_NODE_TYPES.TSParameterProperty: + annotationNode = param.parameter; + // Check TS parameter property with default value like `constructor(private param: string = 'something') {}` + if (annotationNode.type === utils_1.AST_NODE_TYPES.AssignmentPattern) { + annotationNode = annotationNode.left; + } + break; + default: + annotationNode = param; + break; + } + if (!annotationNode.typeAnnotation) { + report(param, getNodeName(param)); + } + } + } + function isVariableDeclarationIgnoreFunction(node) { + return (variableDeclarationIgnoreFunction === true && + (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + node.type === utils_1.AST_NODE_TYPES.FunctionExpression)); + } + function isAncestorHasTypeAnnotation(node) { + let ancestor = node.parent; + while (ancestor) { + if ((ancestor.type === utils_1.AST_NODE_TYPES.ObjectPattern || + ancestor.type === utils_1.AST_NODE_TYPES.ArrayPattern) && + ancestor.typeAnnotation) { + return true; + } + ancestor = ancestor.parent; + } + return false; + } + return { + ...(arrayDestructuring && { + ArrayPattern(node) { + if (node.parent.type === utils_1.AST_NODE_TYPES.RestElement && + node.parent.typeAnnotation) { + return; + } + if (!node.typeAnnotation && + !isForOfStatementContext(node) && + !isAncestorHasTypeAnnotation(node) && + node.parent.type !== utils_1.AST_NODE_TYPES.AssignmentExpression) { + report(node); + } + }, + }), + ...(arrowParameter && { + ArrowFunctionExpression(node) { + checkParameters(node.params); + }, + }), + ...(memberVariableDeclaration && { + PropertyDefinition(node) { + if (!(node.value && isVariableDeclarationIgnoreFunction(node.value)) && + !node.typeAnnotation) { + report(node, node.key.type === utils_1.AST_NODE_TYPES.Identifier + ? node.key.name + : undefined); + } + }, + }), + ...(parameter && { + 'FunctionDeclaration, FunctionExpression'(node) { + checkParameters(node.params); + }, + }), + ...(objectDestructuring && { + ObjectPattern(node) { + if (!node.typeAnnotation && + !isForOfStatementContext(node) && + !isAncestorHasTypeAnnotation(node)) { + report(node); + } + }, + }), + ...(propertyDeclaration && { + 'TSIndexSignature, TSPropertySignature'(node) { + if (!node.typeAnnotation) { + report(node, node.type === utils_1.AST_NODE_TYPES.TSPropertySignature + ? getNodeName(node.key) + : undefined); + } + }, + }), + VariableDeclarator(node) { + if (!variableDeclaration || + node.id.typeAnnotation || + (node.id.type === utils_1.AST_NODE_TYPES.ArrayPattern && + !arrayDestructuring) || + (node.id.type === utils_1.AST_NODE_TYPES.ObjectPattern && + !objectDestructuring) || + (node.init && isVariableDeclarationIgnoreFunction(node.init))) { + return; + } + let current = node.parent; + while (current) { + switch (current.type) { + case utils_1.AST_NODE_TYPES.VariableDeclaration: + // Keep looking upwards + current = current.parent; + break; + case utils_1.AST_NODE_TYPES.ForOfStatement: + case utils_1.AST_NODE_TYPES.ForInStatement: + // Stop traversing and don't report an error + return; + default: + // Stop traversing + current = undefined; + break; + } + } + report(node, getNodeName(node.id)); + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..155e86250bafa901c1695e0ad4006113d78eb93b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.d.ts @@ -0,0 +1,9 @@ +interface Config { + ignoreStatic: boolean; +} +export type Options = [Config]; +export type MessageIds = 'unbound' | 'unboundWithoutThisAnnotation'; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js new file mode 100644 index 0000000000000000000000000000000000000000..f8e7b6ccdaf8f7798b5eb793f43f75b2bcd412d8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unbound-method.js @@ -0,0 +1,334 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const util_1 = require("../util"); +/** + * Static methods on these globals are either not `this`-aware or supported being + * called without `this`. + * + * - `Promise` is not in the list because it supports subclassing by using `this` + * - `Array` is in the list because although it supports subclassing, the `this` + * value defaults to `Array` when unbound + * + * This is now a language-design invariant: static methods are never `this`-aware + * because TC39 wants to make `array.map(Class.method)` work! + */ +const SUPPORTED_GLOBALS = [ + 'Number', + 'Object', + 'String', // eslint-disable-line @typescript-eslint/internal/prefer-ast-types-enum + 'RegExp', + 'Symbol', + 'Array', + 'Proxy', + 'Date', + 'Atomics', + 'Reflect', + 'console', + 'Math', + 'JSON', + 'Intl', +]; +const nativelyBoundMembers = new Set(SUPPORTED_GLOBALS.flatMap(namespace => { + if (!(namespace in global)) { + // node.js might not have namespaces like Intl depending on compilation options + // https://nodejs.org/api/intl.html#intl_options_for_building_node_js + return []; + } + const object = global[namespace]; + return Object.getOwnPropertyNames(object) + .filter(name => !name.startsWith('_') && + typeof object[name] === 'function') + .map(name => `${namespace}.${name}`); +})); +const SUPPORTED_GLOBAL_TYPES = [ + 'NumberConstructor', + 'ObjectConstructor', + 'StringConstructor', + 'SymbolConstructor', + 'ArrayConstructor', + 'Array', + 'ProxyConstructor', + 'Console', + 'DateConstructor', + 'Atomics', + 'Math', + 'JSON', +]; +const isNotImported = (symbol, currentSourceFile) => { + const { valueDeclaration } = symbol; + if (!valueDeclaration) { + // working around https://github.com/microsoft/TypeScript/issues/31294 + return false; + } + return (!!currentSourceFile && + currentSourceFile !== valueDeclaration.getSourceFile()); +}; +const BASE_MESSAGE = [ + `A method that is not declared with \`this: void\` may cause unintentional scoping of \`this\` when separated from its object.`, + `Consider using an arrow function or explicitly \`.bind()\`ing the method to avoid calling the method with an unintended \`this\` value. `, +].join('\n'); +exports.default = (0, util_1.createRule)({ + name: 'unbound-method', + meta: { + type: 'problem', + docs: { + description: 'Enforce unbound methods are called with their expected scope', + recommended: 'recommended', + requiresTypeChecking: true, + }, + messages: { + unbound: BASE_MESSAGE, + unboundWithoutThisAnnotation: `${BASE_MESSAGE}\nIf a function does not access \`this\`, it can be annotated with \`this: void\`.`, + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoreStatic: { + type: 'boolean', + description: 'Whether to skip checking whether `static` methods are correctly bound.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoreStatic: false, + }, + ], + create(context, [{ ignoreStatic }]) { + const services = (0, util_1.getParserServices)(context); + const currentSourceFile = services.program.getSourceFile(context.filename); + function checkIfMethodAndReport(node, symbol) { + if (!symbol) { + return false; + } + const { dangerous, firstParamIsThis } = checkIfMethod(symbol, ignoreStatic); + if (dangerous) { + context.report({ + node, + messageId: firstParamIsThis === false + ? 'unboundWithoutThisAnnotation' + : 'unbound', + }); + return true; + } + return false; + } + function isNativelyBound(object, property) { + // We can't rely entirely on the type-level checks made at the end of this + // function, because sometimes type declarations don't come from the + // default library, but come from, for example, "@types/node". And we can't + // tell if a method is unbound just by looking at its signature declared in + // the interface. + // + // See related discussion https://github.com/typescript-eslint/typescript-eslint/pull/8952#discussion_r1576543310 + if (object.type === utils_1.AST_NODE_TYPES.Identifier && + property.type === utils_1.AST_NODE_TYPES.Identifier) { + const objectSymbol = services.getSymbolAtLocation(object); + const notImported = objectSymbol != null && + isNotImported(objectSymbol, currentSourceFile); + if (notImported && + nativelyBoundMembers.has(`${object.name}.${property.name}`)) { + return true; + } + } + // if `${object.name}.${property.name}` doesn't match any of + // the nativelyBoundMembers, then we fallback to type-level checks + return ((0, util_1.isBuiltinSymbolLike)(services.program, services.getTypeAtLocation(object), SUPPORTED_GLOBAL_TYPES) && + (0, util_1.isSymbolFromDefaultLibrary)(services.program, services.getTypeAtLocation(property).getSymbol())); + } + return { + MemberExpression(node) { + if (isSafeUse(node) || isNativelyBound(node.object, node.property)) { + return; + } + checkIfMethodAndReport(node, services.getSymbolAtLocation(node)); + }, + ObjectPattern(node) { + if (isNodeInsideTypeDeclaration(node)) { + return; + } + let initNode = null; + if (node.parent.type === utils_1.AST_NODE_TYPES.VariableDeclarator) { + initNode = node.parent.init; + } + else if (node.parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern || + node.parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression) { + initNode = node.parent.right; + } + for (const property of node.properties) { + if (property.type !== utils_1.AST_NODE_TYPES.Property || + property.key.type !== utils_1.AST_NODE_TYPES.Identifier) { + continue; + } + if (initNode) { + if (!isNativelyBound(initNode, property.key)) { + const reported = checkIfMethodAndReport(property.key, services + .getTypeAtLocation(initNode) + .getProperty(property.key.name)); + if (reported) { + continue; + } + // In assignment patterns, we should also check the type of + // Foo's nativelyBound method because initNode might be used as + // default value: + // function ({ nativelyBound }: Foo = NativeObject) {} + } + else if (node.parent.type !== utils_1.AST_NODE_TYPES.AssignmentPattern) { + continue; + } + } + for (const intersectionPart of tsutils + .unionConstituents(services.getTypeAtLocation(node)) + .flatMap(unionPart => tsutils.intersectionConstituents(unionPart))) { + const reported = checkIfMethodAndReport(property.key, intersectionPart.getProperty(property.key.name)); + if (reported) { + break; + } + } + } + }, + }; + }, +}); +function isNodeInsideTypeDeclaration(node) { + let parent = node; + while ((parent = parent.parent)) { + if ((parent.type === utils_1.AST_NODE_TYPES.ClassDeclaration && parent.declare) || + parent.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition || + parent.type === utils_1.AST_NODE_TYPES.TSDeclareFunction || + parent.type === utils_1.AST_NODE_TYPES.TSFunctionType || + parent.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration || + parent.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration || + (parent.type === utils_1.AST_NODE_TYPES.VariableDeclaration && parent.declare)) { + return true; + } + } + return false; +} +function checkIfMethod(symbol, ignoreStatic) { + const { valueDeclaration } = symbol; + if (!valueDeclaration) { + // working around https://github.com/microsoft/TypeScript/issues/31294 + return { dangerous: false }; + } + switch (valueDeclaration.kind) { + case ts.SyntaxKind.PropertyDeclaration: + return { + dangerous: valueDeclaration.initializer?.kind === + ts.SyntaxKind.FunctionExpression, + }; + case ts.SyntaxKind.PropertyAssignment: { + const assignee = valueDeclaration.initializer; + if (assignee.kind !== ts.SyntaxKind.FunctionExpression) { + return { + dangerous: false, + }; + } + return checkMethod(assignee, ignoreStatic); + } + case ts.SyntaxKind.MethodDeclaration: + case ts.SyntaxKind.MethodSignature: { + return checkMethod(valueDeclaration, ignoreStatic); + } + } + return { dangerous: false }; +} +function checkMethod(valueDeclaration, ignoreStatic) { + const firstParam = valueDeclaration.parameters.at(0); + const firstParamIsThis = firstParam?.name.kind === ts.SyntaxKind.Identifier && + // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison + firstParam.name.escapedText === 'this'; + const thisArgIsVoid = firstParamIsThis && firstParam.type?.kind === ts.SyntaxKind.VoidKeyword; + return { + dangerous: !thisArgIsVoid && + !(ignoreStatic && + tsutils.includesModifier((0, util_1.getModifiers)(valueDeclaration), ts.SyntaxKind.StaticKeyword)), + firstParamIsThis, + }; +} +function isSafeUse(node) { + const parent = node.parent; + switch (parent?.type) { + case utils_1.AST_NODE_TYPES.IfStatement: + case utils_1.AST_NODE_TYPES.ForStatement: + case utils_1.AST_NODE_TYPES.MemberExpression: + case utils_1.AST_NODE_TYPES.SwitchStatement: + case utils_1.AST_NODE_TYPES.UpdateExpression: + case utils_1.AST_NODE_TYPES.WhileStatement: + return true; + case utils_1.AST_NODE_TYPES.CallExpression: + return parent.callee === node; + case utils_1.AST_NODE_TYPES.ConditionalExpression: + return parent.test === node; + case utils_1.AST_NODE_TYPES.TaggedTemplateExpression: + return parent.tag === node; + case utils_1.AST_NODE_TYPES.UnaryExpression: + // the first case is safe for obvious + // reasons. The second one is also fine + // since we're returning something falsy + return ['!', 'delete', 'typeof', 'void'].includes(parent.operator); + case utils_1.AST_NODE_TYPES.BinaryExpression: + return ['!=', '!==', '==', '===', 'instanceof'].includes(parent.operator); + case utils_1.AST_NODE_TYPES.AssignmentExpression: + return (parent.operator === '=' && + (node === parent.left || + (node.type === utils_1.AST_NODE_TYPES.MemberExpression && + node.object.type === utils_1.AST_NODE_TYPES.Super && + parent.left.type === utils_1.AST_NODE_TYPES.MemberExpression && + parent.left.object.type === utils_1.AST_NODE_TYPES.ThisExpression))); + case utils_1.AST_NODE_TYPES.ChainExpression: + case utils_1.AST_NODE_TYPES.TSNonNullExpression: + case utils_1.AST_NODE_TYPES.TSAsExpression: + case utils_1.AST_NODE_TYPES.TSTypeAssertion: + return isSafeUse(parent); + case utils_1.AST_NODE_TYPES.LogicalExpression: + if (parent.operator === '&&' && parent.left === node) { + // this is safe, as && will return the left if and only if it's falsy + return true; + } + // in all other cases, it's likely the logical expression will return the method ref + // so make sure the parent is a safe usage + return isSafeUse(parent); + } + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ebae67283d1ecba4f2a1496cc79fa2cf5b1d8df5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.d.ts @@ -0,0 +1,11 @@ +export type MessageIds = 'omittingRestParameter' | 'omittingSingleParameter' | 'singleParameterDifference'; +export type Options = [ + { + ignoreDifferentlyNamedParameters?: boolean; + ignoreOverloadsWithDifferentJSDoc?: boolean; + } +]; +declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js new file mode 100644 index 0000000000000000000000000000000000000000..41e909724558b7db7a8d14e1b0376a6cf9f77c97 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/unified-signatures.js @@ -0,0 +1,465 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const util_1 = require("../util"); +exports.default = (0, util_1.createRule)({ + name: 'unified-signatures', + meta: { + type: 'suggestion', + docs: { + description: 'Disallow two overloads that could be unified into one with a union or an optional/rest parameter', + // too opinionated to be recommended + recommended: 'strict', + }, + messages: { + omittingRestParameter: '{{failureStringStart}} with a rest parameter.', + omittingSingleParameter: '{{failureStringStart}} with an optional parameter.', + singleParameterDifference: '{{failureStringStart}} taking `{{type1}} | {{type2}}`.', + }, + schema: [ + { + type: 'object', + additionalProperties: false, + properties: { + ignoreDifferentlyNamedParameters: { + type: 'boolean', + description: 'Whether two parameters with different names at the same index should be considered different even if their types are the same.', + }, + ignoreOverloadsWithDifferentJSDoc: { + type: 'boolean', + description: 'Whether two overloads with different JSDoc comments should be considered different even if their parameter and return types are the same.', + }, + }, + }, + ], + }, + defaultOptions: [ + { + ignoreDifferentlyNamedParameters: false, + ignoreOverloadsWithDifferentJSDoc: false, + }, + ], + create(context, [{ ignoreDifferentlyNamedParameters, ignoreOverloadsWithDifferentJSDoc }]) { + //---------------------------------------------------------------------- + // Helpers + //---------------------------------------------------------------------- + function failureStringStart(otherLine) { + // For only 2 overloads we don't need to specify which is the other one. + const overloads = otherLine == null + ? 'These overloads' + : `This overload and the one on line ${otherLine}`; + return `${overloads} can be combined into one signature`; + } + function addFailures(failures) { + for (const failure of failures) { + const { only2, unify } = failure; + switch (unify.kind) { + case 'single-parameter-difference': { + const { p0, p1 } = unify; + const lineOfOtherOverload = only2 ? undefined : p0.loc.start.line; + const typeAnnotation0 = isTSParameterProperty(p0) + ? p0.parameter.typeAnnotation + : p0.typeAnnotation; + const typeAnnotation1 = isTSParameterProperty(p1) + ? p1.parameter.typeAnnotation + : p1.typeAnnotation; + context.report({ + loc: p1.loc, + node: p1, + messageId: 'singleParameterDifference', + data: { + failureStringStart: failureStringStart(lineOfOtherOverload), + type1: context.sourceCode.getText(typeAnnotation0?.typeAnnotation), + type2: context.sourceCode.getText(typeAnnotation1?.typeAnnotation), + }, + }); + break; + } + case 'extra-parameter': { + const { extraParameter, otherSignature } = unify; + const lineOfOtherOverload = only2 + ? undefined + : otherSignature.loc.start.line; + context.report({ + loc: extraParameter.loc, + node: extraParameter, + messageId: extraParameter.type === utils_1.AST_NODE_TYPES.RestElement + ? 'omittingRestParameter' + : 'omittingSingleParameter', + data: { + failureStringStart: failureStringStart(lineOfOtherOverload), + }, + }); + } + } + } + } + function checkOverloads(signatures, typeParameters) { + const result = []; + const isTypeParameter = getIsTypeParameter(typeParameters); + for (const overloads of signatures) { + forEachPair(overloads, (a, b) => { + const signature0 = a.value ?? a; + const signature1 = b.value ?? b; + const unify = compareSignatures(signature0, signature1, isTypeParameter); + if (unify != null) { + result.push({ only2: overloads.length === 2, unify }); + } + }); + } + return result; + } + function compareSignatures(a, b, isTypeParameter) { + if (!signaturesCanBeUnified(a, b, isTypeParameter)) { + return undefined; + } + return a.params.length === b.params.length + ? signaturesDifferBySingleParameter(a.params, b.params) + : signaturesDifferByOptionalOrRestParameter(a, b); + } + function signaturesCanBeUnified(a, b, isTypeParameter) { + // Must return the same type. + const aTypeParams = a.typeParameters != null ? a.typeParameters.params : undefined; + const bTypeParams = b.typeParameters != null ? b.typeParameters.params : undefined; + if (ignoreDifferentlyNamedParameters) { + const commonParamsLength = Math.min(a.params.length, b.params.length); + for (let i = 0; i < commonParamsLength; i += 1) { + if (a.params[i].type === b.params[i].type && + getStaticParameterName(a.params[i]) !== + getStaticParameterName(b.params[i])) { + return false; + } + } + } + if (ignoreOverloadsWithDifferentJSDoc) { + const aComment = getBlockCommentForNode(getCommentTargetNode(a)); + const bComment = getBlockCommentForNode(getCommentTargetNode(b)); + if (aComment?.value !== bComment?.value) { + return false; + } + } + return (typesAreEqual(a.returnType, b.returnType) && + // Must take the same type parameters. + // If one uses a type parameter (from outside) and the other doesn't, they shouldn't be joined. + (0, util_1.arraysAreEqual)(aTypeParams, bTypeParams, typeParametersAreEqual) && + signatureUsesTypeParameter(a, isTypeParameter) === + signatureUsesTypeParameter(b, isTypeParameter)); + } + /** Detect `a(x: number, y: number, z: number)` and `a(x: number, y: string, z: number)`. */ + function signaturesDifferBySingleParameter(types1, types2) { + const firstParam1 = types1[0]; + const firstParam2 = types2[0]; + // exempt signatures with `this: void` from the rule + if (isThisVoidParam(firstParam1) || isThisVoidParam(firstParam2)) { + return undefined; + } + const index = getIndexOfFirstDifference(types1, types2, parametersAreEqual); + if (index == null) { + return undefined; + } + // If remaining arrays are equal, the signatures differ by just one parameter type + if (!(0, util_1.arraysAreEqual)(types1.slice(index + 1), types2.slice(index + 1), parametersAreEqual)) { + return undefined; + } + const a = types1[index]; + const b = types2[index]; + // Can unify `a?: string` and `b?: number`. Can't unify `...args: string[]` and `...args: number[]`. + // See https://github.com/Microsoft/TypeScript/issues/5077 + return parametersHaveEqualSigils(a, b) && + a.type !== utils_1.AST_NODE_TYPES.RestElement + ? { kind: 'single-parameter-difference', p0: a, p1: b } + : undefined; + } + function isThisParam(param) { + return param?.type === utils_1.AST_NODE_TYPES.Identifier && param.name === 'this'; + } + function isThisVoidParam(param) { + return (isThisParam(param) && + param.typeAnnotation?.typeAnnotation.type === + utils_1.AST_NODE_TYPES.TSVoidKeyword); + } + /** + * Detect `a(): void` and `a(x: number): void`. + * Returns the parameter declaration (`x: number` in this example) that should be optional/rest, and overload it's a part of. + */ + function signaturesDifferByOptionalOrRestParameter(a, b) { + const sig1 = a.params; + const sig2 = b.params; + const minLength = Math.min(sig1.length, sig2.length); + const longer = sig1.length < sig2.length ? sig2 : sig1; + const shorter = sig1.length < sig2.length ? sig1 : sig2; + const shorterSig = sig1.length < sig2.length ? a : b; + const firstParam1 = sig1.at(0); + const firstParam2 = sig2.at(0); + // If one signature has explicit this type and another doesn't, they can't + // be unified. + if (isThisParam(firstParam1) !== isThisParam(firstParam2)) { + return undefined; + } + // exempt signatures with `this: void` from the rule + if (isThisVoidParam(firstParam1) || isThisVoidParam(firstParam2)) { + return undefined; + } + // If one is has 2+ parameters more than the other, they must all be optional/rest. + // Differ by optional parameters: f() and f(x), f() and f(x, ?y, ...z) + // Not allowed: f() and f(x, y) + for (let i = minLength + 1; i < longer.length; i++) { + if (!parameterMayBeMissing(longer[i])) { + return undefined; + } + } + for (let i = 0; i < minLength; i++) { + const sig1i = sig1[i]; + const sig2i = sig2[i]; + const typeAnnotation1 = isTSParameterProperty(sig1i) + ? sig1i.parameter.typeAnnotation + : sig1i.typeAnnotation; + const typeAnnotation2 = isTSParameterProperty(sig2i) + ? sig2i.parameter.typeAnnotation + : sig2i.typeAnnotation; + if (!typesAreEqual(typeAnnotation1, typeAnnotation2)) { + return undefined; + } + } + if (minLength > 0 && + shorter[minLength - 1].type === utils_1.AST_NODE_TYPES.RestElement) { + return undefined; + } + return { + extraParameter: longer[longer.length - 1], + kind: 'extra-parameter', + otherSignature: shorterSig, + }; + } + /** Given type parameters, returns a function to test whether a type is one of those parameters. */ + function getIsTypeParameter(typeParameters) { + if (typeParameters == null) { + return () => false; + } + const set = new Set(); + for (const t of typeParameters.params) { + set.add(t.name.name); + } + return typeName => set.has(typeName); + } + /** True if any of the outer type parameters are used in a signature. */ + function signatureUsesTypeParameter(sig, isTypeParameter) { + return sig.params.some((p) => typeContainsTypeParameter(isTSParameterProperty(p) + ? p.parameter.typeAnnotation + : p.typeAnnotation)); + function typeContainsTypeParameter(type) { + if (!type) { + return false; + } + if (type.type === utils_1.AST_NODE_TYPES.TSTypeReference) { + const typeName = type.typeName; + if (isIdentifier(typeName) && isTypeParameter(typeName.name)) { + return true; + } + } + return typeContainsTypeParameter(type.typeAnnotation ?? + type.elementType); + } + } + function isTSParameterProperty(node) { + return node.type === utils_1.AST_NODE_TYPES.TSParameterProperty; + } + function parametersAreEqual(a, b) { + const typeAnnotationA = isTSParameterProperty(a) + ? a.parameter.typeAnnotation + : a.typeAnnotation; + const typeAnnotationB = isTSParameterProperty(b) + ? b.parameter.typeAnnotation + : b.typeAnnotation; + return (parametersHaveEqualSigils(a, b) && + typesAreEqual(typeAnnotationA, typeAnnotationB)); + } + /** True for optional/rest parameters. */ + function parameterMayBeMissing(p) { + const optional = isTSParameterProperty(p) + ? p.parameter.optional + : p.optional; + return p.type === utils_1.AST_NODE_TYPES.RestElement || optional; + } + /** False if one is optional and the other isn't, or one is a rest parameter and the other isn't. */ + function parametersHaveEqualSigils(a, b) { + const optionalA = isTSParameterProperty(a) + ? a.parameter.optional + : a.optional; + const optionalB = isTSParameterProperty(b) + ? b.parameter.optional + : b.optional; + return ((a.type === utils_1.AST_NODE_TYPES.RestElement) === + (b.type === utils_1.AST_NODE_TYPES.RestElement) && optionalA === optionalB); + } + function typeParametersAreEqual(a, b) { + return (a.name.name === b.name.name && + constraintsAreEqual(a.constraint, b.constraint)); + } + function typesAreEqual(a, b) { + return (a === b || + (a != null && + b != null && + context.sourceCode.getText(a.typeAnnotation) === + context.sourceCode.getText(b.typeAnnotation))); + } + function constraintsAreEqual(a, b) { + return a === b || (a != null && a.type === b?.type); + } + /* Returns the first index where `a` and `b` differ. */ + function getIndexOfFirstDifference(a, b, equal) { + for (let i = 0; i < a.length && i < b.length; i++) { + if (!equal(a[i], b[i])) { + return i; + } + } + return undefined; + } + /** Calls `action` for every pair of values in `values`. */ + function forEachPair(values, action) { + for (let i = 0; i < values.length; i++) { + for (let j = i + 1; j < values.length; j++) { + action(values[i], values[j]); + } + } + } + const scopes = []; + let currentScope = { + overloads: new Map(), + }; + function createScope(parent, typeParameters) { + if (currentScope) { + scopes.push(currentScope); + } + currentScope = { + overloads: new Map(), + parent, + typeParameters, + }; + } + function checkScope() { + const scope = (0, util_1.nullThrows)(currentScope, 'checkScope() called without a current scope'); + const failures = checkOverloads([...scope.overloads.values()], scope.typeParameters); + addFailures(failures); + currentScope = scopes.pop(); + } + /** + * @returns the first valid JSDoc comment annotating `node` + */ + function getBlockCommentForNode(node) { + return context.sourceCode + .getCommentsBefore(node) + .reverse() + .find(comment => comment.type === utils_1.AST_TOKEN_TYPES.Block); + } + function addOverload(signature, key, containingNode) { + key ??= getOverloadKey(signature); + if ((containingNode ?? signature).parent === currentScope?.parent) { + const overloads = currentScope.overloads.get(key); + if (overloads != null) { + overloads.push(signature); + } + else { + currentScope.overloads.set(key, [signature]); + } + } + } + //---------------------------------------------------------------------- + // Public + //---------------------------------------------------------------------- + return { + ClassDeclaration(node) { + createScope(node.body, node.typeParameters); + }, + Program: createScope, + TSInterfaceDeclaration(node) { + createScope(node.body, node.typeParameters); + }, + TSModuleBlock: createScope, + TSTypeLiteral: createScope, + // collect overloads + MethodDefinition(node) { + if (!node.value.body && !isGetterOrSetter(node)) { + addOverload(node); + } + }, + TSAbstractMethodDefinition(node) { + if (!node.value.body && !isGetterOrSetter(node)) { + addOverload(node); + } + }, + TSCallSignatureDeclaration: addOverload, + TSConstructSignatureDeclaration: addOverload, + TSDeclareFunction(node) { + const exportingNode = getExportingNode(node); + addOverload(node, node.id?.name ?? exportingNode?.type, exportingNode); + }, + TSMethodSignature(node) { + if (!isGetterOrSetter(node)) { + addOverload(node); + } + }, + // validate scopes + 'ClassDeclaration:exit': checkScope, + 'Program:exit': checkScope, + 'TSInterfaceDeclaration:exit': checkScope, + 'TSModuleBlock:exit': checkScope, + 'TSTypeLiteral:exit': checkScope, + }; + }, +}); +function getCommentTargetNode(node) { + if (node.type === utils_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression) { + return node.parent; + } + return getExportingNode(node) ?? node; +} +function getExportingNode(node) { + return node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration || + node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration + ? node.parent + : undefined; +} +function getOverloadKey(node) { + const info = getOverloadInfo(node); + return ((node.computed ? '0' : '1') + + (node.static ? '0' : '1') + + info); +} +function getOverloadInfo(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration: + return 'constructor'; + case utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration: + return '()'; + default: { + const { key } = node; + if (isPrivateIdentifier(key)) { + return `private_identifier_${key.name}`; + } + if (isIdentifier(key)) { + return `identifier_${key.name}`; + } + return key.raw; + } + } +} +function getStaticParameterName(param) { + switch (param.type) { + case utils_1.AST_NODE_TYPES.Identifier: + return param.name; + case utils_1.AST_NODE_TYPES.RestElement: + return getStaticParameterName(param.argument); + default: + return undefined; + } +} +function isIdentifier(node) { + return node.type === utils_1.AST_NODE_TYPES.Identifier; +} +function isPrivateIdentifier(node) { + return node.type === utils_1.AST_NODE_TYPES.PrivateIdentifier; +} +function isGetterOrSetter(node) { + return node.kind === 'get' || node.kind === 'set'; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a955cd52e120e3492a2316006a79cdb82c5a538 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.d.ts @@ -0,0 +1,6 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export type MessageIds = 'addUnknownRestTypeAnnotationSuggestion' | 'addUnknownTypeAnnotationSuggestion' | 'useUnknown' | 'useUnknownArrayDestructuringPattern' | 'useUnknownObjectDestructuringPattern' | 'wrongRestTypeAnnotationSuggestion' | 'wrongTypeAnnotationSuggestion'; +declare const _default: TSESLint.RuleModule & { + name: string; +}; +export default _default; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.js new file mode 100644 index 0000000000000000000000000000000000000000..2f60e8fd9ba922fb136d3b8b8999262227fd1f14 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/rules/use-unknown-in-catch-callback-variable.js @@ -0,0 +1,261 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const util_1 = require("../util"); +const useUnknownMessageBase = 'Prefer the safe `: unknown` for a `{{method}}`{{append}} callback variable.'; +exports.default = (0, util_1.createRule)({ + name: 'use-unknown-in-catch-callback-variable', + meta: { + type: 'suggestion', + docs: { + description: 'Enforce typing arguments in Promise rejection callbacks as `unknown`', + recommended: 'strict', + requiresTypeChecking: true, + }, + hasSuggestions: true, + messages: { + addUnknownRestTypeAnnotationSuggestion: 'Add an explicit `: [unknown]` type annotation to the rejection callback rest variable.', + addUnknownTypeAnnotationSuggestion: 'Add an explicit `: unknown` type annotation to the rejection callback variable.', + useUnknown: useUnknownMessageBase, + useUnknownArrayDestructuringPattern: `${useUnknownMessageBase} The thrown error may not be iterable.`, + useUnknownObjectDestructuringPattern: `${useUnknownMessageBase} The thrown error may be nullable, or may not have the expected shape.`, + wrongRestTypeAnnotationSuggestion: 'Change existing type annotation to `: [unknown]`.', + wrongTypeAnnotationSuggestion: 'Change existing type annotation to `: unknown`.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const { esTreeNodeToTSNodeMap, program } = (0, util_1.getParserServices)(context); + const checker = program.getTypeChecker(); + function isFlaggableHandlerType(type) { + for (const unionPart of tsutils.unionConstituents(type)) { + const callSignatures = tsutils.getCallSignaturesOfType(unionPart); + if (callSignatures.length === 0) { + // Ignore any non-function components to the type. Those are not this rule's problem. + continue; + } + for (const callSignature of callSignatures) { + const firstParam = callSignature.parameters.at(0); + if (!firstParam) { + // it's not an issue if there's no catch variable at all. + continue; + } + let firstParamType = checker.getTypeOfSymbol(firstParam); + const decl = firstParam.valueDeclaration; + if (decl != null && (0, util_1.isRestParameterDeclaration)(decl)) { + if (checker.isArrayType(firstParamType)) { + firstParamType = checker.getTypeArguments(firstParamType)[0]; + } + else if (checker.isTupleType(firstParamType)) { + firstParamType = checker.getTypeArguments(firstParamType)[0]; + } + else { + // a rest arg that's not an array or tuple should definitely be flagged. + return true; + } + } + if (!tsutils.isIntrinsicUnknownType(firstParamType)) { + return true; + } + } + } + return false; + } + function collectFlaggedNodes(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.LogicalExpression: + return [ + ...collectFlaggedNodes(node.left), + ...collectFlaggedNodes(node.right), + ]; + case utils_1.AST_NODE_TYPES.SequenceExpression: + return collectFlaggedNodes((0, util_1.nullThrows)(node.expressions.at(-1), 'sequence expression must have multiple expressions')); + case utils_1.AST_NODE_TYPES.ConditionalExpression: + return [ + ...collectFlaggedNodes(node.consequent), + ...collectFlaggedNodes(node.alternate), + ]; + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: + { + const argument = esTreeNodeToTSNodeMap.get(node); + const typeOfArgument = checker.getTypeAtLocation(argument); + if (isFlaggableHandlerType(typeOfArgument)) { + return [node]; + } + } + break; + default: + break; + } + return []; + } + /** + * Analyzes the syntax of the catch argument and makes a best effort to pinpoint + * why it's reporting, and to come up with a suggested fix if possible. + * + * This function is explicitly operating under the assumption that the + * rule _is reporting_, so it is not guaranteed to be sound to call otherwise. + */ + function refineReportIfPossible(argument) { + const catchVariableOuterWithIncorrectTypes = (0, util_1.nullThrows)(argument.params.at(0), 'There should have been at least one parameter for the rule to have flagged.'); + // Function expressions can't have parameter properties; those only exist in constructors. + const catchVariableOuter = catchVariableOuterWithIncorrectTypes; + const catchVariableInner = catchVariableOuter.type === utils_1.AST_NODE_TYPES.AssignmentPattern + ? catchVariableOuter.left + : catchVariableOuter; + switch (catchVariableInner.type) { + case utils_1.AST_NODE_TYPES.Identifier: { + const catchVariableTypeAnnotation = catchVariableInner.typeAnnotation; + if (catchVariableTypeAnnotation == null) { + return { + node: catchVariableOuter, + suggest: [ + { + messageId: 'addUnknownTypeAnnotationSuggestion', + fix: (fixer) => { + if (argument.type === + utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + (0, util_1.isParenlessArrowFunction)(argument, context.sourceCode)) { + return [ + fixer.insertTextBefore(catchVariableInner, '('), + fixer.insertTextAfter(catchVariableInner, ': unknown)'), + ]; + } + return [ + fixer.insertTextAfter(catchVariableInner, ': unknown'), + ]; + }, + }, + ], + }; + } + return { + node: catchVariableOuter, + suggest: [ + { + messageId: 'wrongTypeAnnotationSuggestion', + fix: (fixer) => fixer.replaceText(catchVariableTypeAnnotation, ': unknown'), + }, + ], + }; + } + case utils_1.AST_NODE_TYPES.ArrayPattern: { + return { + node: catchVariableOuter, + messageId: 'useUnknownArrayDestructuringPattern', + }; + } + case utils_1.AST_NODE_TYPES.ObjectPattern: { + return { + node: catchVariableOuter, + messageId: 'useUnknownObjectDestructuringPattern', + }; + } + case utils_1.AST_NODE_TYPES.RestElement: { + const catchVariableTypeAnnotation = catchVariableInner.typeAnnotation; + if (catchVariableTypeAnnotation == null) { + return { + node: catchVariableOuter, + suggest: [ + { + messageId: 'addUnknownRestTypeAnnotationSuggestion', + fix: (fixer) => fixer.insertTextAfter(catchVariableInner, ': [unknown]'), + }, + ], + }; + } + return { + node: catchVariableOuter, + suggest: [ + { + messageId: 'wrongRestTypeAnnotationSuggestion', + fix: (fixer) => fixer.replaceText(catchVariableTypeAnnotation, ': [unknown]'), + }, + ], + }; + } + } + } + return { + CallExpression({ arguments: args, callee }) { + if (callee.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return; + } + const staticMemberAccessKey = (0, util_1.getStaticMemberAccessValue)(callee, context); + if (!staticMemberAccessKey) { + return; + } + const promiseMethodInfo = [ + { append: '', argIndexToCheck: 0, method: 'catch' }, + { append: ' rejection', argIndexToCheck: 1, method: 'then' }, + ].find(({ method }) => staticMemberAccessKey === method); + if (!promiseMethodInfo) { + return; + } + // Need to be enough args to check + const { argIndexToCheck, ...data } = promiseMethodInfo; + if (args.length < argIndexToCheck + 1) { + return; + } + // Argument to check, and all arguments before it, must be "ordinary" arguments (i.e. no spread arguments) + // promise.catch(f), promise.catch(() => {}), promise.catch(, <>) + const argsToCheck = args.slice(0, argIndexToCheck + 1); + if (argsToCheck.some(({ type }) => type === utils_1.AST_NODE_TYPES.SpreadElement)) { + return; + } + if (!tsutils.isThenableType(checker, esTreeNodeToTSNodeMap.get(callee), checker.getTypeAtLocation(esTreeNodeToTSNodeMap.get(callee.object)))) { + return; + } + // the `some` check above has already excluded `SpreadElement`, so we are safe to assert the same + const argToCheck = argsToCheck[argIndexToCheck]; + for (const node of collectFlaggedNodes(argToCheck)) { + // We are now guaranteed to report, but we have a bit of work to do + // to determine exactly where, and whether we can fix it. + const overrides = refineReportIfPossible(node); + context.report({ + node, + messageId: 'useUnknown', + data, + ...overrides, + }); + } + }, + }; + }, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..20122ffd15d0f2b468ee2fdb3d50bdebc4835bdb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.d.ts @@ -0,0 +1,16 @@ +import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils'; +import * as ts from 'typescript'; +/** + * Inspect a call expression to see if it's a call to an assertion function. + * If it is, return the node of the argument that is asserted. + */ +export declare function findTruthinessAssertedArgument(services: ParserServicesWithTypeInformation, node: TSESTree.CallExpression): TSESTree.Expression | undefined; +/** + * Inspect a call expression to see if it's a call to an assertion function. + * If it is, return the node of the argument that is asserted and other useful info. + */ +export declare function findTypeGuardAssertedArgument(services: ParserServicesWithTypeInformation, node: TSESTree.CallExpression): { + argument: TSESTree.Expression; + asserts: boolean; + type: ts.Type; +} | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..fca21d030f42c6094b31e7196e32436b717f80d0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/assertionFunctionUtils.js @@ -0,0 +1,116 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.findTruthinessAssertedArgument = findTruthinessAssertedArgument; +exports.findTypeGuardAssertedArgument = findTypeGuardAssertedArgument; +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +/** + * Inspect a call expression to see if it's a call to an assertion function. + * If it is, return the node of the argument that is asserted. + */ +function findTruthinessAssertedArgument(services, node) { + // If the call looks like `assert(expr1, expr2, ...c, d, e, f)`, then we can + // only care if `expr1` or `expr2` is asserted, since anything that happens + // within or after a spread argument is out of scope to reason about. + const checkableArguments = []; + for (const argument of node.arguments) { + if (argument.type === utils_1.AST_NODE_TYPES.SpreadElement) { + break; + } + checkableArguments.push(argument); + } + // nothing to do + if (checkableArguments.length === 0) { + return undefined; + } + const checker = services.program.getTypeChecker(); + const signature = services.getResolvedSignature(node); + if (signature == null) { + return undefined; + } + const firstTypePredicateResult = checker.getTypePredicateOfSignature(signature); + if (firstTypePredicateResult == null) { + return undefined; + } + const { kind, parameterIndex, type } = firstTypePredicateResult; + if (!(kind === ts.TypePredicateKind.AssertsIdentifier && type == null)) { + return undefined; + } + return checkableArguments.at(parameterIndex); +} +/** + * Inspect a call expression to see if it's a call to an assertion function. + * If it is, return the node of the argument that is asserted and other useful info. + */ +function findTypeGuardAssertedArgument(services, node) { + // If the call looks like `assert(expr1, expr2, ...c, d, e, f)`, then we can + // only care if `expr1` or `expr2` is asserted, since anything that happens + // within or after a spread argument is out of scope to reason about. + const checkableArguments = []; + for (const argument of node.arguments) { + if (argument.type === utils_1.AST_NODE_TYPES.SpreadElement) { + break; + } + checkableArguments.push(argument); + } + // nothing to do + if (checkableArguments.length === 0) { + return undefined; + } + const checker = services.program.getTypeChecker(); + const callSignature = services.getResolvedSignature(node); + if (callSignature == null) { + return undefined; + } + const typePredicateInfo = checker.getTypePredicateOfSignature(callSignature); + if (typePredicateInfo == null) { + return undefined; + } + const { kind, parameterIndex, type } = typePredicateInfo; + if (!((kind === ts.TypePredicateKind.AssertsIdentifier || + kind === ts.TypePredicateKind.Identifier) && + type != null)) { + return undefined; + } + if (parameterIndex >= checkableArguments.length) { + return undefined; + } + return { + argument: checkableArguments[parameterIndex], + asserts: kind === ts.TypePredicateKind.AssertsIdentifier, + type, + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1a31bb0363663a77272f42b9374cdfd0452bb365 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.d.ts @@ -0,0 +1,17 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import * as ts from 'typescript'; +export * from '@typescript-eslint/utils/ast-utils'; +/** + * Get the `loc` object of a given name in a `/*globals` comment directive. + * @param sourceCode The source code to convert index to loc. + * @param comment The `/*globals` comment directive which include the name. + * @param name The name to find. + * @returns The `loc` object. + */ +export declare function getNameLocationInGlobalDirectiveComment(sourceCode: TSESLint.SourceCode, comment: TSESTree.Comment, name: string): TSESTree.SourceLocation; +export declare function forEachReturnStatement(body: ts.Block, visitor: (stmt: ts.ReturnStatement) => T): T | undefined; +/** + * Rough equivalent to ts.forEachChild for ESTree nodes. + * It returns the first truthy value returned by the callback, if any. + */ +export declare function forEachChildESTree(node: TSESTree.Node, callback: (child: TSESTree.Node) => false | Result | null | undefined): Result | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..6104aef4982d3772c076a4a749cc12b8742845b0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/astUtils.js @@ -0,0 +1,143 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +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.getNameLocationInGlobalDirectiveComment = getNameLocationInGlobalDirectiveComment; +exports.forEachReturnStatement = forEachReturnStatement; +exports.forEachChildESTree = forEachChildESTree; +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +const ts = __importStar(require("typescript")); +const escapeRegExp_1 = require("./escapeRegExp"); +// deeply re-export, for convenience +__exportStar(require("@typescript-eslint/utils/ast-utils"), exports); +// The following is copied from `eslint`'s source code since it doesn't exist in eslint@5. +// https://github.com/eslint/eslint/blob/145aec1ab9052fbca96a44d04927c595951b1536/lib/rules/utils/ast-utils.js#L1751-L1779 +// Could be export { getNameLocationInGlobalDirectiveComment } from 'eslint/lib/rules/utils/ast-utils' +/** + * Get the `loc` object of a given name in a `/*globals` comment directive. + * @param sourceCode The source code to convert index to loc. + * @param comment The `/*globals` comment directive which include the name. + * @param name The name to find. + * @returns The `loc` object. + */ +function getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) { + const namePattern = new RegExp(`[\\s,]${(0, escapeRegExp_1.escapeRegExp)(name)}(?:$|[\\s,:])`, 'gu'); + // To ignore the first text "global". + namePattern.lastIndex = comment.value.indexOf('global') + 6; + // Search a given variable name. + const match = namePattern.exec(comment.value); + // Convert the index to loc. + const start = sourceCode.getLocFromIndex(comment.range[0] + '/*'.length + (match ? match.index + 1 : 0)); + const end = { + column: start.column + (match ? name.length : 1), + line: start.line, + }; + return { end, start }; +} +// Copied from typescript https://github.com/microsoft/TypeScript/blob/42b0e3c4630c129ca39ce0df9fff5f0d1b4dd348/src/compiler/utilities.ts#L1335 +// Warning: This has the same semantics as the forEach family of functions, +// in that traversal terminates in the event that 'visitor' supplies a truthy value. +function forEachReturnStatement(body, visitor) { + return traverse(body); + function traverse(node) { + switch (node.kind) { + case ts.SyntaxKind.ReturnStatement: + return visitor(node); + case ts.SyntaxKind.CaseBlock: + case ts.SyntaxKind.Block: + case ts.SyntaxKind.IfStatement: + case ts.SyntaxKind.DoStatement: + case ts.SyntaxKind.WhileStatement: + case ts.SyntaxKind.ForStatement: + case ts.SyntaxKind.ForInStatement: + case ts.SyntaxKind.ForOfStatement: + case ts.SyntaxKind.WithStatement: + case ts.SyntaxKind.SwitchStatement: + case ts.SyntaxKind.CaseClause: + case ts.SyntaxKind.DefaultClause: + case ts.SyntaxKind.LabeledStatement: + case ts.SyntaxKind.TryStatement: + case ts.SyntaxKind.CatchClause: + return ts.forEachChild(node, traverse); + } + return undefined; + } +} +function isESTreeNodeLike(node) { + return (typeof node === 'object' && + node != null && + 'type' in node && + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access + typeof node.type === 'string'); +} +/** + * Rough equivalent to ts.forEachChild for ESTree nodes. + * It returns the first truthy value returned by the callback, if any. + */ +function forEachChildESTree(node, callback) { + function visit(currentNode) { + const result = callback(currentNode); + if (result) { + return result; + } + const currentKeys = visitor_keys_1.visitorKeys[currentNode.type]; + if (!currentKeys) { + return undefined; + } + for (const key of currentKeys) { + const currentProperty = currentNode[key]; + if (Array.isArray(currentProperty)) { + for (const child of currentProperty) { + if (isESTreeNodeLike(child)) { + const result = visit(child); + if (result) { + return result; + } + } + } + } + else if (isESTreeNodeLike(currentProperty)) { + const result = visit(currentProperty); + if (result) { + return result; + } + } + } + return undefined; + } + return visit(node); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/baseTypeUtils.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/baseTypeUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b027aef997cc9ee95f352016c803db5c5ec55a36 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/baseTypeUtils.d.ts @@ -0,0 +1,13 @@ +import type { ParserServicesWithTypeInformation } from '@typescript-eslint/utils'; +import type { InterfaceType, Type } from 'typescript'; +export declare function hasBaseTypes(type: Type): type is InterfaceType; +/** + * Recursively checks if a type or any of its base types matches the provided + * matcher function. + * @param services Parser services with type information + * @param matcher Function to test if a type matches the desired criteria + * @param type The type to check + * @param seen Set of already visited types to prevent infinite recursion + * @returns `true` if the type or any of its base types match the matcher + */ +export declare function matchesTypeOrBaseType(services: ParserServicesWithTypeInformation, matcher: (type: Type) => boolean, type: Type, seen?: Set): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/baseTypeUtils.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/baseTypeUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..448eeb98a376c069bb12fe7c345512cce8c56ff0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/baseTypeUtils.js @@ -0,0 +1,75 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasBaseTypes = hasBaseTypes; +exports.matchesTypeOrBaseType = matchesTypeOrBaseType; +const ts_api_utils_1 = require("ts-api-utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +function getBaseTypesForType(checker, type) { + if (!tsutils.isObjectType(type)) { + return []; + } + const interfaceTarget = tsutils.isTypeReference(type) ? type.target : type; + const interfaceType = tsutils.isObjectFlagSet(interfaceTarget, ts.ObjectFlags.Interface | ts.ObjectFlags.Class) && interfaceTarget; + if (!interfaceType) { + return []; + } + return checker.getBaseTypes(interfaceType); +} +function hasBaseTypes(type) { + return ((0, ts_api_utils_1.isObjectType)(type) && + (0, ts_api_utils_1.isObjectFlagSet)(type, ts.ObjectFlags.Interface | ts.ObjectFlags.Class)); +} +/** + * Recursively checks if a type or any of its base types matches the provided + * matcher function. + * @param services Parser services with type information + * @param matcher Function to test if a type matches the desired criteria + * @param type The type to check + * @param seen Set of already visited types to prevent infinite recursion + * @returns `true` if the type or any of its base types match the matcher + */ +function matchesTypeOrBaseType(services, matcher, type, seen = new Set()) { + if (seen.has(type)) { + return false; + } + seen.add(type); + if (matcher(type)) { + return true; + } + const checker = services.program.getTypeChecker(); + return getBaseTypesForType(checker, type).some(base => matchesTypeOrBaseType(services, matcher, base, seen)); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/classScopeAnalyzer.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/classScopeAnalyzer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e0f7115b0b0b39684fa4f4b1a5acd89d80c2a2fe --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/classScopeAnalyzer.d.ts @@ -0,0 +1,52 @@ +import type { ScopeManager } from '@typescript-eslint/scope-manager'; +import type { TSESTree } from '@typescript-eslint/utils'; +import type { ClassNode, Key, MemberNode } from './types'; +export declare class Member { + /** + * The node that declares this member + */ + readonly node: MemberNode; + /** + * The resolved, unique key for this member. + */ + readonly key: Key; + /** + * The member name, as given in the source code. + */ + readonly name: string; + /** + * The node that represents the member name in the source code. + * Used for reporting errors. + */ + readonly nameNode: TSESTree.Node; + /** + * The number of writes to this member. + */ + writeCount: number; + /** + * The number of reads from this member. + */ + readCount: number; + private constructor(); + static create(node: MemberNode): Member | null; + isAccessor(): boolean; + isHashPrivate(): boolean; + isPrivate(): boolean; + isStatic(): boolean; + isUsed(): boolean; +} +export interface ClassScopeResult { + /** + * The classes name as given in the source code. + * If this is `null` then the class is an anonymous class. + */ + readonly className: string | null; + /** + * The class's members, keyed by their name + */ + readonly members: { + readonly instance: Map; + readonly static: Map; + }; +} +export declare function analyzeClassMemberUsage(program: TSESTree.Program, scopeManager: ScopeManager): ReadonlyMap; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/classScopeAnalyzer.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/classScopeAnalyzer.js new file mode 100644 index 0000000000000000000000000000000000000000..2c5830cb20c2913fed08969e279d23468a85cf45 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/classScopeAnalyzer.js @@ -0,0 +1,566 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Member = void 0; +exports.analyzeClassMemberUsage = analyzeClassMemberUsage; +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const __1 = require(".."); +const extractComputedName_1 = require("./extractComputedName"); +const types_1 = require("./types"); +class Member { + /** + * The node that declares this member + */ + node; + /** + * The resolved, unique key for this member. + */ + key; + /** + * The member name, as given in the source code. + */ + name; + /** + * The node that represents the member name in the source code. + * Used for reporting errors. + */ + nameNode; + /** + * The number of writes to this member. + */ + writeCount = 0; + /** + * The number of reads from this member. + */ + readCount = 0; + constructor(node, key, name, nameNode) { + this.node = node; + this.key = key; + this.name = name; + this.nameNode = nameNode; + } + static create(node) { + const name = (0, extractComputedName_1.extractNameForMember)(node); + if (name == null) { + return null; + } + return new Member(node, name.key, name.codeName, name.nameNode); + } + isAccessor() { + if (this.node.type === utils_1.AST_NODE_TYPES.MethodDefinition || + this.node.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition) { + return this.node.kind === 'set' || this.node.kind === 'get'; + } + return (this.node.type === utils_1.AST_NODE_TYPES.AccessorProperty || + this.node.type === utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty); + } + isHashPrivate() { + return ('key' in this.node && + this.node.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier); + } + isPrivate() { + return this.node.accessibility === 'private'; + } + isStatic() { + return this.node.static; + } + isUsed() { + return (this.readCount > 0 || + // any usage of an accessor is considered a usage as accessor can have side effects + (this.writeCount > 0 && this.isAccessor())); + } +} +exports.Member = Member; +function isWriteOnlyUsage(node, parent) { + if (parent.type !== utils_1.AST_NODE_TYPES.AssignmentExpression && + parent.type !== utils_1.AST_NODE_TYPES.ForInStatement && + parent.type !== utils_1.AST_NODE_TYPES.ForOfStatement && + parent.type !== utils_1.AST_NODE_TYPES.AssignmentPattern) { + return false; + } + // If it's on the right then it's a read not a write + if (parent.left !== node) { + return false; + } + if (parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression && + // For any other operator (such as '+=') we still consider it a read operation + parent.operator !== '=') { + // if the read operation is "discarded" in an empty statement, then it is write only. + return parent.parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement; + } + return true; +} +function countReference(identifierParent, member) { + const identifierGrandparent = (0, __1.nullThrows)(identifierParent.parent, __1.NullThrowsReasons.MissingParent); + if (isWriteOnlyUsage(identifierParent, identifierGrandparent)) { + member.writeCount += 1; + return; + } + const identifierGreatGrandparent = identifierGrandparent.parent; + // A statement which only increments (`this.#x++;`) + if (identifierGrandparent.type === utils_1.AST_NODE_TYPES.UpdateExpression && + identifierGreatGrandparent?.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + member.writeCount += 1; + return; + } + /* + * ({ x: this.#usedInDestructuring } = bar); + * + * But should treat the following as a read: + * ({ [this.#x]: a } = foo); + */ + if (identifierGrandparent.type === utils_1.AST_NODE_TYPES.Property && + identifierGreatGrandparent?.type === utils_1.AST_NODE_TYPES.ObjectPattern && + identifierGrandparent.value === identifierParent) { + member.writeCount += 1; + return; + } + // [...this.#unusedInRestPattern] = bar; + if (identifierGrandparent.type === utils_1.AST_NODE_TYPES.RestElement) { + member.writeCount += 1; + return; + } + // [this.#unusedInAssignmentPattern] = bar; + if (identifierGrandparent.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + member.writeCount += 1; + return; + } + member.readCount += 1; +} +class ThisScope extends scope_manager_1.Visitor { + /** + * True if the context is considered a static context and so `this` refers to + * the class and not an instance (eg a static method or a static block). + */ + isStaticThisContext; + /** + * The classes directly declared within this class -- for example a class declared within a method. + * This does not include grandchild classes. + */ + childScopes = []; + /** + * The scope manager instance used to resolve variables to improve discovery of usages. + */ + scopeManager; + /** + * The parent class scope if one exists. + */ + upper; + /** + * The context of the `this` reference in the current scope. + */ + thisContext; + constructor(scopeManager, upper, thisContext, isStaticThisContext) { + super({}); + this.scopeManager = scopeManager; + this.upper = upper; + this.isStaticThisContext = isStaticThisContext; + if (thisContext === 'self') { + if (!(this instanceof ClassScope)) { + throw new Error('Cannot use `self` unless it is in a ClassScope'); + } + this.thisContext = this; + } + else if (thisContext === 'none') { + this.thisContext = null; + } + else { + this.thisContext = thisContext; + } + } + findNearestScope(node) { + let currentScope; + let currentNode = node; + do { + currentScope = this.scopeManager.acquire(currentNode); + if (currentNode.parent == null) { + break; + } + currentNode = currentNode.parent; + } while (currentScope == null); + return currentScope; + } + findVariableInScope(node, name) { + let currentScope = this.findNearestScope(node); + let variable = null; + while (currentScope != null) { + variable = currentScope.set.get(name) ?? null; + if (variable != null) { + break; + } + currentScope = currentScope.upper; + } + return variable; + } + getObjectClass(node) { + switch (node.object.type) { + case utils_1.AST_NODE_TYPES.ThisExpression: { + if (this.thisContext == null) { + return null; + } + return { + thisContext: this.thisContext, + type: this.isStaticThisContext ? 'static' : 'instance', + }; + } + case utils_1.AST_NODE_TYPES.Identifier: { + const thisContext = this.findClassScopeWithName(node.object.name); + if (thisContext != null) { + return { thisContext, type: 'static' }; + } + // the following code does some very rudimentary scope analysis to handle some trivial cases + const variable = this.findVariableInScope(node, node.object.name); + if (variable == null || variable.defs.length === 0) { + return null; + } + const firstDef = variable.defs[0]; + switch (firstDef.node.type) { + // detect simple reassignment of `this` + // ``` + // class Foo { + // private prop: number; + // method(thing: Foo) { + // const self = this; + // return self.prop; + // } + // } + // ``` + case utils_1.AST_NODE_TYPES.VariableDeclarator: { + const value = firstDef.node.init; + if (value?.type !== utils_1.AST_NODE_TYPES.ThisExpression) { + return null; + } + if (variable.references.some(ref => ref.isWrite() && ref.init !== true)) { + // variable is assigned to multiple times so we can't be sure that it's still the same class + return null; + } + // we have a case like `const self = this` or `let self = this` that is not reassigned + // so we can safely assume that it's still the same class! + return { + thisContext: this.thisContext, + type: this.isStaticThisContext ? 'static' : 'instance', + }; + } + // Look for variables typed as the current class: + // ``` + // class Foo { + // private prop: number; + // method(thing: Foo) { + // // this references the private instance member but not via `this` so we can't see it + // thing.prop = 1; + // } + // } + // ``` + default: { + const typeAnnotation = (() => { + if ('typeAnnotation' in firstDef.name && + firstDef.name.typeAnnotation != null) { + return firstDef.name.typeAnnotation.typeAnnotation; + } + return null; + })(); + if (typeAnnotation == null) { + return null; + } + // Cases like `method(thing: Foo) { ... }` + if (typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference && + typeAnnotation.typeName.type === utils_1.AST_NODE_TYPES.Identifier) { + const typeName = typeAnnotation.typeName.name; + const typeScope = this.findClassScopeWithName(typeName); + if (typeScope != null) { + return { thisContext: typeScope, type: 'instance' }; + } + } + // Cases like `method(thing: typeof Foo) { ... }` + if (typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeQuery && + typeAnnotation.exprName.type === utils_1.AST_NODE_TYPES.Identifier) { + const exprName = typeAnnotation.exprName.name; + const exprScope = this.findClassScopeWithName(exprName); + if (exprScope != null) { + return { thisContext: exprScope, type: 'static' }; + } + } + } + } + return null; + } + case utils_1.AST_NODE_TYPES.MemberExpression: + // TODO - we could probably recurse here to do some more complex analysis and support like `foo.bar.baz` nested references + return null; + default: + return null; + } + } + visitClass(node) { + const classScope = new ClassScope(node, this, this.scopeManager); + this.childScopes.push(classScope); + classScope.visitChildren(node); + } + visitIntermediate(node) { + const intermediateScope = new IntermediateScope(this.scopeManager, this, node); + this.childScopes.push(intermediateScope); + intermediateScope.visitChildren(node); + } + /** + * Gets the nearest class scope with the given name. + */ + findClassScopeWithName(name) { + let currentScope = this; + while (currentScope != null) { + if (currentScope instanceof ClassScope && + currentScope.className === name) { + return currentScope; + } + currentScope = currentScope.upper; + } + return null; + } + ///////////////////// + // Visit selectors // + ///////////////////// + AssignmentExpression(node) { + this.visitChildren(node); + if (node.right.type === utils_1.AST_NODE_TYPES.ThisExpression && + node.left.type === utils_1.AST_NODE_TYPES.ObjectPattern) { + this.handleThisDestructuring(node.left); + } + } + AssignmentPattern(node) { + this.visitChildren(node); + if (node.right.type === utils_1.AST_NODE_TYPES.ThisExpression && + node.left.type === utils_1.AST_NODE_TYPES.ObjectPattern) { + this.handleThisDestructuring(node.left); + } + } + ClassDeclaration(node) { + this.visitClass(node); + } + ClassExpression(node) { + this.visitClass(node); + } + FunctionDeclaration(node) { + this.visitIntermediate(node); + } + FunctionExpression(node) { + this.visitIntermediate(node); + } + MemberExpression(node) { + this.visitChildren(node); + if (node.property.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + // will be handled by the PrivateIdentifier visitor + return; + } + const propertyName = (0, extractComputedName_1.extractNameForMemberExpression)(node); + if (propertyName == null) { + return; + } + const objectClassName = this.getObjectClass(node); + if (objectClassName == null) { + return; + } + if (objectClassName.thisContext == null) { + return; + } + const members = objectClassName.type === 'instance' + ? objectClassName.thisContext.members.instance + : objectClassName.thisContext.members.static; + const member = members.get(propertyName.key); + if (member == null) { + return; + } + countReference(node, member); + } + PrivateIdentifier(node) { + this.visitChildren(node); + if ((node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition || + node.parent.type === utils_1.AST_NODE_TYPES.PropertyDefinition) && + node.parent.key === node) { + // ignore the member definition + return; + } + // We can actually be pretty loose with our code here thanks to how private + // members are designed. + // + // 1) classes CANNOT have a static and instance private member with the + // same name, so we don't need to match up static access. + // 2) nested classes CANNOT access a private member of their parent class if + // the member has the same name as a private member of the nested class. + // + // together this means that we can just look for the member upwards until we + // find a match and we know that will be the correct match! + let currentScope = this; + const key = (0, types_1.privateKey)(node); + while (currentScope != null) { + if (currentScope.thisContext != null) { + const member = currentScope.thisContext.members.instance.get(key) ?? + currentScope.thisContext.members.static.get(key); + if (member != null) { + countReference(node.parent, member); + return; + } + } + currentScope = currentScope.upper; + } + } + StaticBlock(node) { + this.visitIntermediate(node); + } + VariableDeclarator(node) { + this.visitChildren(node); + if (node.init?.type === utils_1.AST_NODE_TYPES.ThisExpression && + node.id.type === utils_1.AST_NODE_TYPES.ObjectPattern) { + this.handleThisDestructuring(node.id); + } + } + /** + * Handles destructuring from `this` in ObjectPattern. + * Example: const { property } = this; + */ + handleThisDestructuring(pattern) { + if (this.thisContext == null) { + return; + } + for (const prop of pattern.properties) { + if (prop.type !== utils_1.AST_NODE_TYPES.Property) { + continue; + } + if (prop.key.type !== utils_1.AST_NODE_TYPES.Identifier || prop.computed) { + continue; + } + const memberKey = (0, types_1.publicKey)(prop.key.name); + const members = this.isStaticThisContext + ? this.thisContext.members.static + : this.thisContext.members.instance; + const member = members.get(memberKey); + if (member == null) { + continue; + } + countReference(prop.key, member); + } + } +} +/** + * Any other scope that is not a class scope + * + * When we visit a function declaration/expression the `this` reference is + * rebound so it no longer refers to the class. + * + * This also supports a function's `this` parameter. + */ +class IntermediateScope extends ThisScope { + constructor(scopeManager, upper, node) { + if (node.type === utils_1.AST_NODE_TYPES.Program) { + super(scopeManager, upper, 'none', false); + return; + } + if (node.type === utils_1.AST_NODE_TYPES.StaticBlock) { + if (upper == null || !(upper instanceof ClassScope)) { + throw new Error('Cannot have a static block without an upper ClassScope'); + } + super(scopeManager, upper, upper, true); + return; + } + // method definition + if ((node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition || + node.parent.type === utils_1.AST_NODE_TYPES.PropertyDefinition) && + node.parent.value === node) { + if (upper == null || !(upper instanceof ClassScope)) { + throw new Error('Cannot have a class method/property without an upper ClassScope'); + } + super(scopeManager, upper, upper, node.parent.static); + return; + } + // function with a `this` parameter + if (upper != null && + node.params.length > 0 && + node.params[0].type === utils_1.AST_NODE_TYPES.Identifier && + node.params[0].name === 'this') { + const thisType = node.params[0].typeAnnotation?.typeAnnotation; + if (thisType?.type === utils_1.AST_NODE_TYPES.TSTypeReference && + thisType.typeName.type === utils_1.AST_NODE_TYPES.Identifier) { + const thisContext = upper.findClassScopeWithName(thisType.typeName.name); + if (thisContext != null) { + super(scopeManager, upper, thisContext, false); + return; + } + } + } + super(scopeManager, upper, 'none', false); + } +} +class ClassScope extends ThisScope { + className; + /** + * The class's members, keyed by their name + */ + members = { + instance: new Map(), + static: new Map(), + }; + /** + * The node that declares this class. + */ + theClass; + constructor(theClass, upper, scopeManager) { + super(scopeManager, upper, 'self', false); + this.theClass = theClass; + this.className = theClass.id?.name ?? null; + for (const memberNode of theClass.body.body) { + switch (memberNode.type) { + case utils_1.AST_NODE_TYPES.MethodDefinition: + if (memberNode.kind === 'constructor') { + for (const parameter of memberNode.value.params) { + if (parameter.type !== utils_1.AST_NODE_TYPES.TSParameterProperty) { + continue; + } + const member = Member.create(parameter); + if (member == null) { + continue; + } + this.members.instance.set(member.key, member); + } + // break instead of falling through because the constructor is not a "member" we track + break; + } + // intentional fallthrough + case utils_1.AST_NODE_TYPES.AccessorProperty: + case utils_1.AST_NODE_TYPES.PropertyDefinition: + case utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty: + case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition: + case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition: { + const member = Member.create(memberNode); + if (member == null) { + continue; + } + if (member.isStatic()) { + this.members.static.set(member.key, member); + } + else { + this.members.instance.set(member.key, member); + } + break; + } + case utils_1.AST_NODE_TYPES.StaticBlock: + // static blocks declare no members + continue; + case utils_1.AST_NODE_TYPES.TSIndexSignature: + // index signatures are type signatures only and are fully computed + continue; + } + } + } +} +function analyzeClassMemberUsage(program, scopeManager) { + const rootScope = new IntermediateScope(scopeManager, null, program); + rootScope.visit(program); + return traverseScopes(rootScope); +} +function traverseScopes(currentScope, analysisResults = new Map()) { + if (currentScope instanceof ClassScope) { + analysisResults.set(currentScope.theClass, currentScope); + } + for (const childScope of currentScope.childScopes) { + traverseScopes(childScope, analysisResults); + } + return analysisResults; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/extractComputedName.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/extractComputedName.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..94664cb02635e1c4b52f5d0648f8f8ce2312a874 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/extractComputedName.d.ts @@ -0,0 +1,17 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import type { Key, MemberNode } from './types'; +export interface ExtractedName { + key: Key; + codeName: string; + nameNode: TSESTree.Node; +} +/** + * Extracts the string name for a member. + * @returns `null` if the name cannot be extracted due to it being computed. + */ +export declare function extractNameForMember(node: MemberNode): ExtractedName | null; +/** + * Extracts the string property name for a member. + * @returns `null` if the name cannot be extracted due to it being a computed. + */ +export declare function extractNameForMemberExpression(node: TSESTree.MemberExpression): ExtractedName | null; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/extractComputedName.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/extractComputedName.js new file mode 100644 index 0000000000000000000000000000000000000000..1696d9ac16ae1ef95cf0c9780f5f039ca7c99856 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/extractComputedName.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.extractNameForMember = extractNameForMember; +exports.extractNameForMemberExpression = extractNameForMemberExpression; +const utils_1 = require("@typescript-eslint/utils"); +const types_1 = require("./types"); +function extractComputedName(computedName) { + if (computedName.type === utils_1.AST_NODE_TYPES.Literal) { + const name = computedName.value?.toString() ?? 'null'; + return { + codeName: name, + key: (0, types_1.publicKey)(name), + nameNode: computedName, + }; + } + if (computedName.type === utils_1.AST_NODE_TYPES.TemplateLiteral && + computedName.expressions.length === 0) { + const name = computedName.quasis[0].value.raw; + return { + codeName: name, + key: (0, types_1.publicKey)(name), + nameNode: computedName, + }; + } + return null; +} +function extractNonComputedName(nonComputedName) { + const name = nonComputedName.name; + if (nonComputedName.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + return { + codeName: `#${name}`, + key: (0, types_1.privateKey)(nonComputedName), + nameNode: nonComputedName, + }; + } + return { + codeName: name, + key: (0, types_1.publicKey)(name), + nameNode: nonComputedName, + }; +} +/** + * Extracts the string name for a member. + * @returns `null` if the name cannot be extracted due to it being computed. + */ +function extractNameForMember(node) { + if (node.type === utils_1.AST_NODE_TYPES.TSParameterProperty) { + const identifier = node.parameter.type === utils_1.AST_NODE_TYPES.Identifier + ? node.parameter + : node.parameter.left; + return extractNonComputedName(identifier); + } + if (node.computed) { + return extractComputedName(node.key); + } + if (node.key.type === utils_1.AST_NODE_TYPES.Literal) { + return extractComputedName(node.key); + } + return extractNonComputedName(node.key); +} +/** + * Extracts the string property name for a member. + * @returns `null` if the name cannot be extracted due to it being a computed. + */ +function extractNameForMemberExpression(node) { + if (node.computed) { + return extractComputedName(node.property); + } + return extractNonComputedName(node.property); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/types.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9abf782fad35628dcd2ca86e0e8e57f9e852927 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/types.d.ts @@ -0,0 +1,12 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +export type ClassNode = TSESTree.ClassDeclaration | TSESTree.ClassExpression; +export type MemberNode = TSESTree.AccessorProperty | TSESTree.MethodDefinition | TSESTree.PropertyDefinition | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractMethodDefinition | TSESTree.TSAbstractPropertyDefinition | TSESTree.TSParameterProperty; +export type PrivateKey = string & { + __brand: 'private-key'; +}; +export type PublicKey = string & { + __brand: 'public-key'; +}; +export type Key = PrivateKey | PublicKey; +export declare function publicKey(name: string): PublicKey; +export declare function privateKey(node: TSESTree.PrivateIdentifier): PrivateKey; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/types.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/types.js new file mode 100644 index 0000000000000000000000000000000000000000..26735c8b9f80f62900c90cdaafde3c6404b4a4d6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/class-scope-analyzer/types.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.publicKey = publicKey; +exports.privateKey = privateKey; +function publicKey(name) { + return name; +} +function privateKey(node) { + return `#private@@${node.name}`; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8a2942c9c99f9f9e712964db14ab9f8cdb9e1fa --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.d.ts @@ -0,0 +1,15 @@ +import type { ScopeVariable } from '@typescript-eslint/scope-manager'; +import { TSESLint } from '@typescript-eslint/utils'; +interface VariableAnalysis { + readonly unusedVariables: ReadonlySet; + readonly usedVariables: ReadonlySet; +} +/** + * Collects the set of unused variables for a given context. + * + * Due to complexity, this does not take into consideration: + * - variables within declaration files + * - variables within ambient module declarations + */ +export declare function collectVariables(context: Readonly>): VariableAnalysis; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js new file mode 100644 index 0000000000000000000000000000000000000000..2ab3524bd37027c6a89cd79338472dc2df14cf30 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js @@ -0,0 +1,601 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.collectVariables = collectVariables; +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +const isTypeImport_1 = require("./isTypeImport"); +const referenceContainsTypePredicate_1 = require("./referenceContainsTypePredicate"); +const referenceContainsTypeQuery_1 = require("./referenceContainsTypeQuery"); +/** + * This class leverages an AST visitor to mark variables as used via the + * `eslintUsed` property. + */ +class UnusedVarsVisitor extends scope_manager_1.Visitor { + /** + * We keep a weak cache so that multiple rules can share the calculation + */ + static RESULTS_CACHE = new WeakMap(); + ClassDeclaration = this.visitClass; + ClassExpression = this.visitClass; + ForInStatement = this.visitForInForOf; + ForOfStatement = this.visitForInForOf; + //#region HELPERS + FunctionDeclaration = this.visitFunction; + FunctionExpression = this.visitFunction; + MethodDefinition = this.visitSetter; + Property = this.visitSetter; + TSCallSignatureDeclaration = this.visitFunctionTypeSignature; + TSConstructorType = this.visitFunctionTypeSignature; + TSConstructSignatureDeclaration = this.visitFunctionTypeSignature; + TSDeclareFunction = this.visitFunctionTypeSignature; + TSEmptyBodyFunctionExpression = this.visitFunctionTypeSignature; + //#endregion HELPERS + //#region VISITORS + // NOTE - This is a simple visitor - meaning it does not support selectors + TSFunctionType = this.visitFunctionTypeSignature; + TSMethodSignature = this.visitFunctionTypeSignature; + #scopeManager; + constructor(scopeManager) { + super({ + visitChildrenEvenIfSelectorExists: true, + }); + this.#scopeManager = scopeManager; + } + static collectUnusedVariables(program, scopeManager) { + const cached = this.RESULTS_CACHE.get(program); + if (cached) { + return cached; + } + const visitor = new this(scopeManager); + visitor.visit(program); + const unusedVars = visitor.collectUnusedVariables(visitor.getScope(program)); + this.RESULTS_CACHE.set(program, unusedVars); + return unusedVars; + } + Identifier(node) { + const scope = this.getScope(node); + if (scope.type === utils_1.TSESLint.Scope.ScopeType.function && + node.name === 'this' && + // this parameters should always be considered used as they're pseudo-parameters + 'params' in scope.block && + scope.block.params.includes(node)) { + this.markVariableAsUsed(node); + } + } + TSEnumDeclaration(node) { + // enum members create variables because they can be referenced within the enum, + // but they obviously aren't unused variables for the purposes of this rule. + const scope = this.getScope(node); + for (const variable of scope.variables) { + this.markVariableAsUsed(variable); + } + } + TSMappedType(node) { + // mapped types create a variable for their type name, but it's not necessary to reference it, + // so we shouldn't consider it as unused for the purpose of this rule. + this.markVariableAsUsed(node.key); + } + TSModuleDeclaration(node) { + // -- global augmentation can be in any file, and they do not need exports + if (node.kind === 'global') { + this.markVariableAsUsed('global', node.parent); + } + } + TSParameterProperty(node) { + let identifier; + switch (node.parameter.type) { + case utils_1.AST_NODE_TYPES.AssignmentPattern: + identifier = node.parameter.left; + break; + case utils_1.AST_NODE_TYPES.Identifier: + identifier = node.parameter; + break; + } + this.markVariableAsUsed(identifier); + } + collectUnusedVariables(scope, variables = { + unusedVariables: new Set(), + usedVariables: new Set(), + }) { + if ( + // skip function expression names + // this scope is created just to house the variable that allows a function + // expression to self-reference if it has a name defined + !scope.functionExpressionScope) { + for (const variable of scope.variables) { + // cases that we don't want to treat as used or unused + if ( + // implicit lib variables (from @typescript-eslint/scope-manager) + // these aren't variables that should be checked ever + variable instanceof scope_manager_1.ImplicitLibVariable) { + continue; + } + if ( + // variables marked with markVariableAsUsed() + variable.eslintUsed || + // basic exported variables + isExported(variable) || + // variables implicitly exported via a merged declaration + isMergeableExported(variable) || + // used variables + isUsedVariable(variable)) { + variables.usedVariables.add(variable); + } + else { + variables.unusedVariables.add(variable); + } + } + } + for (const childScope of scope.childScopes) { + this.collectUnusedVariables(childScope, variables); + } + return variables; + } + getScope(currentNode) { + // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope. + const inner = currentNode.type !== utils_1.AST_NODE_TYPES.Program; + let node = currentNode; + while (node) { + const scope = this.#scopeManager.acquire(node, inner); + if (scope) { + if (scope.type === scope_manager_1.ScopeType.functionExpressionName) { + return scope.childScopes[0]; + } + return scope; + } + node = node.parent; + } + return this.#scopeManager.scopes[0]; + } + markVariableAsUsed(variableOrIdentifierOrName, parent) { + if (typeof variableOrIdentifierOrName !== 'string' && + !('type' in variableOrIdentifierOrName)) { + variableOrIdentifierOrName.eslintUsed = true; + return; + } + let name; + let node; + if (typeof variableOrIdentifierOrName === 'string') { + name = variableOrIdentifierOrName; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + node = parent; + } + else { + name = variableOrIdentifierOrName.name; + node = variableOrIdentifierOrName; + } + let currentScope = this.getScope(node); + while (currentScope) { + const variable = currentScope.variables.find(scopeVar => scopeVar.name === name); + if (variable) { + variable.eslintUsed = true; + return; + } + currentScope = currentScope.upper; + } + } + visitClass(node) { + // skip a variable of class itself name in the class scope + const scope = this.getScope(node); + for (const variable of scope.variables) { + if (variable.identifiers[0] === scope.block.id) { + this.markVariableAsUsed(variable); + return; + } + } + } + visitForInForOf(node) { + /** + * (Brad Zacher): I hate that this has to exist. + * But it is required for compat with the base ESLint rule. + * + * In 2015, ESLint decided to add an exception for these two specific cases + * ``` + * for (var key in object) return; + * + * var key; + * for (key in object) return; + * ``` + * + * I disagree with it, but what are you going to do... + * + * https://github.com/eslint/eslint/issues/2342 + */ + let idOrVariable; + if (node.left.type === utils_1.AST_NODE_TYPES.VariableDeclaration) { + const variable = this.#scopeManager.getDeclaredVariables(node.left).at(0); + if (!variable) { + return; + } + idOrVariable = variable; + } + if (node.left.type === utils_1.AST_NODE_TYPES.Identifier) { + idOrVariable = node.left; + } + if (idOrVariable == null) { + return; + } + let body = node.body; + if (node.body.type === utils_1.AST_NODE_TYPES.BlockStatement) { + if (node.body.body.length !== 1) { + return; + } + body = node.body.body[0]; + } + if (body.type !== utils_1.AST_NODE_TYPES.ReturnStatement) { + return; + } + this.markVariableAsUsed(idOrVariable); + } + visitFunction(node) { + const scope = this.getScope(node); + // skip implicit "arguments" variable + const variable = scope.set.get('arguments'); + if (variable?.defs.length === 0) { + this.markVariableAsUsed(variable); + } + } + visitFunctionTypeSignature(node) { + // function type signature params create variables because they can be referenced within the signature, + // but they obviously aren't unused variables for the purposes of this rule. + for (const param of node.params) { + this.visitPattern(param, name => { + this.markVariableAsUsed(name); + }); + } + } + visitSetter(node) { + if (node.kind === 'set') { + // ignore setter parameters because they're syntactically required to exist + for (const param of node.value.params) { + this.visitPattern(param, id => { + this.markVariableAsUsed(id); + }); + } + } + } +} +//#region private helpers +/** + * Checks the position of given nodes. + * @param inner A node which is expected as inside. + * @param outer A node which is expected as outside. + * @returns `true` if the `inner` node exists in the `outer` node. + */ +function isInside(inner, outer) { + return inner.range[0] >= outer.range[0] && inner.range[1] <= outer.range[1]; +} +/** + * Determine if an identifier is referencing an enclosing name. + * This only applies to declarations that create their own scope (modules, functions, classes) + * @param ref The reference to check. + * @param nodes The candidate function nodes. + * @returns True if it's a self-reference, false if not. + */ +function isSelfReference(ref, nodes) { + let scope = ref.from; + while (scope) { + if (nodes.has(scope.block)) { + return true; + } + scope = scope.upper; + } + return false; +} +const MERGEABLE_TYPES = new Set([ + utils_1.AST_NODE_TYPES.ClassDeclaration, + utils_1.AST_NODE_TYPES.FunctionDeclaration, + utils_1.AST_NODE_TYPES.TSInterfaceDeclaration, + utils_1.AST_NODE_TYPES.TSModuleDeclaration, + utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration, +]); +/** + * Determine if the variable is directly exported + * @param variable the variable to check + */ +function isMergeableExported(variable) { + // If all of the merged things are of the same type, TS will error if not all of them are exported - so we only need to find one + for (const def of variable.defs) { + // parameters can never be exported. + // their `node` prop points to the function decl, which can be exported + // so we need to special case them + if (def.type === utils_1.TSESLint.Scope.DefinitionType.Parameter) { + continue; + } + if ((MERGEABLE_TYPES.has(def.node.type) && + def.node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration) || + def.node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration) { + return true; + } + } + return false; +} +/** + * Determines if a given variable is being exported from a module. + * @param variable eslint-scope variable object. + * @returns True if the variable is exported, false if not. + */ +function isExported(variable) { + return variable.defs.some(definition => { + let node = definition.node; + if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) { + node = node.parent; + } + else if (definition.type === utils_1.TSESLint.Scope.DefinitionType.Parameter) { + return false; + } + return node.parent.type.startsWith('Export'); + }); +} +const LOGICAL_ASSIGNMENT_OPERATORS = new Set(['??=', '&&=', '||=']); +/** + * Determines if the variable is used. + * @param variable The variable to check. + * @returns True if the variable is used + */ +function isUsedVariable(variable) { + /** + * Gets a list of function definitions for a specified variable. + * @param variable eslint-scope variable object. + * @returns Function nodes. + */ + function getFunctionDefinitions(variable) { + const functionDefinitions = new Set(); + variable.defs.forEach(def => { + // FunctionDeclarations + if (def.type === utils_1.TSESLint.Scope.DefinitionType.FunctionName) { + functionDefinitions.add(def.node); + } + // FunctionExpressions + if (def.type === utils_1.TSESLint.Scope.DefinitionType.Variable && + (def.node.init?.type === utils_1.AST_NODE_TYPES.FunctionExpression || + def.node.init?.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression)) { + functionDefinitions.add(def.node.init); + } + }); + return functionDefinitions; + } + function getTypeDeclarations(variable) { + const nodes = new Set(); + variable.defs.forEach(def => { + if (def.node.type === utils_1.AST_NODE_TYPES.TSInterfaceDeclaration || + def.node.type === utils_1.AST_NODE_TYPES.TSTypeAliasDeclaration) { + nodes.add(def.node); + } + }); + return nodes; + } + function getModuleDeclarations(variable) { + const nodes = new Set(); + variable.defs.forEach(def => { + if (def.node.type === utils_1.AST_NODE_TYPES.TSModuleDeclaration) { + nodes.add(def.node); + } + }); + return nodes; + } + function getEnumDeclarations(variable) { + const nodes = new Set(); + variable.defs.forEach(def => { + if (def.node.type === utils_1.AST_NODE_TYPES.TSEnumDeclaration) { + nodes.add(def.node); + } + }); + return nodes; + } + /** + * Checks if the ref is contained within one of the given nodes + */ + function isInsideOneOf(ref, nodes) { + for (const node of nodes) { + if (isInside(ref.identifier, node)) { + return true; + } + } + return false; + } + /** + * Checks whether a given node is unused expression or not. + * @param node The node itself + * @returns The node is an unused expression. + */ + function isUnusedExpression(node) { + const parent = node.parent; + if (parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + return true; + } + if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression) { + const isLastExpression = parent.expressions[parent.expressions.length - 1] === node; + if (!isLastExpression) { + return true; + } + return isUnusedExpression(parent); + } + return false; + } + /** + * If a given reference is left-hand side of an assignment, this gets + * the right-hand side node of the assignment. + * + * In the following cases, this returns null. + * + * - The reference is not the LHS of an assignment expression. + * - The reference is inside of a loop. + * - The reference is inside of a function scope which is different from + * the declaration. + * @param ref A reference to check. + * @param prevRhsNode The previous RHS node. + * @returns The RHS node or null. + */ + function getRhsNode(ref, prevRhsNode) { + /** + * Checks whether the given node is in a loop or not. + * @param node The node to check. + * @returns `true` if the node is in a loop. + */ + function isInLoop(node) { + let currentNode = node; + while (currentNode) { + if (utils_1.ASTUtils.isFunction(currentNode)) { + break; + } + if (utils_1.ASTUtils.isLoop(currentNode)) { + return true; + } + currentNode = currentNode.parent; + } + return false; + } + const id = ref.identifier; + const parent = id.parent; + const refScope = ref.from.variableScope; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const varScope = ref.resolved.scope.variableScope; + const canBeUsedLater = refScope !== varScope || isInLoop(id); + /* + * Inherits the previous node if this reference is in the node. + * This is for `a = a + a`-like code. + */ + if (prevRhsNode && isInside(id, prevRhsNode)) { + return prevRhsNode; + } + if (parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression && + isUnusedExpression(parent) && + id === parent.left && + !canBeUsedLater) { + return parent.right; + } + return null; + } + /** + * Checks whether a given reference is a read to update itself or not. + * @param ref A reference to check. + * @param rhsNode The RHS node of the previous assignment. + * @returns The reference is a read to update itself. + */ + function isReadForItself(ref, rhsNode) { + /** + * Checks whether a given Identifier node exists inside of a function node which can be used later. + * + * "can be used later" means: + * - the function is assigned to a variable. + * - the function is bound to a property and the object can be used later. + * - the function is bound as an argument of a function call. + * + * If a reference exists in a function which can be used later, the reference is read when the function is called. + * @param id An Identifier node to check. + * @param rhsNode The RHS node of the previous assignment. + * @returns `true` if the `id` node exists inside of a function node which can be used later. + */ + function isInsideOfStorableFunction(id, rhsNode) { + /** + * Finds a function node from ancestors of a node. + * @param node A start node to find. + * @returns A found function node. + */ + function getUpperFunction(node) { + let currentNode = node; + while (currentNode) { + if (utils_1.ASTUtils.isFunction(currentNode)) { + return currentNode; + } + currentNode = currentNode.parent; + } + return null; + } + /** + * Checks whether a given function node is stored to somewhere or not. + * If the function node is stored, the function can be used later. + * @param funcNode A function node to check. + * @param rhsNode The RHS node of the previous assignment. + * @returns `true` if under the following conditions: + * - the funcNode is assigned to a variable. + * - the funcNode is bound as an argument of a function call. + * - the function is bound to a property and the object satisfies above conditions. + */ + function isStorableFunction(funcNode, rhsNode) { + let node = funcNode; + let parent = funcNode.parent; + while (parent && isInside(parent, rhsNode)) { + switch (parent.type) { + case utils_1.AST_NODE_TYPES.SequenceExpression: + if (parent.expressions[parent.expressions.length - 1] !== node) { + return false; + } + break; + case utils_1.AST_NODE_TYPES.CallExpression: + case utils_1.AST_NODE_TYPES.NewExpression: + return parent.callee !== node; + case utils_1.AST_NODE_TYPES.AssignmentExpression: + case utils_1.AST_NODE_TYPES.TaggedTemplateExpression: + case utils_1.AST_NODE_TYPES.YieldExpression: + return true; + default: + if (parent.type.endsWith('Statement') || + parent.type.endsWith('Declaration')) { + /* + * If it encountered statements, this is a complex pattern. + * Since analyzing complex patterns is hard, this returns `true` to avoid false positive. + */ + return true; + } + } + node = parent; + parent = parent.parent; + } + return false; + } + const funcNode = getUpperFunction(id); + return (!!funcNode && + isInside(funcNode, rhsNode) && + isStorableFunction(funcNode, rhsNode)); + } + const id = ref.identifier; + const parent = id.parent; + return (ref.isRead() && // in RHS of an assignment for itself. e.g. `a = a + 1` + // self update. e.g. `a += 1`, `a++` + ((parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression && + !LOGICAL_ASSIGNMENT_OPERATORS.has(parent.operator) && + isUnusedExpression(parent) && + parent.left === id) || + (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression && + isUnusedExpression(parent)) || + (!!rhsNode && + isInside(id, rhsNode) && + !isInsideOfStorableFunction(id, rhsNode)))); + } + const functionNodes = getFunctionDefinitions(variable); + const isFunctionDefinition = functionNodes.size > 0; + const typeDeclNodes = getTypeDeclarations(variable); + const isTypeDecl = typeDeclNodes.size > 0; + const moduleDeclNodes = getModuleDeclarations(variable); + const isModuleDecl = moduleDeclNodes.size > 0; + const enumDeclNodes = getEnumDeclarations(variable); + const isEnumDecl = enumDeclNodes.size > 0; + const isImportedAsType = variable.defs.every(isTypeImport_1.isTypeImport); + let rhsNode = null; + return variable.references.some(ref => { + const forItself = isReadForItself(ref, rhsNode); + rhsNode = getRhsNode(ref, rhsNode); + return (ref.isRead() && + !forItself && + !(!isImportedAsType && + ((0, referenceContainsTypeQuery_1.referenceContainsTypeQuery)(ref.identifier) || + (0, referenceContainsTypePredicate_1.referenceContainsTypePredicate)(ref.identifier))) && + !(isFunctionDefinition && isSelfReference(ref, functionNodes)) && + !(isTypeDecl && isInsideOneOf(ref, typeDeclNodes)) && + !(isModuleDecl && isSelfReference(ref, moduleDeclNodes)) && + !(isEnumDecl && isSelfReference(ref, enumDeclNodes))); + }); +} +//#endregion private helpers +/** + * Collects the set of unused variables for a given context. + * + * Due to complexity, this does not take into consideration: + * - variables within declaration files + * - variables within ambient module declarations + */ +function collectVariables(context) { + return UnusedVarsVisitor.collectUnusedVariables(context.sourceCode.ast, utils_1.ESLintUtils.nullThrows(context.sourceCode.scopeManager, 'Missing required scope manager')); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..13eb290daaf7215be0f4ccb9ff6279ea0d3e3a43 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.d.ts @@ -0,0 +1,5 @@ +import { ESLintUtils } from '@typescript-eslint/utils'; +import type { ESLintPluginDocs } from '../../rules'; +export declare const createRule: ({ meta, name, ...rule }: Readonly>) => ESLintUtils.RuleModule & { + name: string; +}; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js new file mode 100644 index 0000000000000000000000000000000000000000..2ae6aec2092c613e205b9b838f6dca72dda5b370 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/createRule.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createRule = void 0; +const utils_1 = require("@typescript-eslint/utils"); +exports.createRule = utils_1.ESLintUtils.RuleCreator(name => `https://typescript-eslint.io/rules/${name}`); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..34a8c254291544db48de33b88ce9e68ca9b7dab3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.d.ts @@ -0,0 +1 @@ +export declare function escapeRegExp(string?: string): string; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.js new file mode 100644 index 0000000000000000000000000000000000000000..02d2ab682090659cd2a430d81a4af62bbc9dcc52 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/escapeRegExp.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escapeRegExp = escapeRegExp; +/** + * Lodash + * Released under MIT license + */ +const reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +const reHasRegExpChar = RegExp(reRegExpChar.source); +function escapeRegExp(string = '') { + return string && reHasRegExpChar.test(string) + ? string.replaceAll(reRegExpChar, '\\$&') + : string; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f830810bc27c7e37e2f0517647d2f63f3f983821 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.d.ts @@ -0,0 +1,47 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +export type FunctionExpression = TSESTree.ArrowFunctionExpression | TSESTree.FunctionExpression; +export type FunctionNode = FunctionExpression | TSESTree.FunctionDeclaration; +export interface FunctionInfo { + node: T; + returns: TSESTree.ReturnStatement[]; +} +/** + * Checks if a function belongs to: + * ``` + * () => () => ... + * () => function () { ... } + * () => { return () => ... } + * () => { return function () { ... } } + * function fn() { return () => ... } + * function fn() { return function() { ... } } + * ``` + */ +export declare function doesImmediatelyReturnFunctionExpression({ node, returns, }: FunctionInfo): boolean; +interface Options { + allowDirectConstAssertionInArrowFunctions?: boolean; + allowExpressions?: boolean; + allowHigherOrderFunctions?: boolean; + allowTypedFunctionExpressions?: boolean; +} +/** + * True when the provided function expression is typed. + */ +export declare function isTypedFunctionExpression(node: FunctionExpression, options: Options): boolean; +/** + * Check whether the function expression return type is either typed or valid + * with the provided options. + */ +export declare function isValidFunctionExpressionReturnType(node: FunctionExpression, options: Options): boolean; +/** + * Checks if a function declaration/expression has a return type. + */ +export declare function checkFunctionReturnType({ node, returns }: FunctionInfo, options: Options, sourceCode: TSESLint.SourceCode, report: (loc: TSESTree.SourceLocation) => void): void; +/** + * Checks if a function declaration/expression has a return type. + */ +export declare function checkFunctionExpressionReturnType(info: FunctionInfo, options: Options, sourceCode: TSESLint.SourceCode, report: (loc: TSESTree.SourceLocation) => void): void; +/** + * Check whether any ancestor of the provided function has a valid return type. + */ +export declare function ancestorHasReturnType(node: FunctionNode): boolean; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..01f64f78a848c21b9e519c685e4bf55a848aa547 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/explicitReturnTypeUtils.js @@ -0,0 +1,238 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.doesImmediatelyReturnFunctionExpression = doesImmediatelyReturnFunctionExpression; +exports.isTypedFunctionExpression = isTypedFunctionExpression; +exports.isValidFunctionExpressionReturnType = isValidFunctionExpressionReturnType; +exports.checkFunctionReturnType = checkFunctionReturnType; +exports.checkFunctionExpressionReturnType = checkFunctionExpressionReturnType; +exports.ancestorHasReturnType = ancestorHasReturnType; +const utils_1 = require("@typescript-eslint/utils"); +const astUtils_1 = require("./astUtils"); +const getFunctionHeadLoc_1 = require("./getFunctionHeadLoc"); +/** + * Checks if a node is a variable declarator with a type annotation. + * ``` + * const x: Foo = ... + * ``` + */ +function isVariableDeclaratorWithTypeAnnotation(node) { + return (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator && !!node.id.typeAnnotation); +} +/** + * Checks if a node is a class property with a type annotation. + * ``` + * public x: Foo = ... + * ``` + */ +function isPropertyDefinitionWithTypeAnnotation(node) { + return (node.type === utils_1.AST_NODE_TYPES.PropertyDefinition && !!node.typeAnnotation); +} +/** + * Checks if a node belongs to: + * ``` + * foo(() => 1) + * ``` + */ +function isFunctionArgument(parent, callee) { + return (parent.type === utils_1.AST_NODE_TYPES.CallExpression && + // make sure this isn't an IIFE + parent.callee !== callee); +} +/** + * Checks if a node is type-constrained in JSX + * ``` + * {}} /> + * {() => {}} + * + * ``` + */ +function isTypedJSX(node) { + return (node.type === utils_1.AST_NODE_TYPES.JSXExpressionContainer || + node.type === utils_1.AST_NODE_TYPES.JSXSpreadAttribute); +} +function isTypedParent(parent, callee) { + return ((0, astUtils_1.isTypeAssertion)(parent) || + isVariableDeclaratorWithTypeAnnotation(parent) || + isDefaultFunctionParameterWithTypeAnnotation(parent) || + isPropertyDefinitionWithTypeAnnotation(parent) || + isFunctionArgument(parent, callee) || + isTypedJSX(parent)); +} +function isDefaultFunctionParameterWithTypeAnnotation(node) { + return (node.type === utils_1.AST_NODE_TYPES.AssignmentPattern && + node.left.typeAnnotation != null); +} +/** + * Checks if a node belongs to: + * ``` + * new Foo(() => {}) + * ^^^^^^^^ + * ``` + */ +function isConstructorArgument(node) { + return node.type === utils_1.AST_NODE_TYPES.NewExpression; +} +/** + * Checks if a node is a property or a nested property of a typed object: + * ``` + * const x: Foo = { prop: () => {} } + * const x = { prop: () => {} } as Foo + * const x = { prop: () => {} } + * const x: Foo = { bar: { prop: () => {} } } + * ``` + */ +function isPropertyOfObjectWithType(property) { + if (property?.type !== utils_1.AST_NODE_TYPES.Property) { + return false; + } + const objectExpr = property.parent; + if (objectExpr.type !== utils_1.AST_NODE_TYPES.ObjectExpression) { + return false; + } + const parent = objectExpr.parent; + return isTypedParent(parent) || isPropertyOfObjectWithType(parent); +} +/** + * Checks if a function belongs to: + * ``` + * () => () => ... + * () => function () { ... } + * () => { return () => ... } + * () => { return function () { ... } } + * function fn() { return () => ... } + * function fn() { return function() { ... } } + * ``` + */ +function doesImmediatelyReturnFunctionExpression({ node, returns, }) { + if (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + utils_1.ASTUtils.isFunction(node.body)) { + return true; + } + if (returns.length === 0) { + return false; + } + return returns.every(node => node.argument && utils_1.ASTUtils.isFunction(node.argument)); +} +/** + * Checks if a function belongs to: + * ``` + * ({ action: 'xxx' } as const) + * ``` + */ +function isConstAssertion(node) { + if ((0, astUtils_1.isTypeAssertion)(node)) { + const { typeAnnotation } = node; + if (typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference) { + const { typeName } = typeAnnotation; + if (typeName.type === utils_1.AST_NODE_TYPES.Identifier && + typeName.name === 'const') { + return true; + } + } + } + return false; +} +/** + * True when the provided function expression is typed. + */ +function isTypedFunctionExpression(node, options) { + if (!options.allowTypedFunctionExpressions) { + return false; + } + return (isTypedParent(node.parent, node) || + isPropertyOfObjectWithType(node.parent) || + isConstructorArgument(node.parent)); +} +/** + * Check whether the function expression return type is either typed or valid + * with the provided options. + */ +function isValidFunctionExpressionReturnType(node, options) { + if (isTypedFunctionExpression(node, options)) { + return true; + } + if (options.allowExpressions && + node.parent.type !== utils_1.AST_NODE_TYPES.VariableDeclarator && + node.parent.type !== utils_1.AST_NODE_TYPES.MethodDefinition && + node.parent.type !== utils_1.AST_NODE_TYPES.ExportDefaultDeclaration && + node.parent.type !== utils_1.AST_NODE_TYPES.PropertyDefinition) { + return true; + } + // https://github.com/typescript-eslint/typescript-eslint/issues/653 + if (!options.allowDirectConstAssertionInArrowFunctions || + node.type !== utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + return false; + } + let body = node.body; + while (body.type === utils_1.AST_NODE_TYPES.TSSatisfiesExpression) { + body = body.expression; + } + return isConstAssertion(body); +} +/** + * Check that the function expression or declaration is valid. + */ +function isValidFunctionReturnType({ node, returns }, options) { + if (options.allowHigherOrderFunctions && + doesImmediatelyReturnFunctionExpression({ node, returns })) { + return true; + } + return (node.returnType != null || + (0, astUtils_1.isConstructor)(node.parent) || + (0, astUtils_1.isSetter)(node.parent)); +} +/** + * Checks if a function declaration/expression has a return type. + */ +function checkFunctionReturnType({ node, returns }, options, sourceCode, report) { + if (isValidFunctionReturnType({ node, returns }, options)) { + return; + } + report((0, getFunctionHeadLoc_1.getFunctionHeadLoc)(node, sourceCode)); +} +/** + * Checks if a function declaration/expression has a return type. + */ +function checkFunctionExpressionReturnType(info, options, sourceCode, report) { + if (isValidFunctionExpressionReturnType(info.node, options)) { + return; + } + checkFunctionReturnType(info, options, sourceCode, report); +} +/** + * Check whether any ancestor of the provided function has a valid return type. + */ +function ancestorHasReturnType(node) { + let ancestor = node.parent; + if (ancestor.type === utils_1.AST_NODE_TYPES.Property) { + ancestor = ancestor.value; + } + // if the ancestor is not a return, then this function was not returned at all, so we can exit early + const isReturnStatement = ancestor.type === utils_1.AST_NODE_TYPES.ReturnStatement; + const isBodylessArrow = ancestor.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + ancestor.body.type !== utils_1.AST_NODE_TYPES.BlockStatement; + if (!isReturnStatement && !isBodylessArrow) { + return false; + } + while (ancestor) { + switch (ancestor.type) { + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: + case utils_1.AST_NODE_TYPES.FunctionDeclaration: + if (ancestor.returnType) { + return true; + } + break; + // const x: Foo = () => {}; + // Assume that a typed variable types the function expression + case utils_1.AST_NODE_TYPES.VariableDeclarator: + return !!ancestor.id.typeAnnotation; + case utils_1.AST_NODE_TYPES.PropertyDefinition: + return !!ancestor.typeAnnotation; + case utils_1.AST_NODE_TYPES.ExpressionStatement: + return false; + } + ancestor = ancestor.parent; + } + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getBaseTypesOfClassMember.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getBaseTypesOfClassMember.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3505724080b0dd84b2f61290136132a79099411e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getBaseTypesOfClassMember.d.ts @@ -0,0 +1,11 @@ +import type { TSESTree, ParserServicesWithTypeInformation } from '@typescript-eslint/utils'; +import type * as ts from 'typescript'; +/** + * Given a member of a class which extends another class or implements an interface, + * yields the corresponding member type for each of the base class/interfaces. + */ +export declare function getBaseTypesOfClassMember(services: ParserServicesWithTypeInformation, memberNode: TSESTree.MethodDefinition | TSESTree.PropertyDefinition): Generator<{ + baseType: ts.Type; + baseMemberType: ts.Type; + heritageToken: ts.SyntaxKind.ExtendsKeyword | ts.SyntaxKind.ImplementsKeyword; +}>; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getBaseTypesOfClassMember.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getBaseTypesOfClassMember.js new file mode 100644 index 0000000000000000000000000000000000000000..bfaeaf94a5b237eb43dec4d2cbe3b65ac6a0209c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getBaseTypesOfClassMember.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getBaseTypesOfClassMember = getBaseTypesOfClassMember; +/** + * Given a member of a class which extends another class or implements an interface, + * yields the corresponding member type for each of the base class/interfaces. + */ +function* getBaseTypesOfClassMember(services, memberNode) { + const memberTsNode = services.esTreeNodeToTSNodeMap.get(memberNode); + if (memberTsNode.name == null) { + return; + } + const checker = services.program.getTypeChecker(); + const memberSymbol = checker.getSymbolAtLocation(memberTsNode.name); + if (memberSymbol == null) { + return; + } + const classNode = memberTsNode.parent; + for (const clauseNode of classNode.heritageClauses ?? []) { + for (const baseTypeNode of clauseNode.types) { + const baseType = checker.getTypeAtLocation(baseTypeNode); + const baseMemberSymbol = checker.getPropertyOfType(baseType, memberSymbol.name); + if (baseMemberSymbol == null) { + continue; + } + const baseMemberType = checker.getTypeOfSymbolAtLocation(baseMemberSymbol, memberTsNode); + const heritageToken = clauseNode.token; + yield { baseMemberType, baseType, heritageToken }; + } + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f733ab09fd27a1778760e187b7638f988acf6116 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.d.ts @@ -0,0 +1,35 @@ +import type * as ts from 'typescript'; +export interface ConstraintTypeInfoUnconstrained { + constraintType: undefined; + isTypeParameter: true; +} +export interface ConstraintTypeInfoConstrained { + constraintType: ts.Type; + isTypeParameter: true; +} +export interface ConstraintTypeInfoNonGeneric { + constraintType: ts.Type; + isTypeParameter: false; +} +export type ConstraintTypeInfo = ConstraintTypeInfoConstrained | ConstraintTypeInfoNonGeneric | ConstraintTypeInfoUnconstrained; +/** + * Returns whether the type is a generic and what its constraint is. + * + * If the type is not a generic, `isTypeParameter` will be `false`, and + * `constraintType` will be the same as the input type. + * + * If the type is a generic, and it is constrained, `isTypeParameter` will be + * `true`, and `constraintType` will be the constraint type. + * + * If the type is a generic, but it is not constrained, `constraintType` will be + * `undefined` (rather than an `unknown` type), due to https://github.com/microsoft/TypeScript/issues/60475 + * + * Successor to {@link getConstrainedTypeAtLocation} due to https://github.com/typescript-eslint/typescript-eslint/issues/10438 + * + * This is considered internal since it is unstable for now and may have breaking changes at any time. + * Use at your own risk. + * + * @internal + * + */ +export declare function getConstraintInfo(checker: ts.TypeChecker, type: ts.Type): ConstraintTypeInfo; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.js new file mode 100644 index 0000000000000000000000000000000000000000..76f209631423dceb2c6d7b813dc249e703cea540 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getConstraintInfo.js @@ -0,0 +1,70 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getConstraintInfo = getConstraintInfo; +const tsutils = __importStar(require("ts-api-utils")); +/** + * Returns whether the type is a generic and what its constraint is. + * + * If the type is not a generic, `isTypeParameter` will be `false`, and + * `constraintType` will be the same as the input type. + * + * If the type is a generic, and it is constrained, `isTypeParameter` will be + * `true`, and `constraintType` will be the constraint type. + * + * If the type is a generic, but it is not constrained, `constraintType` will be + * `undefined` (rather than an `unknown` type), due to https://github.com/microsoft/TypeScript/issues/60475 + * + * Successor to {@link getConstrainedTypeAtLocation} due to https://github.com/typescript-eslint/typescript-eslint/issues/10438 + * + * This is considered internal since it is unstable for now and may have breaking changes at any time. + * Use at your own risk. + * + * @internal + * + */ +function getConstraintInfo(checker, type) { + if (tsutils.isTypeParameter(type)) { + const constraintType = checker.getBaseConstraintOfType(type); + return { + constraintType, + isTypeParameter: true, + }; + } + return { + constraintType: type, + isTypeParameter: false, + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b2b490ecd5a4e4cb7bb43a81cf51ff73b7b2aaae --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.d.ts @@ -0,0 +1,27 @@ +interface RuleMap { + 'arrow-parens': typeof import('eslint/lib/rules/arrow-parens'); + 'consistent-return': typeof import('eslint/lib/rules/consistent-return'); + 'dot-notation': typeof import('eslint/lib/rules/dot-notation'); + 'init-declarations': typeof import('eslint/lib/rules/init-declarations'); + 'max-params': typeof import('eslint/lib/rules/max-params'); + 'no-dupe-args': typeof import('eslint/lib/rules/no-dupe-args'); + 'no-dupe-class-members': typeof import('eslint/lib/rules/no-dupe-class-members'); + 'no-empty-function': typeof import('eslint/lib/rules/no-empty-function'); + 'no-implicit-globals': typeof import('eslint/lib/rules/no-implicit-globals'); + 'no-invalid-this': typeof import('eslint/lib/rules/no-invalid-this'); + 'no-loop-func': typeof import('eslint/lib/rules/no-loop-func'); + 'no-loss-of-precision': typeof import('eslint/lib/rules/no-loss-of-precision'); + 'no-magic-numbers': typeof import('eslint/lib/rules/no-magic-numbers'); + 'no-restricted-globals': typeof import('eslint/lib/rules/no-restricted-globals'); + 'no-restricted-imports': typeof import('eslint/lib/rules/no-restricted-imports'); + 'no-undef': typeof import('eslint/lib/rules/no-undef'); + 'no-unused-expressions': typeof import('eslint/lib/rules/no-unused-expressions'); + 'no-useless-constructor': typeof import('eslint/lib/rules/no-useless-constructor'); + 'prefer-const': typeof import('eslint/lib/rules/prefer-const'); + 'prefer-destructuring': typeof import('eslint/lib/rules/prefer-destructuring'); + strict: typeof import('eslint/lib/rules/strict'); +} +type RuleId = keyof RuleMap; +export declare const getESLintCoreRule: (ruleId: R) => RuleMap[R]; +export declare function maybeGetESLintCoreRule(ruleId: R): RuleMap[R] | null; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.js new file mode 100644 index 0000000000000000000000000000000000000000..6bb8fa471d3c59f22fc1a9ac0fd216334ae0682f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getESLintCoreRule.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getESLintCoreRule = void 0; +exports.maybeGetESLintCoreRule = maybeGetESLintCoreRule; +const utils_1 = require("@typescript-eslint/utils"); +const use_at_your_own_risk_1 = require("eslint/use-at-your-own-risk"); +const getESLintCoreRule = (ruleId) => utils_1.ESLintUtils.nullThrows(use_at_your_own_risk_1.builtinRules.get(ruleId), `ESLint's core rule '${ruleId}' not found.`); +exports.getESLintCoreRule = getESLintCoreRule; +function maybeGetESLintCoreRule(ruleId) { + try { + return (0, exports.getESLintCoreRule)(ruleId); + } + catch { + return null; + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3f1008b18d6b399f62d3c843038c842ec745b45 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.d.ts @@ -0,0 +1,9 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +export declare function getFixOrSuggest({ fixOrSuggest, suggestion, }: { + fixOrSuggest: 'fix' | 'none' | 'suggest'; + suggestion: TSESLint.SuggestionReportDescriptor; +}): { + fix: TSESLint.ReportFixFunction; +} | { + suggest: TSESLint.SuggestionReportDescriptor[]; +} | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.js new file mode 100644 index 0000000000000000000000000000000000000000..d665b96a3edd9a496f83fc15db1175251c568bcc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFixOrSuggest.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFixOrSuggest = getFixOrSuggest; +function getFixOrSuggest({ fixOrSuggest, suggestion, }) { + switch (fixOrSuggest) { + case 'fix': + return { fix: suggestion.fix }; + case 'none': + return undefined; + case 'suggest': + return { suggest: [suggestion] }; + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2746829f4f366903ff31cd605cd38fb24827ab02 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.d.ts @@ -0,0 +1,17 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +/** + * Gets the location of the head of the given for statement variant for reporting. + * + * - `for (const foo in bar) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^ + * + * - `for (const foo of bar) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^ + * + * - `for await (const foo of bar) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * + * - `for (let i = 0; i < 10; i++) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +export declare function getForStatementHeadLoc(sourceCode: TSESLint.SourceCode, node: TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement): TSESTree.SourceLocation; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.js new file mode 100644 index 0000000000000000000000000000000000000000..aa6c0daf9c6c813d575c92637548533f4e092d38 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getForStatementHeadLoc.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getForStatementHeadLoc = getForStatementHeadLoc; +const eslint_utils_1 = require("@typescript-eslint/utils/eslint-utils"); +/** + * Gets the location of the head of the given for statement variant for reporting. + * + * - `for (const foo in bar) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^ + * + * - `for (const foo of bar) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^ + * + * - `for await (const foo of bar) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * + * - `for (let i = 0; i < 10; i++) expressionOrBlock` + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + */ +function getForStatementHeadLoc(sourceCode, node) { + const closingParens = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenBefore(node.body, token => token.value === ')'), 'for statement must have a closing parenthesis.'); + return { + end: structuredClone(closingParens.loc.end), + start: structuredClone(node.loc.start), + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7aac75d5693550e00ad24dd160e1d2b254e80cd0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.d.ts @@ -0,0 +1,101 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +type FunctionNode = TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression; +/** + * Gets the location of the given function node for reporting. + * + * - `function foo() {}` + * ^^^^^^^^^^^^ + * - `(function foo() {})` + * ^^^^^^^^^^^^ + * - `(function() {})` + * ^^^^^^^^ + * - `function* foo() {}` + * ^^^^^^^^^^^^^ + * - `(function* foo() {})` + * ^^^^^^^^^^^^^ + * - `(function*() {})` + * ^^^^^^^^^ + * - `() => {}` + * ^^ + * - `async () => {}` + * ^^ + * - `({ foo: function foo() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ foo: function() {} })` + * ^^^^^^^^^^^^^ + * - `({ ['foo']: function() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function() {} })` + * ^^^^^^^^^^^^^^^ + * - `({ foo() {} })` + * ^^^ + * - `({ foo: function* foo() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ foo: function*() {} })` + * ^^^^^^^^^^^^^^ + * - `({ ['foo']: function*() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function*() {} })` + * ^^^^^^^^^^^^^^^^ + * - `({ *foo() {} })` + * ^^^^ + * - `({ foo: async function foo() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ foo: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^ + * - `({ ['foo']: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `({ async foo() {} })` + * ^^^^^^^^^ + * - `({ get foo() {} })` + * ^^^^^^^ + * - `({ set foo(a) {} })` + * ^^^^^^^ + * - `class A { constructor() {} }` + * ^^^^^^^^^^^ + * - `class A { foo() {} }` + * ^^^ + * - `class A { *foo() {} }` + * ^^^^ + * - `class A { async foo() {} }` + * ^^^^^^^^^ + * - `class A { ['foo']() {} }` + * ^^^^^^^ + * - `class A { *['foo']() {} }` + * ^^^^^^^^ + * - `class A { async ['foo']() {} }` + * ^^^^^^^^^^^^^ + * - `class A { [foo]() {} }` + * ^^^^^ + * - `class A { *[foo]() {} }` + * ^^^^^^ + * - `class A { async [foo]() {} }` + * ^^^^^^^^^^^ + * - `class A { get foo() {} }` + * ^^^^^^^ + * - `class A { set foo(a) {} }` + * ^^^^^^^ + * - `class A { static foo() {} }` + * ^^^^^^^^^^ + * - `class A { static *foo() {} }` + * ^^^^^^^^^^^ + * - `class A { static async foo() {} }` + * ^^^^^^^^^^^^^^^^ + * - `class A { static get foo() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static set foo(a) {} }` + * ^^^^^^^^^^^^^^ + * - `class A { foo = function() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static foo = function() {} }` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `class A { foo = (a, b) => {} }` + * ^^^^^^ + * @param node The function node to get. + * @param sourceCode The source code object to get tokens. + * @returns The location of the function node for reporting. + */ +export declare function getFunctionHeadLoc(node: FunctionNode, sourceCode: TSESLint.SourceCode): TSESTree.SourceLocation; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.js new file mode 100644 index 0000000000000000000000000000000000000000..cf62152e600874dfd6e2e4f0ed2887990c8f06a0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getFunctionHeadLoc.js @@ -0,0 +1,161 @@ +"use strict"; +// adapted from https://github.com/eslint/eslint/blob/5bdaae205c3a0089ea338b382df59e21d5b06436/lib/rules/utils/ast-utils.js#L1668-L1787 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFunctionHeadLoc = getFunctionHeadLoc; +const utils_1 = require("@typescript-eslint/utils"); +const astUtils_1 = require("./astUtils"); +/** + * Gets the `(` token of the given function node. + * @param node The function node to get. + * @param sourceCode The source code object to get tokens. + * @returns `(` token. + */ +function getOpeningParenOfParams(node, sourceCode) { + // If the node is an arrow function and doesn't have parens, this returns the identifier of the first param. + if (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + node.params.length === 1) { + const argToken = utils_1.ESLintUtils.nullThrows(sourceCode.getFirstToken(node.params[0]), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('parameter', 'arrow function')); + const maybeParenToken = sourceCode.getTokenBefore(argToken); + return maybeParenToken && (0, astUtils_1.isOpeningParenToken)(maybeParenToken) + ? maybeParenToken + : argToken; + } + // Otherwise, returns paren. + return node.id != null + ? utils_1.ESLintUtils.nullThrows(sourceCode.getTokenAfter(node.id, astUtils_1.isOpeningParenToken), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('id', 'function')) + : utils_1.ESLintUtils.nullThrows(sourceCode.getFirstToken(node, astUtils_1.isOpeningParenToken), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('opening parenthesis', 'function')); +} +/** + * Gets the location of the given function node for reporting. + * + * - `function foo() {}` + * ^^^^^^^^^^^^ + * - `(function foo() {})` + * ^^^^^^^^^^^^ + * - `(function() {})` + * ^^^^^^^^ + * - `function* foo() {}` + * ^^^^^^^^^^^^^ + * - `(function* foo() {})` + * ^^^^^^^^^^^^^ + * - `(function*() {})` + * ^^^^^^^^^ + * - `() => {}` + * ^^ + * - `async () => {}` + * ^^ + * - `({ foo: function foo() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ foo: function() {} })` + * ^^^^^^^^^^^^^ + * - `({ ['foo']: function() {} })` + * ^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function() {} })` + * ^^^^^^^^^^^^^^^ + * - `({ foo() {} })` + * ^^^ + * - `({ foo: function* foo() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ foo: function*() {} })` + * ^^^^^^^^^^^^^^ + * - `({ ['foo']: function*() {} })` + * ^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: function*() {} })` + * ^^^^^^^^^^^^^^^^ + * - `({ *foo() {} })` + * ^^^^ + * - `({ foo: async function foo() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ foo: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^ + * - `({ ['foo']: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^^^ + * - `({ [foo]: async function() {} })` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `({ async foo() {} })` + * ^^^^^^^^^ + * - `({ get foo() {} })` + * ^^^^^^^ + * - `({ set foo(a) {} })` + * ^^^^^^^ + * - `class A { constructor() {} }` + * ^^^^^^^^^^^ + * - `class A { foo() {} }` + * ^^^ + * - `class A { *foo() {} }` + * ^^^^ + * - `class A { async foo() {} }` + * ^^^^^^^^^ + * - `class A { ['foo']() {} }` + * ^^^^^^^ + * - `class A { *['foo']() {} }` + * ^^^^^^^^ + * - `class A { async ['foo']() {} }` + * ^^^^^^^^^^^^^ + * - `class A { [foo]() {} }` + * ^^^^^ + * - `class A { *[foo]() {} }` + * ^^^^^^ + * - `class A { async [foo]() {} }` + * ^^^^^^^^^^^ + * - `class A { get foo() {} }` + * ^^^^^^^ + * - `class A { set foo(a) {} }` + * ^^^^^^^ + * - `class A { static foo() {} }` + * ^^^^^^^^^^ + * - `class A { static *foo() {} }` + * ^^^^^^^^^^^ + * - `class A { static async foo() {} }` + * ^^^^^^^^^^^^^^^^ + * - `class A { static get foo() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static set foo(a) {} }` + * ^^^^^^^^^^^^^^ + * - `class A { foo = function() {} }` + * ^^^^^^^^^^^^^^ + * - `class A { static foo = function() {} }` + * ^^^^^^^^^^^^^^^^^^^^^ + * - `class A { foo = (a, b) => {} }` + * ^^^^^^ + * @param node The function node to get. + * @param sourceCode The source code object to get tokens. + * @returns The location of the function node for reporting. + */ +function getFunctionHeadLoc(node, sourceCode) { + const parent = node.parent; + let start; + let end; + if (parent.type === utils_1.AST_NODE_TYPES.MethodDefinition || + parent.type === utils_1.AST_NODE_TYPES.PropertyDefinition) { + // the decorator's range is included within the member + // however it's usually irrelevant to the member itself - so we don't want + // to highlight it ever. + if (parent.decorators.length > 0) { + const lastDecorator = parent.decorators[parent.decorators.length - 1]; + const firstTokenAfterDecorator = utils_1.ESLintUtils.nullThrows(sourceCode.getTokenAfter(lastDecorator), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('modifier or member name', 'class member')); + start = firstTokenAfterDecorator.loc.start; + } + else { + start = parent.loc.start; + } + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + else if (parent.type === utils_1.AST_NODE_TYPES.Property) { + start = parent.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + else if (node.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression) { + const arrowToken = utils_1.ESLintUtils.nullThrows(sourceCode.getTokenBefore(node.body, astUtils_1.isArrowToken), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('arrow token', 'arrow function')); + start = arrowToken.loc.start; + end = arrowToken.loc.end; + } + else { + start = node.loc.start; + end = getOpeningParenOfParams(node, sourceCode).loc.start; + } + return { + end: { ...end }, + start: { ...start }, + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5fa886f22c4697de2b50fec178dfb076a3444954 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.d.ts @@ -0,0 +1,36 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +/** + * Generates report loc suitable for reporting on how a class member is + * declared, rather than how it's implemented. + * + * ```ts + * class A { + * abstract method(): void; + * ~~~~~~~~~~~~~~~ + * + * concreteMethod(): void { + * ~~~~~~~~~~~~~~ + * // code + * } + * + * abstract private property?: string; + * ~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * @decorator override concreteProperty = 'value'; + * ~~~~~~~~~~~~~~~~~~~~~~~~~ + * } + * ``` + */ +export declare function getMemberHeadLoc(sourceCode: Readonly, node: TSESTree.AccessorProperty | TSESTree.MethodDefinition | TSESTree.PropertyDefinition | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractMethodDefinition | TSESTree.TSAbstractPropertyDefinition): TSESTree.SourceLocation; +/** + * Generates report loc suitable for reporting on how a parameter property is + * declared. + * + * ```ts + * class A { + * constructor(private property: string = 'value') { + * ~~~~~~~~~~~~~~~~ + * } + * ``` + */ +export declare function getParameterPropertyHeadLoc(sourceCode: Readonly, node: TSESTree.TSParameterProperty, nodeName: string): TSESTree.SourceLocation; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.js new file mode 100644 index 0000000000000000000000000000000000000000..8b0f1776d5507c24012291dbcee839c0504dab54 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getMemberHeadLoc.js @@ -0,0 +1,79 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getMemberHeadLoc = getMemberHeadLoc; +exports.getParameterPropertyHeadLoc = getParameterPropertyHeadLoc; +const eslint_utils_1 = require("@typescript-eslint/utils/eslint-utils"); +/** + * Generates report loc suitable for reporting on how a class member is + * declared, rather than how it's implemented. + * + * ```ts + * class A { + * abstract method(): void; + * ~~~~~~~~~~~~~~~ + * + * concreteMethod(): void { + * ~~~~~~~~~~~~~~ + * // code + * } + * + * abstract private property?: string; + * ~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * @decorator override concreteProperty = 'value'; + * ~~~~~~~~~~~~~~~~~~~~~~~~~ + * } + * ``` + */ +function getMemberHeadLoc(sourceCode, node) { + let start; + if (node.decorators.length === 0) { + start = node.loc.start; + } + else { + const lastDecorator = node.decorators[node.decorators.length - 1]; + const nextToken = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenAfter(lastDecorator), eslint_utils_1.NullThrowsReasons.MissingToken('token', 'last decorator')); + start = nextToken.loc.start; + } + let end; + if (!node.computed) { + end = node.key.loc.end; + } + else { + const closingBracket = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenAfter(node.key, token => token.value === ']'), eslint_utils_1.NullThrowsReasons.MissingToken(']', node.type)); + end = closingBracket.loc.end; + } + return { + end: structuredClone(end), + start: structuredClone(start), + }; +} +/** + * Generates report loc suitable for reporting on how a parameter property is + * declared. + * + * ```ts + * class A { + * constructor(private property: string = 'value') { + * ~~~~~~~~~~~~~~~~ + * } + * ``` + */ +function getParameterPropertyHeadLoc(sourceCode, node, nodeName) { + // Parameter properties have a weirdly different AST structure + // than other class members. + let start; + if (node.decorators.length === 0) { + start = structuredClone(node.loc.start); + } + else { + const lastDecorator = node.decorators[node.decorators.length - 1]; + const nextToken = (0, eslint_utils_1.nullThrows)(sourceCode.getTokenAfter(lastDecorator), eslint_utils_1.NullThrowsReasons.MissingToken('token', 'last decorator')); + start = structuredClone(nextToken.loc.start); + } + const end = sourceCode.getLocFromIndex(node.parameter.range[0] + nodeName.length); + return { + end, + start, + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8c8e09629e5fb9b149034885601c76aeb927c618 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.d.ts @@ -0,0 +1,39 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import { SyntaxKind } from 'typescript'; +import type { ValueOf } from './types'; +export declare enum OperatorPrecedence { + Comma = 0, + Spread = 1, + Yield = 2, + Assignment = 3, + Conditional = 4, + Coalesce = 4,// NOTE: This is wrong + LogicalOR = 5, + LogicalAND = 6, + BitwiseOR = 7, + BitwiseXOR = 8, + BitwiseAND = 9, + Equality = 10, + Relational = 11, + Shift = 12, + Additive = 13, + Multiplicative = 14, + Exponentiation = 15, + Unary = 16, + Update = 17, + LeftHandSide = 18, + Member = 19, + Primary = 20, + Highest = 20, + Lowest = 0, + Invalid = -1 +} +/** + * Note that this does not take into account parenthesization. You should check + * for parenthesization separately if it's relevant to your usage. + */ +export declare function getOperatorPrecedenceForNode(node: TSESTree.Node): OperatorPrecedence; +type TSESTreeOperatorKind = ValueOf | ValueOf; +export declare function getOperatorPrecedence(nodeKind: SyntaxKind, operatorKind: SyntaxKind, hasArguments?: boolean): OperatorPrecedence; +export declare function getBinaryOperatorPrecedence(kind: SyntaxKind | TSESTreeOperatorKind): OperatorPrecedence; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.js new file mode 100644 index 0000000000000000000000000000000000000000..53671095ceda2381e02930cd484631d5ed169e75 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getOperatorPrecedence.js @@ -0,0 +1,421 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OperatorPrecedence = void 0; +exports.getOperatorPrecedenceForNode = getOperatorPrecedenceForNode; +exports.getOperatorPrecedence = getOperatorPrecedence; +exports.getBinaryOperatorPrecedence = getBinaryOperatorPrecedence; +const utils_1 = require("@typescript-eslint/utils"); +const typescript_1 = require("typescript"); +var OperatorPrecedence; +(function (OperatorPrecedence) { + // Expression: + // AssignmentExpression + // Expression `,` AssignmentExpression + OperatorPrecedence[OperatorPrecedence["Comma"] = 0] = "Comma"; + // NOTE: `Spread` is higher than `Comma` due to how it is parsed in |ElementList| + // SpreadElement: + // `...` AssignmentExpression + OperatorPrecedence[OperatorPrecedence["Spread"] = 1] = "Spread"; + // AssignmentExpression: + // ConditionalExpression + // YieldExpression + // ArrowFunction + // AsyncArrowFunction + // LeftHandSideExpression `=` AssignmentExpression + // LeftHandSideExpression AssignmentOperator AssignmentExpression + // + // NOTE: AssignmentExpression is broken down into several precedences due to the requirements + // of the parenthesize rules. + // AssignmentExpression: YieldExpression + // YieldExpression: + // `yield` + // `yield` AssignmentExpression + // `yield` `*` AssignmentExpression + OperatorPrecedence[OperatorPrecedence["Yield"] = 2] = "Yield"; + // AssignmentExpression: LeftHandSideExpression `=` AssignmentExpression + // AssignmentExpression: LeftHandSideExpression AssignmentOperator AssignmentExpression + // AssignmentOperator: one of + // `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=` + OperatorPrecedence[OperatorPrecedence["Assignment"] = 3] = "Assignment"; + // NOTE: `Conditional` is considered higher than `Assignment` here, but in reality they have + // the same precedence. + // AssignmentExpression: ConditionalExpression + // ConditionalExpression: + // ShortCircuitExpression + // ShortCircuitExpression `?` AssignmentExpression `:` AssignmentExpression + // ShortCircuitExpression: + // LogicalORExpression + // CoalesceExpression + OperatorPrecedence[OperatorPrecedence["Conditional"] = 4] = "Conditional"; + // CoalesceExpression: + // CoalesceExpressionHead `??` BitwiseORExpression + // CoalesceExpressionHead: + // CoalesceExpression + // BitwiseORExpression + OperatorPrecedence[OperatorPrecedence["Coalesce"] = 4] = "Coalesce"; + // LogicalORExpression: + // LogicalANDExpression + // LogicalORExpression `||` LogicalANDExpression + OperatorPrecedence[OperatorPrecedence["LogicalOR"] = 5] = "LogicalOR"; + // LogicalANDExpression: + // BitwiseORExpression + // LogicalANDExpression `&&` BitwiseORExpression + OperatorPrecedence[OperatorPrecedence["LogicalAND"] = 6] = "LogicalAND"; + // BitwiseORExpression: + // BitwiseXORExpression + // BitwiseORExpression `^` BitwiseXORExpression + OperatorPrecedence[OperatorPrecedence["BitwiseOR"] = 7] = "BitwiseOR"; + // BitwiseXORExpression: + // BitwiseANDExpression + // BitwiseXORExpression `^` BitwiseANDExpression + OperatorPrecedence[OperatorPrecedence["BitwiseXOR"] = 8] = "BitwiseXOR"; + // BitwiseANDExpression: + // EqualityExpression + // BitwiseANDExpression `^` EqualityExpression + OperatorPrecedence[OperatorPrecedence["BitwiseAND"] = 9] = "BitwiseAND"; + // EqualityExpression: + // RelationalExpression + // EqualityExpression `==` RelationalExpression + // EqualityExpression `!=` RelationalExpression + // EqualityExpression `===` RelationalExpression + // EqualityExpression `!==` RelationalExpression + OperatorPrecedence[OperatorPrecedence["Equality"] = 10] = "Equality"; + // RelationalExpression: + // ShiftExpression + // RelationalExpression `<` ShiftExpression + // RelationalExpression `>` ShiftExpression + // RelationalExpression `<=` ShiftExpression + // RelationalExpression `>=` ShiftExpression + // RelationalExpression `instanceof` ShiftExpression + // RelationalExpression `in` ShiftExpression + // [+TypeScript] RelationalExpression `as` Type + OperatorPrecedence[OperatorPrecedence["Relational"] = 11] = "Relational"; + // ShiftExpression: + // AdditiveExpression + // ShiftExpression `<<` AdditiveExpression + // ShiftExpression `>>` AdditiveExpression + // ShiftExpression `>>>` AdditiveExpression + OperatorPrecedence[OperatorPrecedence["Shift"] = 12] = "Shift"; + // AdditiveExpression: + // MultiplicativeExpression + // AdditiveExpression `+` MultiplicativeExpression + // AdditiveExpression `-` MultiplicativeExpression + OperatorPrecedence[OperatorPrecedence["Additive"] = 13] = "Additive"; + // MultiplicativeExpression: + // ExponentiationExpression + // MultiplicativeExpression MultiplicativeOperator ExponentiationExpression + // MultiplicativeOperator: one of `*`, `/`, `%` + OperatorPrecedence[OperatorPrecedence["Multiplicative"] = 14] = "Multiplicative"; + // ExponentiationExpression: + // UnaryExpression + // UpdateExpression `**` ExponentiationExpression + OperatorPrecedence[OperatorPrecedence["Exponentiation"] = 15] = "Exponentiation"; + // UnaryExpression: + // UpdateExpression + // `delete` UnaryExpression + // `void` UnaryExpression + // `typeof` UnaryExpression + // `+` UnaryExpression + // `-` UnaryExpression + // `~` UnaryExpression + // `!` UnaryExpression + // AwaitExpression + // UpdateExpression: // TODO: Do we need to investigate the precedence here? + // `++` UnaryExpression + // `--` UnaryExpression + OperatorPrecedence[OperatorPrecedence["Unary"] = 16] = "Unary"; + // UpdateExpression: + // LeftHandSideExpression + // LeftHandSideExpression `++` + // LeftHandSideExpression `--` + OperatorPrecedence[OperatorPrecedence["Update"] = 17] = "Update"; + // LeftHandSideExpression: + // NewExpression + // CallExpression + // NewExpression: + // MemberExpression + // `new` NewExpression + OperatorPrecedence[OperatorPrecedence["LeftHandSide"] = 18] = "LeftHandSide"; + // CallExpression: + // CoverCallExpressionAndAsyncArrowHead + // SuperCall + // ImportCall + // CallExpression Arguments + // CallExpression `[` Expression `]` + // CallExpression `.` IdentifierName + // CallExpression TemplateLiteral + // MemberExpression: + // PrimaryExpression + // MemberExpression `[` Expression `]` + // MemberExpression `.` IdentifierName + // MemberExpression TemplateLiteral + // SuperProperty + // MetaProperty + // `new` MemberExpression Arguments + OperatorPrecedence[OperatorPrecedence["Member"] = 19] = "Member"; + // TODO: JSXElement? + // PrimaryExpression: + // `this` + // IdentifierReference + // Literal + // ArrayLiteral + // ObjectLiteral + // FunctionExpression + // ClassExpression + // GeneratorExpression + // AsyncFunctionExpression + // AsyncGeneratorExpression + // RegularExpressionLiteral + // TemplateLiteral + // CoverParenthesizedExpressionAndArrowParameterList + OperatorPrecedence[OperatorPrecedence["Primary"] = 20] = "Primary"; + OperatorPrecedence[OperatorPrecedence["Highest"] = 20] = "Highest"; + OperatorPrecedence[OperatorPrecedence["Lowest"] = 0] = "Lowest"; + // -1 is lower than all other precedences. Returning it will cause binary expression + // parsing to stop. + OperatorPrecedence[OperatorPrecedence["Invalid"] = -1] = "Invalid"; +})(OperatorPrecedence || (exports.OperatorPrecedence = OperatorPrecedence = {})); +/** + * Note that this does not take into account parenthesization. You should check + * for parenthesization separately if it's relevant to your usage. + */ +function getOperatorPrecedenceForNode(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.SpreadElement: + case utils_1.AST_NODE_TYPES.RestElement: + return OperatorPrecedence.Spread; + case utils_1.AST_NODE_TYPES.YieldExpression: + case utils_1.AST_NODE_TYPES.ArrowFunctionExpression: + return OperatorPrecedence.Yield; + case utils_1.AST_NODE_TYPES.ConditionalExpression: + return OperatorPrecedence.Conditional; + case utils_1.AST_NODE_TYPES.SequenceExpression: + return OperatorPrecedence.Comma; + case utils_1.AST_NODE_TYPES.AssignmentExpression: + case utils_1.AST_NODE_TYPES.BinaryExpression: + case utils_1.AST_NODE_TYPES.LogicalExpression: + switch (node.operator) { + case '==': + case '+=': + case '-=': + case '**=': + case '*=': + case '/=': + case '%=': + case '<<=': + case '>>=': + case '>>>=': + case '&=': + case '^=': + case '|=': + case '||=': + case '&&=': + case '??=': + return OperatorPrecedence.Assignment; + default: + return getBinaryOperatorPrecedence(node.operator); + } + case utils_1.AST_NODE_TYPES.TSTypeAssertion: + case utils_1.AST_NODE_TYPES.TSNonNullExpression: + case utils_1.AST_NODE_TYPES.UnaryExpression: + case utils_1.AST_NODE_TYPES.AwaitExpression: + return OperatorPrecedence.Unary; + case utils_1.AST_NODE_TYPES.UpdateExpression: + // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? + if (node.prefix) { + return OperatorPrecedence.Unary; + } + return OperatorPrecedence.Update; + case utils_1.AST_NODE_TYPES.ChainExpression: + return getOperatorPrecedenceForNode(node.expression); + case utils_1.AST_NODE_TYPES.CallExpression: + return OperatorPrecedence.LeftHandSide; + case utils_1.AST_NODE_TYPES.NewExpression: + return node.arguments.length > 0 + ? OperatorPrecedence.Member + : OperatorPrecedence.LeftHandSide; + case utils_1.AST_NODE_TYPES.TaggedTemplateExpression: + case utils_1.AST_NODE_TYPES.MemberExpression: + case utils_1.AST_NODE_TYPES.MetaProperty: + return OperatorPrecedence.Member; + case utils_1.AST_NODE_TYPES.TSAsExpression: + return OperatorPrecedence.Relational; + case utils_1.AST_NODE_TYPES.ThisExpression: + case utils_1.AST_NODE_TYPES.Super: + case utils_1.AST_NODE_TYPES.Identifier: + case utils_1.AST_NODE_TYPES.PrivateIdentifier: + case utils_1.AST_NODE_TYPES.Literal: + case utils_1.AST_NODE_TYPES.ArrayExpression: + case utils_1.AST_NODE_TYPES.ObjectExpression: + case utils_1.AST_NODE_TYPES.FunctionExpression: + case utils_1.AST_NODE_TYPES.ClassExpression: + case utils_1.AST_NODE_TYPES.TemplateLiteral: + case utils_1.AST_NODE_TYPES.JSXElement: + case utils_1.AST_NODE_TYPES.JSXFragment: + // we don't have nodes for these cases + // case SyntaxKind.ParenthesizedExpression: + // case SyntaxKind.OmittedExpression: + return OperatorPrecedence.Primary; + default: + return OperatorPrecedence.Invalid; + } +} +function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) { + switch (nodeKind) { + // A list of comma-separated expressions. This node is only created by transformations. + case typescript_1.SyntaxKind.CommaListExpression: + return OperatorPrecedence.Comma; + case typescript_1.SyntaxKind.SpreadElement: + return OperatorPrecedence.Spread; + case typescript_1.SyntaxKind.YieldExpression: + return OperatorPrecedence.Yield; + case typescript_1.SyntaxKind.ConditionalExpression: + return OperatorPrecedence.Conditional; + case typescript_1.SyntaxKind.BinaryExpression: + switch (operatorKind) { + case typescript_1.SyntaxKind.AmpersandAmpersandEqualsToken: + case typescript_1.SyntaxKind.AmpersandEqualsToken: + case typescript_1.SyntaxKind.AsteriskAsteriskEqualsToken: + case typescript_1.SyntaxKind.AsteriskEqualsToken: + case typescript_1.SyntaxKind.BarBarEqualsToken: + case typescript_1.SyntaxKind.BarEqualsToken: + case typescript_1.SyntaxKind.CaretEqualsToken: + case typescript_1.SyntaxKind.EqualsToken: + case typescript_1.SyntaxKind.GreaterThanGreaterThanEqualsToken: + case typescript_1.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: + case typescript_1.SyntaxKind.LessThanLessThanEqualsToken: + case typescript_1.SyntaxKind.MinusEqualsToken: + case typescript_1.SyntaxKind.PercentEqualsToken: + case typescript_1.SyntaxKind.PlusEqualsToken: + case typescript_1.SyntaxKind.QuestionQuestionEqualsToken: + case typescript_1.SyntaxKind.SlashEqualsToken: + return OperatorPrecedence.Assignment; + case typescript_1.SyntaxKind.CommaToken: + return OperatorPrecedence.Comma; + default: + return getBinaryOperatorPrecedence(operatorKind); + } + // TODO: Should prefix `++` and `--` be moved to the `Update` precedence? + case typescript_1.SyntaxKind.TypeAssertionExpression: + case typescript_1.SyntaxKind.NonNullExpression: + case typescript_1.SyntaxKind.PrefixUnaryExpression: + case typescript_1.SyntaxKind.TypeOfExpression: + case typescript_1.SyntaxKind.VoidExpression: + case typescript_1.SyntaxKind.DeleteExpression: + case typescript_1.SyntaxKind.AwaitExpression: + return OperatorPrecedence.Unary; + case typescript_1.SyntaxKind.PostfixUnaryExpression: + return OperatorPrecedence.Update; + case typescript_1.SyntaxKind.CallExpression: + return OperatorPrecedence.LeftHandSide; + case typescript_1.SyntaxKind.NewExpression: + return hasArguments + ? OperatorPrecedence.Member + : OperatorPrecedence.LeftHandSide; + case typescript_1.SyntaxKind.TaggedTemplateExpression: + case typescript_1.SyntaxKind.PropertyAccessExpression: + case typescript_1.SyntaxKind.ElementAccessExpression: + case typescript_1.SyntaxKind.MetaProperty: + return OperatorPrecedence.Member; + case typescript_1.SyntaxKind.AsExpression: + case typescript_1.SyntaxKind.SatisfiesExpression: + return OperatorPrecedence.Relational; + case typescript_1.SyntaxKind.ThisKeyword: + case typescript_1.SyntaxKind.SuperKeyword: + case typescript_1.SyntaxKind.Identifier: + case typescript_1.SyntaxKind.PrivateIdentifier: + case typescript_1.SyntaxKind.NullKeyword: + case typescript_1.SyntaxKind.TrueKeyword: + case typescript_1.SyntaxKind.FalseKeyword: + case typescript_1.SyntaxKind.NumericLiteral: + case typescript_1.SyntaxKind.BigIntLiteral: + case typescript_1.SyntaxKind.StringLiteral: + case typescript_1.SyntaxKind.ArrayLiteralExpression: + case typescript_1.SyntaxKind.ObjectLiteralExpression: + case typescript_1.SyntaxKind.FunctionExpression: + case typescript_1.SyntaxKind.ArrowFunction: + case typescript_1.SyntaxKind.ClassExpression: + case typescript_1.SyntaxKind.RegularExpressionLiteral: + case typescript_1.SyntaxKind.NoSubstitutionTemplateLiteral: + case typescript_1.SyntaxKind.TemplateExpression: + case typescript_1.SyntaxKind.ParenthesizedExpression: + case typescript_1.SyntaxKind.OmittedExpression: + case typescript_1.SyntaxKind.JsxElement: + case typescript_1.SyntaxKind.JsxSelfClosingElement: + case typescript_1.SyntaxKind.JsxFragment: + return OperatorPrecedence.Primary; + default: + return OperatorPrecedence.Invalid; + } +} +function getBinaryOperatorPrecedence(kind) { + switch (kind) { + case '-': + case '+': + case typescript_1.SyntaxKind.MinusToken: + case typescript_1.SyntaxKind.PlusToken: + return OperatorPrecedence.Additive; + case '!=': + case '!==': + case '==': + case '===': + case typescript_1.SyntaxKind.EqualsEqualsEqualsToken: + case typescript_1.SyntaxKind.EqualsEqualsToken: + case typescript_1.SyntaxKind.ExclamationEqualsEqualsToken: + case typescript_1.SyntaxKind.ExclamationEqualsToken: + return OperatorPrecedence.Equality; + case '??': + case typescript_1.SyntaxKind.QuestionQuestionToken: + return OperatorPrecedence.Coalesce; + case '*': + case '/': + case '%': + case typescript_1.SyntaxKind.AsteriskToken: + case typescript_1.SyntaxKind.PercentToken: + case typescript_1.SyntaxKind.SlashToken: + return OperatorPrecedence.Multiplicative; + case '**': + case typescript_1.SyntaxKind.AsteriskAsteriskToken: + return OperatorPrecedence.Exponentiation; + case '&': + case typescript_1.SyntaxKind.AmpersandToken: + return OperatorPrecedence.BitwiseAND; + case '&&': + case typescript_1.SyntaxKind.AmpersandAmpersandToken: + return OperatorPrecedence.LogicalAND; + case '^': + case typescript_1.SyntaxKind.CaretToken: + return OperatorPrecedence.BitwiseXOR; + case '<': + case '<=': + case '>': + case '>=': + case 'in': + case 'instanceof': + case typescript_1.SyntaxKind.AsKeyword: + case typescript_1.SyntaxKind.GreaterThanEqualsToken: + case typescript_1.SyntaxKind.GreaterThanToken: + case typescript_1.SyntaxKind.InKeyword: + case typescript_1.SyntaxKind.InstanceOfKeyword: + case typescript_1.SyntaxKind.LessThanEqualsToken: + case typescript_1.SyntaxKind.LessThanToken: + // case 'as': -- we don't have a token for this + return OperatorPrecedence.Relational; + case '<<': + case '>>': + case '>>>': + case typescript_1.SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + case typescript_1.SyntaxKind.GreaterThanGreaterThanToken: + case typescript_1.SyntaxKind.LessThanLessThanToken: + return OperatorPrecedence.Shift; + case '|': + case typescript_1.SyntaxKind.BarToken: + return OperatorPrecedence.BitwiseOR; + case '||': + case typescript_1.SyntaxKind.BarBarToken: + return OperatorPrecedence.LogicalOR; + } + // -1 is lower than all other precedences. Returning it will cause binary expression + // parsing to stop. + return -1; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9090e7414642008d80483fffd8e70e5ced596913 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.d.ts @@ -0,0 +1,2 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +export declare function getParentFunctionNode(node: TSESTree.Node): TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | null; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.js new file mode 100644 index 0000000000000000000000000000000000000000..fba2413c1afe370727d242e346e08b76d8a1b5ed --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getParentFunctionNode.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getParentFunctionNode = getParentFunctionNode; +const utils_1 = require("@typescript-eslint/utils"); +function getParentFunctionNode(node) { + let current = node.parent; + while (current) { + if (current.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression || + current.type === utils_1.AST_NODE_TYPES.FunctionDeclaration || + current.type === utils_1.AST_NODE_TYPES.FunctionExpression) { + return current; + } + current = current.parent; + } + // this shouldn't happen in correct code, but someone may attempt to parse bad code + // the parser won't error, so we shouldn't throw here + /* istanbul ignore next */ return null; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b99ed2a93124ac0e1e1b005eb6ea3cbbf1e2acc6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.d.ts @@ -0,0 +1,11 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +/** + * Returns the result of the string conversion applied to the evaluated value of the given expression node, + * if it can be determined statically. + * + * This function returns a `string` value for all `Literal` nodes and simple `TemplateLiteral` nodes only. + * In all other cases, this function returns `null`. + * @param node Expression node. + * @returns String value if it can be determined. Otherwise, `null`. + */ +export declare function getStaticStringValue(node: TSESTree.Node): string | null; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.js new file mode 100644 index 0000000000000000000000000000000000000000..e7ecd11d1b1def8c446f2c30ddc147ada116a398 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStaticStringValue.js @@ -0,0 +1,44 @@ +"use strict"; +// adapted from https://github.com/eslint/eslint/blob/5bdaae205c3a0089ea338b382df59e21d5b06436/lib/rules/utils/ast-utils.js#L191-L230 +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getStaticStringValue = getStaticStringValue; +const utils_1 = require("@typescript-eslint/utils"); +const isNullLiteral_1 = require("./isNullLiteral"); +/** + * Returns the result of the string conversion applied to the evaluated value of the given expression node, + * if it can be determined statically. + * + * This function returns a `string` value for all `Literal` nodes and simple `TemplateLiteral` nodes only. + * In all other cases, this function returns `null`. + * @param node Expression node. + * @returns String value if it can be determined. Otherwise, `null`. + */ +function getStaticStringValue(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.Literal: + // eslint-disable-next-line eqeqeq, @typescript-eslint/internal/eqeq-nullish -- intentional strict comparison for literal value + if (node.value === null) { + if ((0, isNullLiteral_1.isNullLiteral)(node)) { + return String(node.value); // "null" + } + if ('regex' in node) { + return `/${node.regex.pattern}/${node.regex.flags}`; + } + if ('bigint' in node) { + return node.bigint; + } + // Otherwise, this is an unknown literal. The function will return null. + } + else { + return String(node.value); + } + break; + case utils_1.AST_NODE_TYPES.TemplateLiteral: + if (node.expressions.length === 0 && node.quasis.length === 1) { + return node.quasis[0].value.cooked; + } + break; + // no default + } + return null; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4671c266fc7276621714b4fc10f5281845e8c1dd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.d.ts @@ -0,0 +1 @@ +export declare function getStringLength(value: string): number; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.js new file mode 100644 index 0000000000000000000000000000000000000000..57abd1c4ebb964e38e6849ec50d237451a7d5590 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getStringLength.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getStringLength = getStringLength; +let segmenter; +function isASCII(value) { + return /^[\u0020-\u007f]*$/u.test(value); +} +function getStringLength(value) { + if (isASCII(value)) { + return value.length; + } + segmenter ??= new Intl.Segmenter(); + return [...segmenter.segment(value)].length; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..70afed3ff778beefb8e18c145837e2e1274cf8dd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.d.ts @@ -0,0 +1,3 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import type { SourceCode } from '@typescript-eslint/utils/ts-eslint'; +export declare function getTextWithParentheses(sourceCode: Readonly, node: TSESTree.Node): string; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.js new file mode 100644 index 0000000000000000000000000000000000000000..bcdd7d028f8e3ead2d963e646b9eeb395c201bf0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getTextWithParentheses.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTextWithParentheses = getTextWithParentheses; +const _1 = require("."); +function getTextWithParentheses(sourceCode, node) { + // Capture parentheses before and after the node + let beforeCount = 0; + let afterCount = 0; + if ((0, _1.isParenthesized)(node, sourceCode)) { + const bodyOpeningParen = (0, _1.nullThrows)(sourceCode.getTokenBefore(node, _1.isOpeningParenToken), _1.NullThrowsReasons.MissingToken('(', 'node')); + const bodyClosingParen = (0, _1.nullThrows)(sourceCode.getTokenAfter(node, _1.isClosingParenToken), _1.NullThrowsReasons.MissingToken(')', 'node')); + beforeCount = node.range[0] - bodyOpeningParen.range[0]; + afterCount = bodyClosingParen.range[1] - node.range[1]; + } + return sourceCode.getText(node, beforeCount, afterCount); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..344dfc6e571557e44def52ee129c040449c6888f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.d.ts @@ -0,0 +1,2 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +export declare function getThisExpression(node: TSESTree.Node): TSESTree.ThisExpression | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.js new file mode 100644 index 0000000000000000000000000000000000000000..c0beac1488139b4d920652f20a333980acb0fc4e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getThisExpression.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getThisExpression = getThisExpression; +const utils_1 = require("@typescript-eslint/utils"); +function getThisExpression(node) { + while (true) { + if (node.type === utils_1.AST_NODE_TYPES.CallExpression) { + node = node.callee; + } + else if (node.type === utils_1.AST_NODE_TYPES.ThisExpression) { + return node; + } + else if (node.type === utils_1.AST_NODE_TYPES.MemberExpression) { + node = node.object; + } + else if (node.type === utils_1.AST_NODE_TYPES.ChainExpression) { + node = node.expression; + } + else { + break; + } + } + return; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..41ea71a8833c590902a3f70503cdcb7206193640 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.d.ts @@ -0,0 +1,2 @@ +import type * as ts from 'typescript'; +export declare const getValueOfLiteralType: (type: ts.LiteralType) => bigint | number | string; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.js new file mode 100644 index 0000000000000000000000000000000000000000..7d5889b982d0417984dcf0791e2fd71efa4e9572 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getValueOfLiteralType.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getValueOfLiteralType = void 0; +const valueIsPseudoBigInt = (value) => { + return typeof value === 'object'; +}; +const pseudoBigIntToBigInt = (value) => { + return BigInt((value.negative ? '-' : '') + value.base10Value); +}; +const getValueOfLiteralType = (type) => { + if (valueIsPseudoBigInt(type.value)) { + return pseudoBigIntToBigInt(type.value); + } + return type.value; +}; +exports.getValueOfLiteralType = getValueOfLiteralType; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..961de2be5489ce7154326d28874360b16da25b30 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.d.ts @@ -0,0 +1,2 @@ +import type { OperatorPrecedence } from './getOperatorPrecedence'; +export declare function getWrappedCode(text: string, nodePrecedence: OperatorPrecedence, parentPrecedence: OperatorPrecedence): string; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.js new file mode 100644 index 0000000000000000000000000000000000000000..e098b8c96071f0ff47affc3f5e8c6561343b2554 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappedCode.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getWrappedCode = getWrappedCode; +function getWrappedCode(text, nodePrecedence, parentPrecedence) { + return nodePrecedence > parentPrecedence ? text : `(${text})`; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40943df714a91eb1178138c94c7c2fc95504c8e7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.d.ts @@ -0,0 +1,42 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +interface WrappingFixerParams { + /** + * Descendant of `node` we want to preserve. + * Use this to replace some code with another. + * By default it's the node we are modifying (so nothing is removed). + * You can pass multiple nodes as an array. + */ + innerNode?: TSESTree.Node | TSESTree.Node[]; + /** The node we want to modify. */ + node: TSESTree.Node; + /** Source code. */ + sourceCode: Readonly; + /** + * The function which gets the code of the `innerNode` and returns some code around it. + * Receives multiple arguments if there are multiple innerNodes. + * E.g. ``code => `${code} != null` `` + */ + wrap?: (...code: string[]) => string; +} +/** + * Wraps node with some code. Adds parentheses as necessary. + * @returns Fixer which adds the specified code and parens if necessary. + */ +export declare function getWrappingFixer(params: WrappingFixerParams): (fixer: TSESLint.RuleFixer) => TSESLint.RuleFix; +/** + * If the node to be moved and the destination node require parentheses, include parentheses in the node to be moved. + * @param sourceCode Source code of current file + * @param nodeToMove Nodes that need to be moved + * @param destinationNode Final destination node with nodeToMove + * @returns If parentheses are required, code for the nodeToMove node is returned with parentheses at both ends of the code. + */ +export declare function getMovedNodeCode(params: { + destinationNode: TSESTree.Node; + nodeToMove: TSESTree.Node; + sourceCode: Readonly; +}): string; +/** + * Check if a node will always have the same precedence if its parent changes. + */ +export declare function isStrongPrecedenceNode(innerNode: TSESTree.Node): boolean; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.js new file mode 100644 index 0000000000000000000000000000000000000000..68b2c768564a987d7b08f48f28c15808eaf4a7c1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/getWrappingFixer.js @@ -0,0 +1,184 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getWrappingFixer = getWrappingFixer; +exports.getMovedNodeCode = getMovedNodeCode; +exports.isStrongPrecedenceNode = isStrongPrecedenceNode; +const utils_1 = require("@typescript-eslint/utils"); +/** + * Wraps node with some code. Adds parentheses as necessary. + * @returns Fixer which adds the specified code and parens if necessary. + */ +function getWrappingFixer(params) { + const { node, innerNode = node, sourceCode, wrap } = params; + const innerNodes = Array.isArray(innerNode) ? innerNode : [innerNode]; + return (fixer) => { + const innerCodes = innerNodes.map(innerNode => { + let code = sourceCode.getText(innerNode); + /** + * Wrap our node in parens to prevent the following cases: + * - It has a weaker precedence than the code we are wrapping it in + * - It's gotten mistaken as block statement instead of object expression + */ + if (!isStrongPrecedenceNode(innerNode) || + isObjectExpressionInOneLineReturn(node, innerNode)) { + code = `(${code})`; + } + return code; + }); + if (!wrap) { + return fixer.replaceText(node, innerCodes.join('')); + } + // do the wrapping + let code = wrap(...innerCodes); + // check the outer expression's precedence + if (isWeakPrecedenceParent(node) && + // we wrapped the node in some expression which very likely has a different precedence than original wrapped node + // let's wrap the whole expression in parens just in case + !utils_1.ASTUtils.isParenthesized(node, sourceCode)) { + code = `(${code})`; + } + // check if we need to insert semicolon + if (/^[`([]/.test(code) && isMissingSemicolonBefore(node, sourceCode)) { + code = `;${code}`; + } + return fixer.replaceText(node, code); + }; +} +/** + * If the node to be moved and the destination node require parentheses, include parentheses in the node to be moved. + * @param sourceCode Source code of current file + * @param nodeToMove Nodes that need to be moved + * @param destinationNode Final destination node with nodeToMove + * @returns If parentheses are required, code for the nodeToMove node is returned with parentheses at both ends of the code. + */ +function getMovedNodeCode(params) { + const { destinationNode, nodeToMove: existingNode, sourceCode } = params; + const code = sourceCode.getText(existingNode); + if (isStrongPrecedenceNode(existingNode)) { + // Moved node never needs parens + return code; + } + if (!isWeakPrecedenceParent(destinationNode)) { + // Destination would never needs parens, regardless what node moves there + return code; + } + // Parens may be necessary + return `(${code})`; +} +/** + * Check if a node will always have the same precedence if its parent changes. + */ +function isStrongPrecedenceNode(innerNode) { + return (innerNode.type === utils_1.AST_NODE_TYPES.Literal || + innerNode.type === utils_1.AST_NODE_TYPES.Identifier || + innerNode.type === utils_1.AST_NODE_TYPES.TSTypeReference || + innerNode.type === utils_1.AST_NODE_TYPES.TSTypeOperator || + innerNode.type === utils_1.AST_NODE_TYPES.ArrayExpression || + innerNode.type === utils_1.AST_NODE_TYPES.ObjectExpression || + innerNode.type === utils_1.AST_NODE_TYPES.MemberExpression || + innerNode.type === utils_1.AST_NODE_TYPES.CallExpression || + innerNode.type === utils_1.AST_NODE_TYPES.NewExpression || + innerNode.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression || + innerNode.type === utils_1.AST_NODE_TYPES.TSInstantiationExpression); +} +/** + * Check if a node's parent could have different precedence if the node changes. + */ +function isWeakPrecedenceParent(node) { + const parent = node.parent; + if (!parent) { + return false; + } + if (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression || + parent.type === utils_1.AST_NODE_TYPES.UnaryExpression || + parent.type === utils_1.AST_NODE_TYPES.BinaryExpression || + parent.type === utils_1.AST_NODE_TYPES.LogicalExpression || + parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression || + parent.type === utils_1.AST_NODE_TYPES.AwaitExpression) { + return true; + } + if (parent.type === utils_1.AST_NODE_TYPES.MemberExpression && + parent.object === node) { + return true; + } + if ((parent.type === utils_1.AST_NODE_TYPES.CallExpression || + parent.type === utils_1.AST_NODE_TYPES.NewExpression) && + parent.callee === node) { + return true; + } + if (parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression && + parent.tag === node) { + return true; + } + return false; +} +/** + * Returns true if a node is at the beginning of expression statement and the statement above doesn't end with semicolon. + * Doesn't check if the node begins with `(`, `[` or `` ` ``. + */ +function isMissingSemicolonBefore(node, sourceCode) { + for (;;) { + // https://github.com/typescript-eslint/typescript-eslint/issues/6225 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const parent = node.parent; + if (parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + const block = parent.parent; + if (block.type === utils_1.AST_NODE_TYPES.Program || + block.type === utils_1.AST_NODE_TYPES.BlockStatement) { + // parent is an expression statement in a block + const statementIndex = block.body.indexOf(parent); + const previousStatement = block.body[statementIndex - 1]; + if (statementIndex > 0 && + utils_1.ESLintUtils.nullThrows(sourceCode.getLastToken(previousStatement), 'Mismatched semicolon and block').value !== ';') { + return true; + } + } + } + if (!isLeftHandSide(node)) { + return false; + } + node = parent; + } +} +/** + * Checks if a node is LHS of an operator. + */ +function isLeftHandSide(node) { + // https://github.com/typescript-eslint/typescript-eslint/issues/6225 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const parent = node.parent; + // a++ + if (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression) { + return true; + } + // a + b + if ((parent.type === utils_1.AST_NODE_TYPES.BinaryExpression || + parent.type === utils_1.AST_NODE_TYPES.LogicalExpression || + parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression) && + node === parent.left) { + return true; + } + // a ? b : c + if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression && + node === parent.test) { + return true; + } + // a(b) + if (parent.type === utils_1.AST_NODE_TYPES.CallExpression && node === parent.callee) { + return true; + } + // a`b` + if (parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression && + node === parent.tag) { + return true; + } + return false; +} +/** + * Checks if a node's parent is arrow function expression and a inner node is object expression + */ +function isObjectExpressionInOneLineReturn(node, innerNode) { + return (node.parent?.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression && + node.parent.body === node && + innerNode.type === utils_1.AST_NODE_TYPES.ObjectExpression); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..00b44bafe910f542ca9fe237669d717108625e32 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.d.ts @@ -0,0 +1,6 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import type { RuleContext } from '@typescript-eslint/utils/ts-eslint'; +/** + * @return `true` if the function or method node has overload signatures. + */ +export declare function hasOverloadSignatures(node: TSESTree.FunctionDeclaration | TSESTree.MethodDefinition, context: RuleContext): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.js new file mode 100644 index 0000000000000000000000000000000000000000..02117662725037ffa7180bb1357c82b2d1d9ebe7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/hasOverloadSignatures.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasOverloadSignatures = hasOverloadSignatures; +const utils_1 = require("@typescript-eslint/utils"); +const misc_1 = require("./misc"); +/** + * @return `true` if the function or method node has overload signatures. + */ +function hasOverloadSignatures(node, context) { + // `export default function () {}` + if (node.parent.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration) { + return node.parent.parent.body.some(member => { + return (member.type === utils_1.AST_NODE_TYPES.ExportDefaultDeclaration && + member.declaration.type === utils_1.AST_NODE_TYPES.TSDeclareFunction); + }); + } + // `export function f() {}` + if (node.parent.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration) { + return node.parent.parent.body.some(member => { + return (member.type === utils_1.AST_NODE_TYPES.ExportNamedDeclaration && + member.declaration?.type === utils_1.AST_NODE_TYPES.TSDeclareFunction && + getFunctionDeclarationName(member.declaration, context) === + getFunctionDeclarationName(node, context)); + }); + } + // either: + // - `function f() {}` + // - `class T { foo() {} }` + const nodeKey = getFunctionDeclarationName(node, context); + return node.parent.body.some(member => { + return ((member.type === utils_1.AST_NODE_TYPES.TSDeclareFunction || + (member.type === utils_1.AST_NODE_TYPES.MethodDefinition && + member.value.body == null)) && + nodeKey === getFunctionDeclarationName(member, context)); + }); +} +function getFunctionDeclarationName(node, context) { + if (node.type === utils_1.AST_NODE_TYPES.FunctionDeclaration || + node.type === utils_1.AST_NODE_TYPES.TSDeclareFunction) { + // For a `FunctionDeclaration` or `TSDeclareFunction` this may be `null` if + // and only if the parent is an `ExportDefaultDeclaration`. + // + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return node.id.name; + } + return (0, misc_1.getStaticMemberAccessValue)(node, context); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7567afd5db4d1f4c8df07ad970ee8dd00cddd469 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.d.ts @@ -0,0 +1,40 @@ +import { ESLintUtils } from '@typescript-eslint/utils'; +export * from './astUtils'; +export * from './baseTypeUtils'; +export * from './collectUnusedVariables'; +export * from './createRule'; +export * from './getBaseTypesOfClassMember'; +export * from './getFixOrSuggest'; +export * from './getFunctionHeadLoc'; +export * from './getOperatorPrecedence'; +export * from './getStaticStringValue'; +export * from './getStringLength'; +export * from './getTextWithParentheses'; +export * from './getThisExpression'; +export * from './getWrappingFixer'; +export * from './hasOverloadSignatures'; +export * from './isArrayMethodCallWithPredicate'; +export * from './isAssignee'; +export * from './isNodeEqual'; +export * from './isNullLiteral'; +export * from './isStartOfExpressionStatement'; +export * from './isUndefinedIdentifier'; +export * from './misc'; +export * from './needsPrecedingSemiColon'; +export * from './objectIterators'; +export * from './needsToBeAwaited'; +export * from './scopeUtils'; +export * from './types'; +export * from './getConstraintInfo'; +export * from './getValueOfLiteralType'; +export * from './isHigherPrecedenceThanAwait'; +export * from './skipChainExpression'; +export * from './truthinessUtils'; +export * from './walkStatements'; +export * from '@typescript-eslint/type-utils'; +export declare const applyDefault: typeof ESLintUtils.applyDefault, deepMerge: typeof ESLintUtils.deepMerge, getParserServices: typeof ESLintUtils.getParserServices, isObjectNotArray: typeof ESLintUtils.isObjectNotArray, nullThrows: typeof ESLintUtils.nullThrows, NullThrowsReasons: { + readonly MissingParent: "Expected node to have a parent."; + readonly MissingToken: (token: string, thing: string) => string; +}; +export type InferMessageIdsTypeFromRule = ESLintUtils.InferMessageIdsTypeFromRule; +export type InferOptionsTypeFromRule = ESLintUtils.InferOptionsTypeFromRule; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js new file mode 100644 index 0000000000000000000000000000000000000000..90fdea0f1d571a697f5f0b2009a86e4e0fae533d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/index.js @@ -0,0 +1,53 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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.NullThrowsReasons = exports.nullThrows = exports.isObjectNotArray = exports.getParserServices = exports.deepMerge = exports.applyDefault = void 0; +const utils_1 = require("@typescript-eslint/utils"); +__exportStar(require("./astUtils"), exports); +__exportStar(require("./baseTypeUtils"), exports); +__exportStar(require("./collectUnusedVariables"), exports); +__exportStar(require("./createRule"), exports); +__exportStar(require("./getBaseTypesOfClassMember"), exports); +__exportStar(require("./getFixOrSuggest"), exports); +__exportStar(require("./getFunctionHeadLoc"), exports); +__exportStar(require("./getOperatorPrecedence"), exports); +__exportStar(require("./getStaticStringValue"), exports); +__exportStar(require("./getStringLength"), exports); +__exportStar(require("./getTextWithParentheses"), exports); +__exportStar(require("./getThisExpression"), exports); +__exportStar(require("./getWrappingFixer"), exports); +__exportStar(require("./hasOverloadSignatures"), exports); +__exportStar(require("./isArrayMethodCallWithPredicate"), exports); +__exportStar(require("./isAssignee"), exports); +__exportStar(require("./isNodeEqual"), exports); +__exportStar(require("./isNullLiteral"), exports); +__exportStar(require("./isStartOfExpressionStatement"), exports); +__exportStar(require("./isUndefinedIdentifier"), exports); +__exportStar(require("./misc"), exports); +__exportStar(require("./needsPrecedingSemiColon"), exports); +__exportStar(require("./objectIterators"), exports); +__exportStar(require("./needsToBeAwaited"), exports); +__exportStar(require("./scopeUtils"), exports); +__exportStar(require("./types"), exports); +__exportStar(require("./getConstraintInfo"), exports); +__exportStar(require("./getValueOfLiteralType"), exports); +__exportStar(require("./isHigherPrecedenceThanAwait"), exports); +__exportStar(require("./skipChainExpression"), exports); +__exportStar(require("./truthinessUtils"), exports); +__exportStar(require("./walkStatements"), exports); +// this is done for convenience - saves migrating all of the old rules +__exportStar(require("@typescript-eslint/type-utils"), exports); +exports.applyDefault = utils_1.ESLintUtils.applyDefault, exports.deepMerge = utils_1.ESLintUtils.deepMerge, exports.getParserServices = utils_1.ESLintUtils.getParserServices, exports.isObjectNotArray = utils_1.ESLintUtils.isObjectNotArray, exports.nullThrows = utils_1.ESLintUtils.nullThrows, exports.NullThrowsReasons = utils_1.ESLintUtils.NullThrowsReasons; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9da8ac48a63747fa79cb958e0df19575d5af9040 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.d.ts @@ -0,0 +1,3 @@ +import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils'; +import type { RuleContext } from '@typescript-eslint/utils/ts-eslint'; +export declare function isArrayMethodCallWithPredicate(context: RuleContext, services: ParserServicesWithTypeInformation, node: TSESTree.CallExpression): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.js new file mode 100644 index 0000000000000000000000000000000000000000..12d7f96dfc9dff8b0a7e5216651340d03f099d39 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isArrayMethodCallWithPredicate.js @@ -0,0 +1,64 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isArrayMethodCallWithPredicate = isArrayMethodCallWithPredicate; +const type_utils_1 = require("@typescript-eslint/type-utils"); +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const misc_1 = require("./misc"); +const ARRAY_PREDICATE_FUNCTIONS = new Set([ + 'every', + 'filter', + 'find', + 'findIndex', + 'findLast', + 'findLastIndex', + 'some', +]); +function isArrayMethodCallWithPredicate(context, services, node) { + if (node.callee.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return false; + } + const staticAccessValue = (0, misc_1.getStaticMemberAccessValue)(node.callee, context); + if (!ARRAY_PREDICATE_FUNCTIONS.has(staticAccessValue)) { + return false; + } + const checker = services.program.getTypeChecker(); + const type = (0, type_utils_1.getConstrainedTypeAtLocation)(services, node.callee.object); + return tsutils + .unionConstituents(type) + .flatMap(part => tsutils.intersectionConstituents(part)) + .some(t => checker.isArrayType(t) || checker.isTupleType(t)); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4f943e6d6fe57fafb7a12b07403e75df33d7395b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.d.ts @@ -0,0 +1,2 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +export declare function isAssignee(node: TSESTree.Node): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.js new file mode 100644 index 0000000000000000000000000000000000000000..8707f7bff4506ea51bcfb2d66bf750508a14fd69 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isAssignee.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isAssignee = isAssignee; +const utils_1 = require("@typescript-eslint/utils"); +function isAssignee(node) { + const parent = node.parent; + if (!parent) { + return false; + } + // a[i] = 1, a[i] += 1, etc. + if (parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression && + parent.left === node) { + return true; + } + // delete a[i] + if (parent.type === utils_1.AST_NODE_TYPES.UnaryExpression && + parent.operator === 'delete' && + parent.argument === node) { + return true; + } + // a[i]++, --a[i], etc. + if (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression && + parent.argument === node) { + return true; + } + // [a[i]] = [0] + if (parent.type === utils_1.AST_NODE_TYPES.ArrayPattern) { + return true; + } + // [...a[i]] = [0] + if (parent.type === utils_1.AST_NODE_TYPES.RestElement) { + return true; + } + // ({ foo: a[i] }) = { foo: 0 } + if (parent.type === utils_1.AST_NODE_TYPES.Property && + parent.value === node && + parent.parent.type === utils_1.AST_NODE_TYPES.ObjectExpression && + isAssignee(parent.parent)) { + return true; + } + // (a[i] as number)++, [...a[i]!] = [0], etc. + if ((parent.type === utils_1.AST_NODE_TYPES.TSNonNullExpression || + parent.type === utils_1.AST_NODE_TYPES.TSAsExpression || + parent.type === utils_1.AST_NODE_TYPES.TSTypeAssertion || + parent.type === utils_1.AST_NODE_TYPES.TSSatisfiesExpression) && + isAssignee(parent)) { + return true; + } + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..817410a2eb6f9720e4a2fdcc1544a0cd78315373 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.d.ts @@ -0,0 +1,2 @@ +import * as ts from 'typescript'; +export declare function isHigherPrecedenceThanAwait(tsNode: ts.Node): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.js new file mode 100644 index 0000000000000000000000000000000000000000..a2e7dc4088e3e3cc0b5dc73424acfaac918246a4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isHigherPrecedenceThanAwait.js @@ -0,0 +1,46 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isHigherPrecedenceThanAwait = isHigherPrecedenceThanAwait; +const ts = __importStar(require("typescript")); +const getOperatorPrecedence_1 = require("./getOperatorPrecedence"); +function isHigherPrecedenceThanAwait(tsNode) { + const operator = ts.isBinaryExpression(tsNode) + ? tsNode.operatorToken.kind + : ts.SyntaxKind.Unknown; + const nodePrecedence = (0, getOperatorPrecedence_1.getOperatorPrecedence)(tsNode.kind, operator); + const awaitPrecedence = (0, getOperatorPrecedence_1.getOperatorPrecedence)(ts.SyntaxKind.AwaitExpression, ts.SyntaxKind.Unknown); + return nodePrecedence > awaitPrecedence; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5b46a7d1dfcc8e02b19ca8e6466a39d3f336bda8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.d.ts @@ -0,0 +1,2 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +export declare function isNodeEqual(a: TSESTree.Node, b: TSESTree.Node): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js new file mode 100644 index 0000000000000000000000000000000000000000..3f98024285500ecf658d7226d96f81ee68c8c735 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNodeEqual.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isNodeEqual = isNodeEqual; +const utils_1 = require("@typescript-eslint/utils"); +function isNodeEqual(a, b) { + if (a.type !== b.type) { + return false; + } + if (a.type === utils_1.AST_NODE_TYPES.ThisExpression && + b.type === utils_1.AST_NODE_TYPES.ThisExpression) { + return true; + } + if (a.type === utils_1.AST_NODE_TYPES.Literal && b.type === utils_1.AST_NODE_TYPES.Literal) { + return a.value === b.value; + } + if (a.type === utils_1.AST_NODE_TYPES.Identifier && + b.type === utils_1.AST_NODE_TYPES.Identifier) { + return a.name === b.name; + } + if (a.type === utils_1.AST_NODE_TYPES.MemberExpression && + b.type === utils_1.AST_NODE_TYPES.MemberExpression) { + return (isNodeEqual(a.property, b.property) && isNodeEqual(a.object, b.object)); + } + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2d5aa85f5560339dc88f4a65f39174237515a4fe --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.d.ts @@ -0,0 +1,2 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +export declare function isNullLiteral(i: TSESTree.Node): i is TSESTree.NullLiteral; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js new file mode 100644 index 0000000000000000000000000000000000000000..e9a7921cbfb09109e6e30b7231013c3ffb8da1b5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isNullLiteral.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isNullLiteral = isNullLiteral; +const utils_1 = require("@typescript-eslint/utils"); +function isNullLiteral(i) { + return i.type === utils_1.AST_NODE_TYPES.Literal && i.value == null; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isPromiseAggregatorMethod.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isPromiseAggregatorMethod.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..590cc10daf2d70b7f2cc6c484fc0eb76930d3085 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isPromiseAggregatorMethod.d.ts @@ -0,0 +1,3 @@ +import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/utils'; +import type { RuleContext } from '@typescript-eslint/utils/ts-eslint'; +export declare function isPromiseAggregatorMethod(context: RuleContext, services: ParserServicesWithTypeInformation, node: TSESTree.CallExpression): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isPromiseAggregatorMethod.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isPromiseAggregatorMethod.js new file mode 100644 index 0000000000000000000000000000000000000000..1f67aabd6976b091505b35237d2c0d2ee02e7ac4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isPromiseAggregatorMethod.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isPromiseAggregatorMethod = isPromiseAggregatorMethod; +const type_utils_1 = require("@typescript-eslint/type-utils"); +const utils_1 = require("@typescript-eslint/utils"); +const misc_1 = require("./misc"); +const PROMISE_CONSTRUCTOR_ARRAY_METHODS = new Set([ + 'all', + 'allSettled', + 'race', + 'any', +]); +function isPromiseAggregatorMethod(context, services, node) { + if (node.callee.type !== utils_1.AST_NODE_TYPES.MemberExpression) { + return false; + } + const staticAccessValue = (0, misc_1.getStaticMemberAccessValue)(node.callee, context); + if (!PROMISE_CONSTRUCTOR_ARRAY_METHODS.has(staticAccessValue)) { + return false; + } + return (0, type_utils_1.isPromiseConstructorLike)(services.program, (0, type_utils_1.getConstrainedTypeAtLocation)(services, node.callee.object)); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9dd3560035cccdb433009bcf50f309d2c40a6627 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.d.ts @@ -0,0 +1,7 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +/** + * Tests if a node appears at the beginning of an ancestor ExpressionStatement node. + * @param node The node to check. + * @returns Whether the node appears at the beginning of an ancestor ExpressionStatement node. + */ +export declare function isStartOfExpressionStatement(node: TSESTree.Node): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.js new file mode 100644 index 0000000000000000000000000000000000000000..cdaf7e596ea4e6df8ce56c72f7cb0e7d3ffd699e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isStartOfExpressionStatement.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isStartOfExpressionStatement = isStartOfExpressionStatement; +const utils_1 = require("@typescript-eslint/utils"); +// The following is copied from `eslint`'s source code. +// https://github.com/eslint/eslint/blob/3a4eaf921543b1cd5d1df4ea9dec02fab396af2a/lib/rules/utils/ast-utils.js#L1026-L1041 +// Could be export { isStartOfExpressionStatement } from 'eslint/lib/rules/utils/ast-utils' +/** + * Tests if a node appears at the beginning of an ancestor ExpressionStatement node. + * @param node The node to check. + * @returns Whether the node appears at the beginning of an ancestor ExpressionStatement node. + */ +function isStartOfExpressionStatement(node) { + const start = node.range[0]; + let ancestor = node; + while ((ancestor = ancestor.parent) && ancestor.range[0] === start) { + if (ancestor.type === utils_1.AST_NODE_TYPES.ExpressionStatement) { + return true; + } + } + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a5addcd37090bbac1891e87b3f277b045db12e1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.d.ts @@ -0,0 +1,12 @@ +import type { Definition, ImportBindingDefinition } from '@typescript-eslint/scope-manager'; +/** + * Determine whether a variable definition is a type import. e.g.: + * + * ```ts + * import type { Foo } from 'foo'; + * import { type Bar } from 'bar'; + * ``` + * + * @param definition - The variable definition to check. + */ +export declare function isTypeImport(definition?: Definition): definition is ImportBindingDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.js new file mode 100644 index 0000000000000000000000000000000000000000..1baae10b7f9b4227b147e4424d9fb962056ca3d2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isTypeImport.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isTypeImport = isTypeImport; +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const utils_1 = require("@typescript-eslint/utils"); +/** + * Determine whether a variable definition is a type import. e.g.: + * + * ```ts + * import type { Foo } from 'foo'; + * import { type Bar } from 'bar'; + * ``` + * + * @param definition - The variable definition to check. + */ +function isTypeImport(definition) { + return (definition?.type === scope_manager_1.DefinitionType.ImportBinding && + (definition.parent.importKind === 'type' || + (definition.node.type === utils_1.AST_NODE_TYPES.ImportSpecifier && + definition.node.importKind === 'type'))); +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eb4d9ecf86d6942ab995eb8e7434c9f35f33a728 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.d.ts @@ -0,0 +1,2 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +export declare function isUndefinedIdentifier(i: TSESTree.Node): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js new file mode 100644 index 0000000000000000000000000000000000000000..e43bf372076a78e82f8b8774b391b91b7bbea93e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/isUndefinedIdentifier.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isUndefinedIdentifier = isUndefinedIdentifier; +const utils_1 = require("@typescript-eslint/utils"); +function isUndefinedIdentifier(i) { + return i.type === utils_1.AST_NODE_TYPES.Identifier && i.name === 'undefined'; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1d68d275d2c859a4511f67cb2c2b08f43637565 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.d.ts @@ -0,0 +1,115 @@ +/** + * @fileoverview Really small utility functions that didn't deserve their own files + */ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { RuleContext } from '@typescript-eslint/utils/ts-eslint'; +import * as ts from 'typescript'; +/** + * Check if the context file name is *.d.ts or *.d.tsx + */ +export declare function isDefinitionFile(fileName: string): boolean; +/** + * Upper cases the first character or the string + */ +export declare function upperCaseFirst(str: string): string; +export declare function arrayGroupByToMap(array: T[], getKey: (item: T) => Key): Map; +/** Return true if both parameters are equal. */ +export type Equal = (a: T, b: T) => boolean; +export declare function arraysAreEqual(a: T[] | undefined, b: T[] | undefined, eq: (a: T, b: T) => boolean): boolean; +/** Returns the first non-`undefined` result. */ +export declare function findFirstResult(inputs: T[], getResult: (t: T) => U | undefined): U | undefined; +/** + * Gets a string representation of the name of the index signature. + */ +export declare function getNameFromIndexSignature(node: TSESTree.TSIndexSignature): string; +export declare enum MemberNameType { + Private = 1, + Quoted = 2, + Normal = 3, + Expression = 4 +} +/** + * Gets a string name representation of the name of the given MethodDefinition + * or PropertyDefinition node, with handling for computed property names. + */ +export declare function getNameFromMember(member: TSESTree.AccessorProperty | TSESTree.MethodDefinition | TSESTree.Property | TSESTree.PropertyDefinition | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractMethodDefinition | TSESTree.TSAbstractPropertyDefinition | TSESTree.TSMethodSignature | TSESTree.TSPropertySignature, sourceCode: TSESLint.SourceCode): { + name: string; + type: MemberNameType; +}; +export type ExcludeKeys, Keys extends keyof Obj> = { + [k in Exclude]: Obj[k]; +}; +export type RequireKeys, Keys extends keyof Obj> = { + [k in Keys]-?: Exclude; +} & ExcludeKeys; +export declare function getEnumNames(myEnum: Record): T[]; +/** + * Given an array of words, returns an English-friendly concatenation, separated with commas, with + * the `and` clause inserted before the last item. + * + * Example: ['foo', 'bar', 'baz' ] returns the string "foo, bar, and baz". + */ +export declare function formatWordList(words: string[]): string; +/** + * Iterates the array in reverse and returns the index of the first element it + * finds which passes the predicate function. + * + * @returns Returns the index of the element if it finds it or -1 otherwise. + */ +export declare function findLastIndex(members: T[], predicate: (member: T) => boolean | null | undefined): number; +export declare function typeNodeRequiresParentheses(node: TSESTree.TypeNode, text: string): boolean; +export declare function isRestParameterDeclaration(decl: ts.Declaration): boolean; +export declare function isParenlessArrowFunction(node: TSESTree.ArrowFunctionExpression, sourceCode: TSESLint.SourceCode): boolean; +export type NodeWithKey = TSESTree.AccessorProperty | TSESTree.MemberExpression | TSESTree.MethodDefinition | TSESTree.Property | TSESTree.PropertyDefinition | TSESTree.TSAbstractMethodDefinition | TSESTree.TSAbstractPropertyDefinition; +/** + * Gets a member being accessed or declared if its value can be determined statically, and + * resolves it to the string or symbol value that will be used as the actual member + * access key at runtime. Otherwise, returns `undefined`. + * + * ```ts + * x.member // returns 'member' + * ^^^^^^^^ + * + * x?.member // returns 'member' (optional chaining is treated the same) + * ^^^^^^^^^ + * + * x['value'] // returns 'value' + * ^^^^^^^^^^ + * + * x[Math.random()] // returns undefined (not a static value) + * ^^^^^^^^^^^^^^^^ + * + * arr[0] // returns '0' (NOT 0) + * ^^^^^^ + * + * arr[0n] // returns '0' (NOT 0n) + * ^^^^^^^ + * + * const s = Symbol.for('symbolName') + * x[s] // returns `Symbol.for('symbolName')` (since it's a static/global symbol) + * ^^^^ + * + * const us = Symbol('symbolName') + * x[us] // returns undefined (since it's a unique symbol, so not statically analyzable) + * ^^^^^ + * + * var object = { + * 1234: '4567', // returns '1234' (NOT 1234) + * ^^^^^^^^^^^^ + * method() { } // returns 'method' + * ^^^^^^^^^^^^ + * } + * + * class WithMembers { + * foo: string // returns 'foo' + * ^^^^^^^^^^^ + * } + * ``` + */ +export declare function getStaticMemberAccessValue(node: NodeWithKey, { sourceCode }: RuleContext): string | symbol | undefined; +/** + * Answers whether the member expression looks like + * `x.value`, `x['value']`, + * or even `const v = 'value'; x[v]` (or optional variants thereof). + */ +export declare const isStaticMemberAccessOfValue: (memberExpression: NodeWithKey, context: RuleContext, ...values: (string | symbol)[]) => boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js new file mode 100644 index 0000000000000000000000000000000000000000..3de454943d4e06cc94e4f6a04c4e51942e281db4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/misc.js @@ -0,0 +1,270 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isStaticMemberAccessOfValue = exports.MemberNameType = void 0; +exports.isDefinitionFile = isDefinitionFile; +exports.upperCaseFirst = upperCaseFirst; +exports.arrayGroupByToMap = arrayGroupByToMap; +exports.arraysAreEqual = arraysAreEqual; +exports.findFirstResult = findFirstResult; +exports.getNameFromIndexSignature = getNameFromIndexSignature; +exports.getNameFromMember = getNameFromMember; +exports.getEnumNames = getEnumNames; +exports.formatWordList = formatWordList; +exports.findLastIndex = findLastIndex; +exports.typeNodeRequiresParentheses = typeNodeRequiresParentheses; +exports.isRestParameterDeclaration = isRestParameterDeclaration; +exports.isParenlessArrowFunction = isParenlessArrowFunction; +exports.getStaticMemberAccessValue = getStaticMemberAccessValue; +const type_utils_1 = require("@typescript-eslint/type-utils"); +const utils_1 = require("@typescript-eslint/utils"); +const ts = __importStar(require("typescript")); +const astUtils_1 = require("./astUtils"); +const DEFINITION_EXTENSIONS = [ + ts.Extension.Dts, + ts.Extension.Dcts, + ts.Extension.Dmts, +]; +/** + * Check if the context file name is *.d.ts or *.d.tsx + */ +function isDefinitionFile(fileName) { + const lowerFileName = fileName.toLowerCase(); + for (const definitionExt of DEFINITION_EXTENSIONS) { + if (lowerFileName.endsWith(definitionExt)) { + return true; + } + } + return /\.d\.(ts|cts|mts|.*\.ts)$/.test(lowerFileName); +} +/** + * Upper cases the first character or the string + */ +function upperCaseFirst(str) { + return str[0].toUpperCase() + str.slice(1); +} +function arrayGroupByToMap(array, getKey) { + const groups = new Map(); + for (const item of array) { + const key = getKey(item); + const existing = groups.get(key); + if (existing) { + existing.push(item); + } + else { + groups.set(key, [item]); + } + } + return groups; +} +function arraysAreEqual(a, b, eq) { + return (a === b || + (a != null && a.length === b?.length && a.every((x, idx) => eq(x, b[idx])))); +} +/** Returns the first non-`undefined` result. */ +function findFirstResult(inputs, getResult) { + for (const element of inputs) { + const result = getResult(element); + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + if (result !== undefined) { + return result; + } + } + return undefined; +} +/** + * Gets a string representation of the name of the index signature. + */ +function getNameFromIndexSignature(node) { + const propName = node.parameters.find((parameter) => parameter.type === utils_1.AST_NODE_TYPES.Identifier); + return propName ? propName.name : '(index signature)'; +} +var MemberNameType; +(function (MemberNameType) { + MemberNameType[MemberNameType["Private"] = 1] = "Private"; + MemberNameType[MemberNameType["Quoted"] = 2] = "Quoted"; + MemberNameType[MemberNameType["Normal"] = 3] = "Normal"; + MemberNameType[MemberNameType["Expression"] = 4] = "Expression"; +})(MemberNameType || (exports.MemberNameType = MemberNameType = {})); +/** + * Gets a string name representation of the name of the given MethodDefinition + * or PropertyDefinition node, with handling for computed property names. + */ +function getNameFromMember(member, sourceCode) { + if (member.key.type === utils_1.AST_NODE_TYPES.Identifier) { + return { + name: member.key.name, + type: MemberNameType.Normal, + }; + } + if (member.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) { + return { + name: `#${member.key.name}`, + type: MemberNameType.Private, + }; + } + if (member.key.type === utils_1.AST_NODE_TYPES.Literal) { + const name = `${member.key.value}`; + if ((0, type_utils_1.requiresQuoting)(name)) { + return { + name: `"${name}"`, + type: MemberNameType.Quoted, + }; + } + return { + name, + type: MemberNameType.Normal, + }; + } + return { + name: sourceCode.text.slice(...member.key.range), + type: MemberNameType.Expression, + }; +} +function getEnumNames(myEnum) { + return Object.keys(myEnum).filter(x => isNaN(Number(x))); +} +/** + * Given an array of words, returns an English-friendly concatenation, separated with commas, with + * the `and` clause inserted before the last item. + * + * Example: ['foo', 'bar', 'baz' ] returns the string "foo, bar, and baz". + */ +function formatWordList(words) { + if (!words.length) { + return ''; + } + if (words.length === 1) { + return words[0]; + } + return [words.slice(0, -1).join(', '), words.slice(-1)[0]].join(' and '); +} +/** + * Iterates the array in reverse and returns the index of the first element it + * finds which passes the predicate function. + * + * @returns Returns the index of the element if it finds it or -1 otherwise. + */ +function findLastIndex(members, predicate) { + let idx = members.length - 1; + while (idx >= 0) { + const valid = predicate(members[idx]); + if (valid) { + return idx; + } + idx--; + } + return -1; +} +function typeNodeRequiresParentheses(node, text) { + return (node.type === utils_1.AST_NODE_TYPES.TSFunctionType || + node.type === utils_1.AST_NODE_TYPES.TSConstructorType || + node.type === utils_1.AST_NODE_TYPES.TSConditionalType || + (node.type === utils_1.AST_NODE_TYPES.TSUnionType && text.startsWith('|')) || + (node.type === utils_1.AST_NODE_TYPES.TSIntersectionType && text.startsWith('&'))); +} +function isRestParameterDeclaration(decl) { + return ts.isParameter(decl) && decl.dotDotDotToken != null; +} +function isParenlessArrowFunction(node, sourceCode) { + return (node.params.length === 1 && !(0, astUtils_1.isParenthesized)(node.params[0], sourceCode)); +} +/** + * Gets a member being accessed or declared if its value can be determined statically, and + * resolves it to the string or symbol value that will be used as the actual member + * access key at runtime. Otherwise, returns `undefined`. + * + * ```ts + * x.member // returns 'member' + * ^^^^^^^^ + * + * x?.member // returns 'member' (optional chaining is treated the same) + * ^^^^^^^^^ + * + * x['value'] // returns 'value' + * ^^^^^^^^^^ + * + * x[Math.random()] // returns undefined (not a static value) + * ^^^^^^^^^^^^^^^^ + * + * arr[0] // returns '0' (NOT 0) + * ^^^^^^ + * + * arr[0n] // returns '0' (NOT 0n) + * ^^^^^^^ + * + * const s = Symbol.for('symbolName') + * x[s] // returns `Symbol.for('symbolName')` (since it's a static/global symbol) + * ^^^^ + * + * const us = Symbol('symbolName') + * x[us] // returns undefined (since it's a unique symbol, so not statically analyzable) + * ^^^^^ + * + * var object = { + * 1234: '4567', // returns '1234' (NOT 1234) + * ^^^^^^^^^^^^ + * method() { } // returns 'method' + * ^^^^^^^^^^^^ + * } + * + * class WithMembers { + * foo: string // returns 'foo' + * ^^^^^^^^^^^ + * } + * ``` + */ +function getStaticMemberAccessValue(node, { sourceCode }) { + const key = node.type === utils_1.AST_NODE_TYPES.MemberExpression ? node.property : node.key; + const { type } = key; + if (!node.computed && + (type === utils_1.AST_NODE_TYPES.Identifier || + type === utils_1.AST_NODE_TYPES.PrivateIdentifier)) { + return key.name; + } + const result = (0, astUtils_1.getStaticValue)(key, sourceCode.getScope(node)); + if (!result) { + return undefined; + } + const { value } = result; + return typeof value === 'symbol' ? value : String(value); +} +/** + * Answers whether the member expression looks like + * `x.value`, `x['value']`, + * or even `const v = 'value'; x[v]` (or optional variants thereof). + */ +const isStaticMemberAccessOfValue = (memberExpression, context, ...values) => values.includes(getStaticMemberAccessValue(memberExpression, context)); +exports.isStaticMemberAccessOfValue = isStaticMemberAccessOfValue; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eb3ebef245f1dfcd86295f8c2919cba5ac6278eb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.d.ts @@ -0,0 +1,11 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import type { SourceCode } from '@typescript-eslint/utils/ts-eslint'; +/** + * Determines whether an opening parenthesis `(`, bracket `[` or backtick ``` ` ``` needs to be preceded by a semicolon. + * This opening parenthesis or bracket should be at the start of an `ExpressionStatement`, a `MethodDefinition` or at + * the start of the body of an `ArrowFunctionExpression`. + * @param sourceCode The source code object. + * @param node A node at the position where an opening parenthesis or bracket will be inserted. + * @returns Whether a semicolon is required before the opening parenthesis or bracket. + */ +export declare function needsPrecedingSemicolon(sourceCode: SourceCode, node: TSESTree.Node): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.js new file mode 100644 index 0000000000000000000000000000000000000000..91760aea71c93046f07fb139028c67055557d3de --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsPrecedingSemiColon.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.needsPrecedingSemicolon = needsPrecedingSemicolon; +const utils_1 = require("@typescript-eslint/utils"); +const ast_utils_1 = require("@typescript-eslint/utils/ast-utils"); +// The following is adapted from `eslint`'s source code. +// https://github.com/eslint/eslint/blob/3a4eaf921543b1cd5d1df4ea9dec02fab396af2a/lib/rules/utils/ast-utils.js#L1043-L1132 +// Could be export { isStartOfExpressionStatement } from 'eslint/lib/rules/utils/ast-utils' +const BREAK_OR_CONTINUE = new Set([ + utils_1.AST_NODE_TYPES.BreakStatement, + utils_1.AST_NODE_TYPES.ContinueStatement, +]); +// Declaration types that must contain a string Literal node at the end. +const DECLARATIONS = new Set([ + utils_1.AST_NODE_TYPES.ExportAllDeclaration, + utils_1.AST_NODE_TYPES.ExportNamedDeclaration, + utils_1.AST_NODE_TYPES.ImportDeclaration, +]); +const IDENTIFIER_OR_KEYWORD = new Set([ + utils_1.AST_NODE_TYPES.Identifier, + utils_1.AST_TOKEN_TYPES.Keyword, +]); +// Keywords that can immediately precede an ExpressionStatement node, mapped to the their node types. +const NODE_TYPES_BY_KEYWORD = { + __proto__: null, + break: utils_1.AST_NODE_TYPES.BreakStatement, + continue: utils_1.AST_NODE_TYPES.ContinueStatement, + debugger: utils_1.AST_NODE_TYPES.DebuggerStatement, + do: utils_1.AST_NODE_TYPES.DoWhileStatement, + else: utils_1.AST_NODE_TYPES.IfStatement, + return: utils_1.AST_NODE_TYPES.ReturnStatement, + yield: utils_1.AST_NODE_TYPES.YieldExpression, +}; +/* + * Before an opening parenthesis, postfix `++` and `--` always trigger ASI; + * the tokens `:`, `;`, `{` and `=>` don't expect a semicolon, as that would count as an empty statement. + */ +const PUNCTUATORS = new Set(['--', ';', ':', '{', '++', '=>']); +/* + * Statements that can contain an `ExpressionStatement` after a closing parenthesis. + * DoWhileStatement is an exception in that it always triggers ASI after the closing parenthesis. + */ +const STATEMENTS = new Set([ + utils_1.AST_NODE_TYPES.DoWhileStatement, + utils_1.AST_NODE_TYPES.ForInStatement, + utils_1.AST_NODE_TYPES.ForOfStatement, + utils_1.AST_NODE_TYPES.ForStatement, + utils_1.AST_NODE_TYPES.IfStatement, + utils_1.AST_NODE_TYPES.WhileStatement, + utils_1.AST_NODE_TYPES.WithStatement, +]); +/** + * Determines whether an opening parenthesis `(`, bracket `[` or backtick ``` ` ``` needs to be preceded by a semicolon. + * This opening parenthesis or bracket should be at the start of an `ExpressionStatement`, a `MethodDefinition` or at + * the start of the body of an `ArrowFunctionExpression`. + * @param sourceCode The source code object. + * @param node A node at the position where an opening parenthesis or bracket will be inserted. + * @returns Whether a semicolon is required before the opening parenthesis or bracket. + */ +function needsPrecedingSemicolon(sourceCode, node) { + const prevToken = sourceCode.getTokenBefore(node); + if (!prevToken || + (prevToken.type === utils_1.AST_TOKEN_TYPES.Punctuator && + PUNCTUATORS.has(prevToken.value))) { + return false; + } + const prevNode = sourceCode.getNodeByRangeIndex(prevToken.range[0]); + if (!prevNode) { + return false; + } + if ((0, ast_utils_1.isClosingParenToken)(prevToken)) { + return !STATEMENTS.has(prevNode.type); + } + if ((0, ast_utils_1.isClosingBraceToken)(prevToken)) { + return ((prevNode.type === utils_1.AST_NODE_TYPES.BlockStatement && + prevNode.parent.type === utils_1.AST_NODE_TYPES.FunctionExpression && + prevNode.parent.parent.type !== utils_1.AST_NODE_TYPES.MethodDefinition) || + (prevNode.type === utils_1.AST_NODE_TYPES.ClassBody && + prevNode.parent.type === utils_1.AST_NODE_TYPES.ClassExpression) || + prevNode.type === utils_1.AST_NODE_TYPES.ObjectExpression); + } + if (!prevNode.parent) { + return false; + } + if (IDENTIFIER_OR_KEYWORD.has(prevToken.type)) { + if (BREAK_OR_CONTINUE.has(prevNode.parent.type)) { + return false; + } + const keyword = prevToken.value; + const nodeType = NODE_TYPES_BY_KEYWORD[keyword]; + return prevNode.type !== nodeType; + } + if (prevToken.type === utils_1.AST_TOKEN_TYPES.String) { + return !DECLARATIONS.has(prevNode.parent.type); + } + return true; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e97c6b65c31b8b98e009482d86721465d5b149f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.d.ts @@ -0,0 +1,7 @@ +import type * as ts from 'typescript'; +export declare enum Awaitable { + Always = 0, + Never = 1, + May = 2 +} +export declare function needsToBeAwaited(checker: ts.TypeChecker, node: ts.Node, type: ts.Type): Awaitable; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.js new file mode 100644 index 0000000000000000000000000000000000000000..7cd63a2d86139c6d202f6f096438fd496d9dba07 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/needsToBeAwaited.js @@ -0,0 +1,63 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Awaitable = void 0; +exports.needsToBeAwaited = needsToBeAwaited; +const type_utils_1 = require("@typescript-eslint/type-utils"); +const tsutils = __importStar(require("ts-api-utils")); +const getConstraintInfo_1 = require("./getConstraintInfo"); +var Awaitable; +(function (Awaitable) { + Awaitable[Awaitable["Always"] = 0] = "Always"; + Awaitable[Awaitable["Never"] = 1] = "Never"; + Awaitable[Awaitable["May"] = 2] = "May"; +})(Awaitable || (exports.Awaitable = Awaitable = {})); +function needsToBeAwaited(checker, node, type) { + const { constraintType, isTypeParameter } = (0, getConstraintInfo_1.getConstraintInfo)(checker, type); + // unconstrained generic types should be treated as unknown + if (isTypeParameter && constraintType == null) { + return Awaitable.May; + } + // `any` and `unknown` types may need to be awaited + if ((0, type_utils_1.isTypeAnyType)(constraintType) || (0, type_utils_1.isTypeUnknownType)(constraintType)) { + return Awaitable.May; + } + // 'thenable' values should always be be awaited + if (tsutils.isThenableType(checker, node, constraintType)) { + return Awaitable.Always; + } + // anything else should not be awaited + return Awaitable.Never; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..96979cae27333bfb74ba862ef54ffc87b140f96e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.d.ts @@ -0,0 +1,3 @@ +export declare function objectForEachKey>(obj: T, callback: (key: keyof T) => void): void; +export declare function objectMapKey, Return>(obj: T, callback: (key: keyof T) => Return): Return[]; +export declare function objectReduceKey, Accumulator>(obj: T, callback: (acc: Accumulator, key: keyof T) => Accumulator, initial: Accumulator): Accumulator; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js new file mode 100644 index 0000000000000000000000000000000000000000..80651afef52d43d85d2461fd84594d89d4f75e99 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/objectIterators.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.objectForEachKey = objectForEachKey; +exports.objectMapKey = objectMapKey; +exports.objectReduceKey = objectReduceKey; +function objectForEachKey(obj, callback) { + const keys = Object.keys(obj); + for (const key of keys) { + callback(key); + } +} +function objectMapKey(obj, callback) { + const values = []; + objectForEachKey(obj, key => { + values.push(callback(key)); + }); + return values; +} +function objectReduceKey(obj, callback, initial) { + let accumulator = initial; + objectForEachKey(obj, key => { + accumulator = callback(accumulator, key); + }); + return accumulator; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/promiseUtils.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/promiseUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aa6db9433e3120138f1240a51f576369a261b14c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/promiseUtils.d.ts @@ -0,0 +1,27 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import type { RuleContext } from '@typescript-eslint/utils/ts-eslint'; +/** + * Parses a syntactically possible `Promise.then()` call. Does not check the + * type of the callee. + */ +export declare function parseThenCall(node: TSESTree.CallExpression, context: RuleContext): { + onFulfilled?: TSESTree.Expression | undefined; + onRejected?: TSESTree.Expression | undefined; + object: TSESTree.Expression; +} | undefined; +/** + * Parses a syntactically possible `Promise.catch()` call. Does not check the + * type of the callee. + */ +export declare function parseCatchCall(node: TSESTree.CallExpression, context: RuleContext): { + onRejected?: TSESTree.Expression | undefined; + object: TSESTree.Expression; +} | undefined; +/** + * Parses a syntactically possible `Promise.finally()` call. Does not check the + * type of the callee. + */ +export declare function parseFinallyCall(node: TSESTree.CallExpression, context: RuleContext): { + object: TSESTree.Expression; + onFinally?: TSESTree.Expression | undefined; +} | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/promiseUtils.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/promiseUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..4a2df50d47a5246b7800d5960f93347cd1aba34f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/promiseUtils.js @@ -0,0 +1,98 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseThenCall = parseThenCall; +exports.parseCatchCall = parseCatchCall; +exports.parseFinallyCall = parseFinallyCall; +const utils_1 = require("@typescript-eslint/utils"); +const misc_1 = require("./misc"); +/** + * Parses a syntactically possible `Promise.then()` call. Does not check the + * type of the callee. + */ +function parseThenCall(node, context) { + if (node.callee.type === utils_1.AST_NODE_TYPES.MemberExpression) { + const methodName = (0, misc_1.getStaticMemberAccessValue)(node.callee, context); + if (methodName === 'then') { + if (node.arguments.length >= 1) { + if (node.arguments[0].type === utils_1.AST_NODE_TYPES.SpreadElement) { + return { + object: node.callee.object, + }; + } + if (node.arguments.length >= 2) { + if (node.arguments[1].type === utils_1.AST_NODE_TYPES.SpreadElement) { + return { + object: node.callee.object, + onFulfilled: node.arguments[0], + }; + } + return { + object: node.callee.object, + onFulfilled: node.arguments[0], + onRejected: node.arguments[1], + }; + } + return { + object: node.callee.object, + onFulfilled: node.arguments[0], + }; + } + return { + object: node.callee.object, + }; + } + } + return undefined; +} +/** + * Parses a syntactically possible `Promise.catch()` call. Does not check the + * type of the callee. + */ +function parseCatchCall(node, context) { + if (node.callee.type === utils_1.AST_NODE_TYPES.MemberExpression) { + const methodName = (0, misc_1.getStaticMemberAccessValue)(node.callee, context); + if (methodName === 'catch') { + if (node.arguments.length >= 1) { + if (node.arguments[0].type === utils_1.AST_NODE_TYPES.SpreadElement) { + return { + object: node.callee.object, + }; + } + return { + object: node.callee.object, + onRejected: node.arguments[0], + }; + } + return { + object: node.callee.object, + }; + } + } + return undefined; +} +/** + * Parses a syntactically possible `Promise.finally()` call. Does not check the + * type of the callee. + */ +function parseFinallyCall(node, context) { + if (node.callee.type === utils_1.AST_NODE_TYPES.MemberExpression) { + const methodName = (0, misc_1.getStaticMemberAccessValue)(node.callee, context); + if (methodName === 'finally') { + if (node.arguments.length >= 1) { + if (node.arguments[0].type === utils_1.AST_NODE_TYPES.SpreadElement) { + return { + object: node.callee.object, + }; + } + return { + object: node.callee.object, + onFinally: node.arguments[0], + }; + } + return { + object: node.callee.object, + }; + } + } + return undefined; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..73a8df91f91634bac20f750716fdcae15d9a2515 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.d.ts @@ -0,0 +1,2 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +export declare function rangeToLoc(sourceCode: TSESLint.SourceCode, range: TSESLint.AST.Range): TSESTree.SourceLocation; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.js new file mode 100644 index 0000000000000000000000000000000000000000..2fb8cbae56d7d12c289e03bfcde8d835c462eaed --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/rangeToLoc.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.rangeToLoc = rangeToLoc; +function rangeToLoc(sourceCode, range) { + return { + end: sourceCode.getLocFromIndex(range[1]), + start: sourceCode.getLocFromIndex(range[0]), + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypePredicate.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypePredicate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..978f6c871ebfe3a7d97ea708a9b90045b68780c4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypePredicate.d.ts @@ -0,0 +1,5 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +/** + * Recursively checks whether a given reference is used in a type predicate (e.g., `arg is string`) + */ +export declare function referenceContainsTypePredicate(node: TSESTree.Node): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypePredicate.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypePredicate.js new file mode 100644 index 0000000000000000000000000000000000000000..3b1cd72ceb71dc8691f02e52380b289bdba78383 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypePredicate.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.referenceContainsTypePredicate = referenceContainsTypePredicate; +const utils_1 = require("@typescript-eslint/utils"); +/** + * Recursively checks whether a given reference is used in a type predicate (e.g., `arg is string`) + */ +function referenceContainsTypePredicate(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSTypePredicate: + return true; + case utils_1.AST_NODE_TYPES.TSQualifiedName: + case utils_1.AST_NODE_TYPES.Identifier: + return referenceContainsTypePredicate(node.parent); + default: + return false; + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..75525949782fbeb8f229b5aededc54f3b132d49d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.d.ts @@ -0,0 +1,5 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +/** + * Recursively checks whether a given reference has a type query declaration among its parents + */ +export declare function referenceContainsTypeQuery(node: TSESTree.Node): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.js new file mode 100644 index 0000000000000000000000000000000000000000..45bc86ef8081f0cfa2ae11ef610f802a6f66a842 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/referenceContainsTypeQuery.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.referenceContainsTypeQuery = referenceContainsTypeQuery; +const utils_1 = require("@typescript-eslint/utils"); +/** + * Recursively checks whether a given reference has a type query declaration among its parents + */ +function referenceContainsTypeQuery(node) { + switch (node.type) { + case utils_1.AST_NODE_TYPES.TSTypeQuery: + return true; + case utils_1.AST_NODE_TYPES.TSQualifiedName: + case utils_1.AST_NODE_TYPES.Identifier: + return referenceContainsTypeQuery(node.parent); + default: + // if we find a different node, there's no chance that we're in a TSTypeQuery + return false; + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e33aae17e78c005303c736b3b2ef2aa70502cc40 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.d.ts @@ -0,0 +1,3 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import type { SourceCode } from '@typescript-eslint/utils/ts-eslint'; +export declare function isReferenceToGlobalFunction(calleeName: string, node: TSESTree.Node, sourceCode: SourceCode): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..21445521a6fca5fe5e5be633fae1d0c8fc3dab92 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/scopeUtils.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isReferenceToGlobalFunction = isReferenceToGlobalFunction; +function isReferenceToGlobalFunction(calleeName, node, sourceCode) { + const ref = sourceCode + .getScope(node) + .references.find(ref => ref.identifier.name === calleeName); + // ensure it's the "global" version + return !ref?.resolved?.defs.length; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2b4fe1366b349dfe02a50464e61c92f4907aafd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.d.ts @@ -0,0 +1,2 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +export declare function skipChainExpression(node: T): T | TSESTree.ChainElement; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.js new file mode 100644 index 0000000000000000000000000000000000000000..8f041cfbabbe075a0e394314ead3d79f39dc9ac0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/skipChainExpression.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.skipChainExpression = skipChainExpression; +const utils_1 = require("@typescript-eslint/utils"); +function skipChainExpression(node) { + return node.type === utils_1.AST_NODE_TYPES.ChainExpression ? node.expression : node; +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessUtils.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..93f7c290170383504be74166008cbb8a8213900d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessUtils.d.ts @@ -0,0 +1,3 @@ +import * as ts from 'typescript'; +export declare const isPossiblyFalsy: (type: ts.Type) => boolean; +export declare const isPossiblyTruthy: (type: ts.Type) => boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessUtils.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..2ef0dc4088137630944d1866acad6eab30e851c4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/truthinessUtils.js @@ -0,0 +1,60 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isPossiblyTruthy = exports.isPossiblyFalsy = void 0; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const getValueOfLiteralType_1 = require("./getValueOfLiteralType"); +// Truthiness utilities +const isTruthyLiteral = (type) => tsutils.isTrueLiteralType(type) || + (type.isLiteral() && !!(0, getValueOfLiteralType_1.getValueOfLiteralType)(type)); +const isPossiblyFalsy = (type) => tsutils + .unionConstituents(type) + // Intersections like `string & {}` can also be possibly falsy, + // requiring us to look into the intersection. + .flatMap(type => tsutils.intersectionConstituents(type)) + // PossiblyFalsy flag includes literal values, so exclude ones that + // are definitely truthy + .filter(t => !isTruthyLiteral(t)) + .some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.PossiblyFalsy)); +exports.isPossiblyFalsy = isPossiblyFalsy; +const isPossiblyTruthy = (type) => tsutils + .unionConstituents(type) + .map(type => tsutils.intersectionConstituents(type)) + .some(intersectionParts => +// It is possible to define intersections that are always falsy, +// like `"" & { __brand: string }`. +intersectionParts.every(type => !tsutils.isFalsyType(type))); +exports.isPossiblyTruthy = isPossiblyTruthy; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f75d67ce19388c5d94f9a324840444f0158493ab --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.d.ts @@ -0,0 +1,2 @@ +export type MakeRequired = Omit & Required>>; +export type ValueOf = T[keyof T]; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/walkStatements.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/walkStatements.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fa8c6f02fc1a363e59a167d8ef062cb2d680ca4e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/walkStatements.d.ts @@ -0,0 +1,7 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +/** + * Yields all statement nodes in a block, including nested blocks. + * + * You can use it to find all return statements in a function body. + */ +export declare function walkStatements(body: readonly TSESTree.Statement[]): Generator; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/walkStatements.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/walkStatements.js new file mode 100644 index 0000000000000000000000000000000000000000..9c1e75c3a71be15d8c9af41f750111486cb4651c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/dist/util/walkStatements.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.walkStatements = walkStatements; +const utils_1 = require("@typescript-eslint/utils"); +/** + * Yields all statement nodes in a block, including nested blocks. + * + * You can use it to find all return statements in a function body. + */ +function* walkStatements(body) { + for (const statement of body) { + switch (statement.type) { + case utils_1.AST_NODE_TYPES.BlockStatement: { + yield* walkStatements(statement.body); + continue; + } + case utils_1.AST_NODE_TYPES.SwitchStatement: { + for (const switchCase of statement.cases) { + yield* walkStatements(switchCase.consequent); + } + continue; + } + case utils_1.AST_NODE_TYPES.IfStatement: { + yield* walkStatements([statement.consequent]); + if (statement.alternate) { + yield* walkStatements([statement.alternate]); + } + continue; + } + case utils_1.AST_NODE_TYPES.WhileStatement: + case utils_1.AST_NODE_TYPES.DoWhileStatement: + case utils_1.AST_NODE_TYPES.ForStatement: + case utils_1.AST_NODE_TYPES.ForInStatement: + case utils_1.AST_NODE_TYPES.ForOfStatement: + case utils_1.AST_NODE_TYPES.WithStatement: + case utils_1.AST_NODE_TYPES.LabeledStatement: { + yield* walkStatements([statement.body]); + continue; + } + case utils_1.AST_NODE_TYPES.TryStatement: { + yield* walkStatements([statement.block]); + if (statement.handler) { + yield* walkStatements([statement.handler.body]); + } + if (statement.finalizer) { + yield* walkStatements([statement.finalizer]); + } + continue; + } + default: { + yield statement; + continue; + } + } + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/index.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..756a025eb97d7d2819e3688bb16f5118432f7921 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/index.d.ts @@ -0,0 +1,13 @@ +import type { + ClassicConfig, + FlatConfig, +} from '@typescript-eslint/utils/ts-eslint'; + +import type rules from './rules'; + +declare const cjsExport: { + configs: Record; + meta: FlatConfig.PluginMeta; + rules: typeof rules; +}; +export = cjsExport; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/LICENSE-MIT b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/LICENSE-MIT new file mode 100644 index 0000000000000000000000000000000000000000..825533e337fa1d8e6fccfe70318c4abf52600d25 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/LICENSE-MIT @@ -0,0 +1,21 @@ +Copyright (c) 2013 Kael Zhang , contributors +http://kael.me/ + +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/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/README.md b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/README.md new file mode 100644 index 0000000000000000000000000000000000000000..073660e66a2bc538df819c35773f11bf0dafa38b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/README.md @@ -0,0 +1,452 @@ +| Linux / MacOS / Windows | Coverage | Downloads | +| ----------------------- | -------- | --------- | +| [![build][bb]][bl] | [![coverage][cb]][cl] | [![downloads][db]][dl] | + +[bb]: https://github.com/kaelzhang/node-ignore/actions/workflows/nodejs.yml/badge.svg +[bl]: https://github.com/kaelzhang/node-ignore/actions/workflows/nodejs.yml + +[cb]: https://codecov.io/gh/kaelzhang/node-ignore/branch/master/graph/badge.svg +[cl]: https://codecov.io/gh/kaelzhang/node-ignore + +[db]: http://img.shields.io/npm/dm/ignore.svg +[dl]: https://www.npmjs.org/package/ignore + +# ignore + +`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the [.gitignore spec 2.22.1](http://git-scm.com/docs/gitignore). + +`ignore` is used by eslint, gitbook and [many others](https://www.npmjs.com/browse/depended/ignore). + +Pay **ATTENTION** that [`minimatch`](https://www.npmjs.org/package/minimatch) (which used by `fstream-ignore`) does not follow the gitignore spec. + +To filter filenames according to a .gitignore file, I recommend this npm package, `ignore`. + +To parse an `.npmignore` file, you should use `minimatch`, because an `.npmignore` file is parsed by npm using `minimatch` and it does not work in the .gitignore way. + +### Tested on + +`ignore` is fully tested, and has more than **five hundreds** of unit tests. + +- 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) +- See Also: + - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules. +- [Upgrade Guide](#upgrade-guide) + +## Install + +```sh +npm i ignore +``` + +## 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 +## .add({pattern: string, mark?: string}): this since 7.0.0 + +- **pattern** `string | Ignore` An ignore pattern string, or the `Ignore` instance +- **patterns** `Array` Array of ignore patterns. +- **mark?** `string` Pattern mark, which is used to associate the pattern with a certain marker, such as the line no of the `.gitignore` file. Actually it could be an arbitrary string and is optional. + +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. + +## .ignores(pathname: [Pathname](#pathname-conventions)): boolean + +> new in 3.2.0 + +Returns `Boolean` whether `pathname` should be ignored. + +```js +ig.ignores('.abc/a.js') // true +``` + +Please **PAY ATTENTION** that `.ignores()` is **NOT** equivalent to `git check-ignore` although in most cases they return equivalent results. + +However, for the purposes of imitating the behavior of `git check-ignore`, please use `.checkIgnore()` instead. + +### `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, an error will be thrown +ig.ignores('./abc') + +// WRONG, for it will never happen, and an error will be thrown +// If the gitignore rule locates at the root directory, +// `'/abc'` should be changed to `'abc'`. +// ``` +// path.relative('/', '/abc') -> 'abc' +// ``` +ig.ignores('/abc') + +// WRONG, that it is an absolute path on Windows, an error will be thrown +ig.ignores('C:\\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' +] +``` + +#### 2. filenames and dirnames + +`node-ignore` does NO `fs.stat` during path matching, so `node-ignore` treats +- `foo` as a file +- **`foo/` as a directory** + +For the example below: + +```js +// First, we add a ignore pattern to ignore a directory +ig.add('config/') + +// `ig` does NOT know if 'config', in the real world, +// is a normal file, directory or something. + +ig.ignores('config') +// `ig` treats `config` as a file, so 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. + +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) +}) +``` + + +## .filter(paths: Array<Pathname>): Array<Pathname> + +```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. + +## .createFilter() + +Creates a filter function which could filter an array of paths with `Array.prototype.filter`. + +Returns `function(path)` the filter function. + +## .test(pathname: Pathname): TestResult + +> New in 5.0.0 + +Returns `TestResult` + +```ts +// Since 5.0.0 +interface TestResult { + ignored: boolean + // true if the `pathname` is finally unignored by some negative pattern + unignored: boolean + // The `IgnoreRule` which ignores the pathname + rule?: IgnoreRule +} + +// Since 7.0.0 +interface IgnoreRule { + // The original pattern + pattern: string + // Whether the pattern is a negative pattern + negative: boolean + // Which is used for other packages to build things upon `node-ignore` + mark?: string +} +``` + +- `{ignored: true, unignored: false}`: the `pathname` is ignored +- `{ignored: false, unignored: true}`: the `pathname` is unignored +- `{ignored: false, unignored: false}`: the `pathname` is never matched by any ignore rules. + +## .checkIgnore(target: string): TestResult + +> new in 7.0.0 + +Debugs gitignore / exclude files, which is equivalent to `git check-ignore -v`. Usually this method is used for other packages to implement the function of `git check-ignore -v` upon `node-ignore` + +- **target** `string` the target to test. + +Returns `TestResult` + +```js +ig.add({ + pattern: 'foo/*', + mark: '60' +}) + +const { + ignored, + rule +} = checkIgnore('foo/') + +if (ignored) { + console.log(`.gitignore:${result}:${rule.mark}:${rule.pattern} foo/`) +} + +// .gitignore:60:foo/* foo/ +``` + +Please pay attention that this method does not have a strong built-in cache mechanism. + +The purpose of introducing this method is to make it possible to implement the `git check-ignore` command in JavaScript based on `node-ignore`. + +So do not use this method in those situations where performance is extremely important. + +## static `isPathValid(pathname): boolean` since 5.0.0 + +Check whether the `pathname` is an valid `path.relative()`d path according to the [convention](#1-pathname-should-be-a-pathrelatived-pathname). + +This method is **NOT** used to check if an ignore pattern is valid. + +```js +import {isPathValid} from 'ignore' + +isPathValid('./foo') // false +``` + +## .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. + +## ignore(options) + +### `options.ignorecase` since 4.0.0 + +Similar to 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` (the default value), otherwise case sensitive. + +```js +const ig = ignore({ + ignorecase: false +}) + +ig.add('*.png') + +ig.ignores('*.PNG') // false +``` + +### `options.ignoreCase?: boolean` since 5.2.0 + +Which is an alternative to `options.ignoreCase` + +### `options.allowRelativePaths?: boolean` since 5.2.0 + +This option brings backward compatibility with projects which based on `ignore@4.x`. If `options.allowRelativePaths` is `true`, `ignore` will not check whether the given path to be tested is [`path.relative()`d](#pathname-conventions). + +However, passing a relative path, such as `'./foo'` or `'../foo'`, to test if it is ignored or not is not a good practise, which might lead to unexpected behavior + +```js +ignore({ + allowRelativePaths: true +}).ignores('../foo/bar.js') // And it will not throw +``` + +**** + +# Upgrade Guide + +## Upgrade 4.x -> 5.x + +Since `5.0.0`, if an invalid `Pathname` passed into `ig.ignores()`, an error will be thrown, unless `options.allowRelative = true` is passed to the `Ignore` factory. + +While `ignore < 5.0.0` did not make sure what the return value was, as well as + +```ts +.ignores(pathname: Pathname): boolean + +.filter(pathnames: Array): Array + +.createFilter(): (pathname: Pathname) => boolean + +.test(pathname: Pathname): {ignored: boolean, unignored: boolean} +``` + +See the convention [here](#1-pathname-should-be-a-pathrelatived-pathname) for details. + +If there are invalid pathnames, the conversion and filtration should be done by users. + +```js +import {isPathValid} from 'ignore' // introduced in 5.0.0 + +const paths = [ + // invalid + ////////////////// + '', + false, + '../foo', + '.', + ////////////////// + + // valid + 'foo' +] +.filter(isPathValid) + +ig.filter(paths) +``` + +## 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') +``` + +## 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. + +**** + +# 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/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/index.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6912595a3ebc2993aa4bfe644f149a2c82cb0f5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/index.d.ts @@ -0,0 +1,81 @@ +type Pathname = string + +interface IgnoreRule { + pattern: string + mark?: string + negative: boolean +} + +interface TestResult { + ignored: boolean + unignored: boolean + rule?: IgnoreRule +} + +interface PatternParams { + pattern: string + mark?: string +} + +/** + * Creates new ignore manager. + */ +declare function ignore(options?: ignore.Options): ignore.Ignore +declare namespace ignore { + interface Ignore { + /** + * Adds one or several rules to the current manager. + * @param {string[]} patterns + * @returns IgnoreBase + */ + add( + patterns: string | Ignore | readonly (string | Ignore)[] | PatternParams + ): this + + /** + * Filters the given array of pathnames, and returns the filtered array. + * NOTICE that each path here should be a relative path to the root of your repository. + * @param paths the array of paths to be filtered. + * @returns The filtered array of paths + */ + filter(pathnames: readonly Pathname[]): Pathname[] + + /** + * Creates a filter function which could filter + * an array of paths with Array.prototype.filter. + */ + createFilter(): (pathname: Pathname) => boolean + + /** + * Returns Boolean whether pathname should be ignored. + * @param {string} pathname a path to check + * @returns boolean + */ + ignores(pathname: Pathname): boolean + + /** + * Returns whether pathname should be ignored or unignored + * @param {string} pathname a path to check + * @returns TestResult + */ + test(pathname: Pathname): TestResult + + /** + * Debugs ignore rules and returns the checking result, which is + * equivalent to `git check-ignore -v`. + * @returns TestResult + */ + checkIgnore(pathname: Pathname): TestResult + } + + interface Options { + ignorecase?: boolean + // For compatibility + ignoreCase?: boolean + allowRelativePaths?: boolean + } + + function isPathValid(pathname: string): boolean +} + +export = ignore diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/index.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6dee02f8786842ac4459e9aeb447f37d62f20cb6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/index.js @@ -0,0 +1,784 @@ +// A simple implementation of make-array +function makeArray (subject) { + return Array.isArray(subject) + ? subject + : [subject] +} + +const UNDEFINED = undefined +const EMPTY = '' +const SPACE = ' ' +const ESCAPE = '\\' +const REGEX_TEST_BLANK_LINE = /^\s+$/ +const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/ +const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/ +const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/ +const REGEX_SPLITALL_CRLF = /\r?\n/g + +// Invalid: +// - /foo, +// - ./foo, +// - ../foo, +// - . +// - .. +// Valid: +// - .foo +const REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/ + +const REGEX_TEST_TRAILING_SLASH = /\/$/ + +const SLASH = '/' + +// Do not use ternary expression here, since "istanbul ignore next" is buggy +let TMP_KEY_IGNORE = 'node-ignore' +/* istanbul ignore else */ +if (typeof Symbol !== 'undefined') { + TMP_KEY_IGNORE = Symbol.for('node-ignore') +} +const KEY_IGNORE = TMP_KEY_IGNORE + +const define = (object, key, value) => { + Object.defineProperty(object, key, {value}) + return value +} + +const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g + +const RETURN_FALSE = () => false + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +const sanitizeRange = range => range.replace( + REGEX_REGEXP_RANGE, + (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) + ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : EMPTY +) + +// See fixtures #59 +const cleanRangeBackSlash = slashes => { + const {length} = slashes + return slashes.slice(0, length - length % 2) +} + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +const REPLACERS = [ + + [ + // Remove BOM + // TODO: + // Other similar zero-width characters? + /^\uFEFF/, + () => EMPTY + ], + + // > Trailing spaces are ignored unless they are quoted with backslash ("\") + [ + // (a\ ) -> (a ) + // (a ) -> (a) + // (a ) -> (a) + // (a \ ) -> (a ) + /((?:\\\\)*?)(\\?\s+)$/, + (_, m1, m2) => m1 + ( + m2.indexOf('\\') === 0 + ? SPACE + : EMPTY + ) + ], + + // Replace (\ ) with ' ' + // (\ ) -> ' ' + // (\\ ) -> '\\ ' + // (\\\ ) -> '\\ ' + [ + /(\\+?)\s/g, + (_, m1) => { + const {length} = m1 + return m1.slice(0, length - length % 2) + SPACE + } + ], + + // Escape metacharacters + // which is written down by users but means special for regular expressions. + + // > There are 12 characters with special meanings: + // > - the backslash \, + // > - the caret ^, + // > - the dollar sign $, + // > - the period or dot ., + // > - the vertical bar or pipe symbol |, + // > - the question mark ?, + // > - the asterisk or star *, + // > - the plus sign +, + // > - the opening parenthesis (, + // > - the closing parenthesis ), + // > - and the opening square bracket [, + // > - the opening curly brace {, + // > These special characters are often called "metacharacters". + [ + /[\\$.|*+(){^]/g, + match => `\\${match}` + ], + + [ + // > a question mark (?) matches a single character + /(?!\\)\?/g, + () => '[^/]' + ], + + // leading slash + [ + + // > A leading slash matches the beginning of the pathname. + // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". + // A leading slash matches the beginning of the pathname + /^\//, + () => '^' + ], + + // replace special metacharacter slash after the leading slash + [ + /\//g, + () => '\\/' + ], + + [ + // > A leading "**" followed by a slash means match in all directories. + // > For example, "**/foo" matches file or directory "foo" anywhere, + // > the same as pattern "foo". + // > "**/foo/bar" matches file or directory "bar" anywhere that is directly + // > under directory "foo". + // Notice that the '*'s have been replaced as '\\*' + /^\^*\\\*\\\*\\\//, + + // '**/foo' <-> 'foo' + () => '^(?:.*\\/)?' + ], + + // starting + [ + // there will be no leading '/' + // (which has been replaced by section "leading slash") + // If starts with '**', adding a '^' to the regular expression also works + /^(?=[^^])/, + function startingReplacer () { + // If has a slash `/` at the beginning or middle + return !/\/(?!$)/.test(this) + // > Prior to 2.22.1 + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + + // After 2.22.1 (compatible but clearer) + // > If there is a separator at the beginning or middle (or both) + // > of the pattern, then the pattern is relative to the directory + // > level of the particular .gitignore file itself. + // > Otherwise the pattern may also match at any level below + // > the .gitignore level. + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^' + } + ], + + // two globstars + [ + // Use lookahead assertions so that we could match more than one `'/**'` + /\\\/\\\*\\\*(?=\\\/|$)/g, + + // Zero, one or several directories + // should not use '*', or it will be replaced by the next replacer + + // Check if it is not the last `'/**'` + (_, index, str) => index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+' + ], + + // normal intermediate wildcards + [ + // Never replace escaped '*' + // ignore rule '\*' will match the path '*' + + // 'abc.*/' -> go + // 'abc.*' -> skip this rule, + // coz trailing single wildcard will be handed by [trailing wildcard] + /(^|[^\\]+)(\\\*)+(?=.+)/g, + + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + (_, p1, p2) => { + // 1. + // > An asterisk "*" matches anything except a slash. + // 2. + // > Other consecutive asterisks are considered regular asterisks + // > and will match according to the previous rules. + const unescaped = p2.replace(/\\\*/g, '[^\\/]*') + return p1 + unescaped + } + ], + + [ + // unescape, revert step 3 except for back slash + // For example, if a user escape a '\\*', + // after step 3, the result will be '\\\\\\*' + /\\\\\\(?=[$.|*+(){^])/g, + () => ESCAPE + ], + + [ + // '\\\\' -> '\\' + /\\\\/g, + () => ESCAPE + ], + + [ + // > The range notation, e.g. [a-zA-Z], + // > can be used to match one of the characters in a range. + + // `\` is escaped by step 3 + /(\\)?\[([^\]/]*?)(\\*)($|\])/g, + (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE + // '\\[bar]' -> '\\\\[bar\\]' + ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` + : close === ']' + ? endEscape.length % 2 === 0 + // A normal case, and it is a range notation + // '[bar]' + // '[bar\\\\]' + ? `[${sanitizeRange(range)}${endEscape}]` + // Invalid range notaton + // '[bar\\]' -> '[bar\\\\]' + : '[]' + : '[]' + ], + + // ending + [ + // 'js' will not match 'js.' + // 'ab' will not match 'abc' + /(?:[^*])$/, + + // WTF! + // https://git-scm.com/docs/gitignore + // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) + // which re-fixes #24, #38 + + // > If there is a separator at the end of the pattern then the pattern + // > will only match directories, otherwise the pattern can match both + // > files and directories. + + // 'js*' will not match 'a.js' + // 'js/' will not match 'a.js' + // 'js' will match 'a.js' and 'a.js/' + match => /\/$/.test(match) + // foo/ will not match 'foo' + ? `${match}$` + // foo matches 'foo' and 'foo/' + : `${match}(?=$|\\/$)` + ] +] + +const REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/ +const MODE_IGNORE = 'regex' +const MODE_CHECK_IGNORE = 'checkRegex' +const UNDERSCORE = '_' + +const TRAILING_WILD_CARD_REPLACERS = { + [MODE_IGNORE] (_, p1) { + const prefix = p1 + // '\^': + // '/*' does not match EMPTY + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? `${p1}[^/]+` + + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*' + + return `${prefix}(?=$|\\/$)` + }, + + [MODE_CHECK_IGNORE] (_, p1) { + // When doing `git check-ignore` + const prefix = p1 + // '\\\/': + // 'abc/*' DOES match 'abc/' ! + ? `${p1}[^/]*` + + // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*' + + return `${prefix}(?=$|\\/$)` + } +} + +// @param {pattern} +const makeRegexPrefix = pattern => REPLACERS.reduce( + (prev, [matcher, replacer]) => + prev.replace(matcher, replacer.bind(pattern)), + pattern +) + +const isString = subject => typeof subject === 'string' + +// > A blank line matches no files, so it can serve as a separator for readability. +const checkPattern = pattern => pattern + && isString(pattern) + && !REGEX_TEST_BLANK_LINE.test(pattern) + && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0 + +const splitPattern = pattern => pattern +.split(REGEX_SPLITALL_CRLF) +.filter(Boolean) + +class IgnoreRule { + constructor ( + pattern, + mark, + body, + ignoreCase, + negative, + prefix + ) { + this.pattern = pattern + this.mark = mark + this.negative = negative + + define(this, 'body', body) + define(this, 'ignoreCase', ignoreCase) + define(this, 'regexPrefix', prefix) + } + + get regex () { + const key = UNDERSCORE + MODE_IGNORE + + if (this[key]) { + return this[key] + } + + return this._make(MODE_IGNORE, key) + } + + get checkRegex () { + const key = UNDERSCORE + MODE_CHECK_IGNORE + + if (this[key]) { + return this[key] + } + + return this._make(MODE_CHECK_IGNORE, key) + } + + _make (mode, key) { + const str = this.regexPrefix.replace( + REGEX_REPLACE_TRAILING_WILDCARD, + + // It does not need to bind pattern + TRAILING_WILD_CARD_REPLACERS[mode] + ) + + const regex = this.ignoreCase + ? new RegExp(str, 'i') + : new RegExp(str) + + return define(this, key, regex) + } +} + +const createRule = ({ + pattern, + mark +}, ignoreCase) => { + let negative = false + let body = pattern + + // > An optional prefix "!" which negates the pattern; + if (body.indexOf('!') === 0) { + negative = true + body = body.substr(1) + } + + body = body + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#') + + const regexPrefix = makeRegexPrefix(body) + + return new IgnoreRule( + pattern, + mark, + body, + ignoreCase, + negative, + regexPrefix + ) +} + +class RuleManager { + constructor (ignoreCase) { + this._ignoreCase = ignoreCase + this._rules = [] + } + + _add (pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules._rules) + this._added = true + return + } + + if (isString(pattern)) { + pattern = { + pattern + } + } + + if (checkPattern(pattern.pattern)) { + const rule = createRule(pattern, this._ignoreCase) + this._added = true + this._rules.push(rule) + } + } + + // @param {Array | string | Ignore} pattern + add (pattern) { + this._added = false + + makeArray( + isString(pattern) + ? splitPattern(pattern) + : pattern + ).forEach(this._add, this) + + return this._added + } + + // Test one single path without recursively checking parent directories + // + // - checkUnignored `boolean` whether should check if the path is unignored, + // setting `checkUnignored` to `false` could reduce additional + // path matching. + // - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE` + + // @returns {TestResult} true if a file is ignored + test (path, checkUnignored, mode) { + let ignored = false + let unignored = false + let matchedRule + + this._rules.forEach(rule => { + const {negative} = rule + + // | ignored : unignored + // -------- | --------------------------------------- + // negative | 0:0 | 0:1 | 1:0 | 1:1 + // -------- | ------- | ------- | ------- | -------- + // 0 | TEST | TEST | SKIP | X + // 1 | TESTIF | SKIP | TEST | X + + // - SKIP: always skip + // - TEST: always test + // - TESTIF: only test if checkUnignored + // - X: that never happen + if ( + unignored === negative && ignored !== unignored + || negative && !ignored && !unignored && !checkUnignored + ) { + return + } + + const matched = rule[mode].test(path) + + if (!matched) { + return + } + + ignored = !negative + unignored = negative + + matchedRule = negative + ? UNDEFINED + : rule + }) + + const ret = { + ignored, + unignored + } + + if (matchedRule) { + ret.rule = matchedRule + } + + return ret + } +} + +const throwError = (message, Ctor) => { + throw new Ctor(message) +} + +const checkPath = (path, originalPath, doThrow) => { + if (!isString(path)) { + return doThrow( + `path must be a string, but got \`${originalPath}\``, + TypeError + ) + } + + // We don't know if we should ignore EMPTY, so throw + if (!path) { + return doThrow(`path must not be empty`, TypeError) + } + + // Check if it is a relative path + if (checkPath.isNotRelative(path)) { + const r = '`path.relative()`d' + return doThrow( + `path should be a ${r} string, but got "${originalPath}"`, + RangeError + ) + } + + return true +} + +const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path) + +checkPath.isNotRelative = isNotRelative + +// On windows, the following function will be replaced +/* istanbul ignore next */ +checkPath.convert = p => p + + +class Ignore { + constructor ({ + ignorecase = true, + ignoreCase = ignorecase, + allowRelativePaths = false + } = {}) { + define(this, KEY_IGNORE, true) + + this._rules = new RuleManager(ignoreCase) + this._strictPathCheck = !allowRelativePaths + this._initCache() + } + + _initCache () { + // A cache for the result of `.ignores()` + this._ignoreCache = Object.create(null) + + // A cache for the result of `.test()` + this._testCache = Object.create(null) + } + + add (pattern) { + if (this._rules.add(pattern)) { + // Some rules have just added to the ignore, + // making the behavior changed, + // so we need to re-initialize the result cache + this._initCache() + } + + return this + } + + // legacy + addPattern (pattern) { + return this.add(pattern) + } + + // @returns {TestResult} + _test (originalPath, cache, checkUnignored, slices) { + const path = originalPath + // Supports nullable path + && checkPath.convert(originalPath) + + checkPath( + path, + originalPath, + this._strictPathCheck + ? throwError + : RETURN_FALSE + ) + + return this._t(path, cache, checkUnignored, slices) + } + + checkIgnore (path) { + // If the path doest not end with a slash, `.ignores()` is much equivalent + // to `git check-ignore` + if (!REGEX_TEST_TRAILING_SLASH.test(path)) { + return this.test(path) + } + + const slices = path.split(SLASH).filter(Boolean) + slices.pop() + + if (slices.length) { + const parent = this._t( + slices.join(SLASH) + SLASH, + this._testCache, + true, + slices + ) + + if (parent.ignored) { + return parent + } + } + + return this._rules.test(path, false, MODE_CHECK_IGNORE) + } + + _t ( + // The path to be tested + path, + + // The cache for the result of a certain checking + cache, + + // Whether should check if the path is unignored + checkUnignored, + + // The path slices + slices + ) { + if (path in cache) { + return cache[path] + } + + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH).filter(Boolean) + } + + slices.pop() + + // If the path has no parent directory, just test it + if (!slices.length) { + return cache[path] = this._rules.test(path, checkUnignored, MODE_IGNORE) + } + + const parent = this._t( + slices.join(SLASH) + SLASH, + cache, + checkUnignored, + slices + ) + + // If the path contains a parent directory, check the parent first + return cache[path] = parent.ignored + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + ? parent + : this._rules.test(path, checkUnignored, MODE_IGNORE) + } + + ignores (path) { + return this._test(path, this._ignoreCache, false).ignored + } + + createFilter () { + return path => !this.ignores(path) + } + + filter (paths) { + return makeArray(paths).filter(this.createFilter()) + } + + // @returns {TestResult} + test (path) { + return this._test(path, this._testCache, true) + } +} + +const factory = options => new Ignore(options) + +const isPathValid = path => + checkPath(path && checkPath.convert(path), path, RETURN_FALSE) + +/* istanbul ignore next */ +const setupWindows = () => { + /* eslint no-control-regex: "off" */ + const makePosix = str => /^\\\\\?\\/.test(str) + || /["<>|\u0000-\u001F]+/u.test(str) + ? str + : str.replace(/\\/g, '/') + + checkPath.convert = makePosix + + // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' + // 'd:\\foo' + const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i + checkPath.isNotRelative = path => + REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path) + || isNotRelative(path) +} + + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore next */ +if ( + // Detect `process` so that it can run in browsers. + typeof process !== 'undefined' + && process.platform === 'win32' +) { + setupWindows() +} + +// COMMONJS_EXPORTS //////////////////////////////////////////////////////////// + +module.exports = factory + +// Although it is an anti-pattern, +// it is still widely misused by a lot of libraries in github +// Ref: https://github.com/search?q=ignore.default%28%29&type=code +factory.default = factory + +module.exports.isPathValid = isPathValid + +// For testing purposes +define(module.exports, Symbol.for('setupWindows'), setupWindows) diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/legacy.js b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/legacy.js new file mode 100644 index 0000000000000000000000000000000000000000..13c03d7cf1fa1aa2ff9b64b6f62a0cffedf4efb5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/legacy.js @@ -0,0 +1,681 @@ +"use strict"; + +var _TRAILING_WILD_CARD_R; +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } +function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +// A simple implementation of make-array +function makeArray(subject) { + return Array.isArray(subject) ? subject : [subject]; +} +var UNDEFINED = undefined; +var EMPTY = ''; +var SPACE = ' '; +var ESCAPE = '\\'; +var REGEX_TEST_BLANK_LINE = /^\s+$/; +var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; +var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; +var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; +var REGEX_SPLITALL_CRLF = /\r?\n/g; + +// Invalid: +// - /foo, +// - ./foo, +// - ../foo, +// - . +// - .. +// Valid: +// - .foo +var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/; +var REGEX_TEST_TRAILING_SLASH = /\/$/; +var SLASH = '/'; + +// Do not use ternary expression here, since "istanbul ignore next" is buggy +var TMP_KEY_IGNORE = 'node-ignore'; +/* istanbul ignore else */ +if (typeof Symbol !== 'undefined') { + TMP_KEY_IGNORE = Symbol["for"]('node-ignore'); +} +var KEY_IGNORE = TMP_KEY_IGNORE; +var define = function define(object, key, value) { + Object.defineProperty(object, key, { + value: value + }); + return value; +}; +var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; +var RETURN_FALSE = function RETURN_FALSE() { + return false; +}; + +// Sanitize the range of a regular expression +// The cases are complicated, see test cases for details +var sanitizeRange = function sanitizeRange(range) { + return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) { + return from.charCodeAt(0) <= to.charCodeAt(0) ? match + // Invalid range (out of order) which is ok for gitignore rules but + // fatal for JavaScript regular expression, so eliminate it. + : EMPTY; + }); +}; + +// See fixtures #59 +var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) { + var length = slashes.length; + return slashes.slice(0, length - length % 2); +}; + +// > If the pattern ends with a slash, +// > it is removed for the purpose of the following description, +// > but it would only find a match with a directory. +// > In other words, foo/ will match a directory foo and paths underneath it, +// > but will not match a regular file or a symbolic link foo +// > (this is consistent with the way how pathspec works in general in Git). +// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`' +// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call +// you could use option `mark: true` with `glob` + +// '`foo/`' should not continue with the '`..`' +var REPLACERS = [[ +// Remove BOM +// TODO: +// Other similar zero-width characters? +/^\uFEFF/, function () { + return EMPTY; +}], +// > Trailing spaces are ignored unless they are quoted with backslash ("\") +[ +// (a\ ) -> (a ) +// (a ) -> (a) +// (a ) -> (a) +// (a \ ) -> (a ) +/((?:\\\\)*?)(\\?\s+)$/, function (_, m1, m2) { + return m1 + (m2.indexOf('\\') === 0 ? SPACE : EMPTY); +}], +// Replace (\ ) with ' ' +// (\ ) -> ' ' +// (\\ ) -> '\\ ' +// (\\\ ) -> '\\ ' +[/(\\+?)\s/g, function (_, m1) { + var length = m1.length; + return m1.slice(0, length - length % 2) + SPACE; +}], +// Escape metacharacters +// which is written down by users but means special for regular expressions. + +// > There are 12 characters with special meanings: +// > - the backslash \, +// > - the caret ^, +// > - the dollar sign $, +// > - the period or dot ., +// > - the vertical bar or pipe symbol |, +// > - the question mark ?, +// > - the asterisk or star *, +// > - the plus sign +, +// > - the opening parenthesis (, +// > - the closing parenthesis ), +// > - and the opening square bracket [, +// > - the opening curly brace {, +// > These special characters are often called "metacharacters". +[/[\\$.|*+(){^]/g, function (match) { + return "\\".concat(match); +}], [ +// > a question mark (?) matches a single character +/(?!\\)\?/g, function () { + return '[^/]'; +}], +// leading slash +[ +// > A leading slash matches the beginning of the pathname. +// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". +// A leading slash matches the beginning of the pathname +/^\//, function () { + return '^'; +}], +// replace special metacharacter slash after the leading slash +[/\//g, function () { + return '\\/'; +}], [ +// > A leading "**" followed by a slash means match in all directories. +// > For example, "**/foo" matches file or directory "foo" anywhere, +// > the same as pattern "foo". +// > "**/foo/bar" matches file or directory "bar" anywhere that is directly +// > under directory "foo". +// Notice that the '*'s have been replaced as '\\*' +/^\^*\\\*\\\*\\\//, +// '**/foo' <-> 'foo' +function () { + return '^(?:.*\\/)?'; +}], +// starting +[ +// there will be no leading '/' +// (which has been replaced by section "leading slash") +// If starts with '**', adding a '^' to the regular expression also works +/^(?=[^^])/, function startingReplacer() { + // If has a slash `/` at the beginning or middle + return !/\/(?!$)/.test(this) + // > Prior to 2.22.1 + // > If the pattern does not contain a slash /, + // > Git treats it as a shell glob pattern + // Actually, if there is only a trailing slash, + // git also treats it as a shell glob pattern + + // After 2.22.1 (compatible but clearer) + // > If there is a separator at the beginning or middle (or both) + // > of the pattern, then the pattern is relative to the directory + // > level of the particular .gitignore file itself. + // > Otherwise the pattern may also match at any level below + // > the .gitignore level. + ? '(?:^|\\/)' + + // > Otherwise, Git treats the pattern as a shell glob suitable for + // > consumption by fnmatch(3) + : '^'; +}], +// two globstars +[ +// Use lookahead assertions so that we could match more than one `'/**'` +/\\\/\\\*\\\*(?=\\\/|$)/g, +// Zero, one or several directories +// should not use '*', or it will be replaced by the next replacer + +// Check if it is not the last `'/**'` +function (_, index, str) { + return index + 6 < str.length + + // case: /**/ + // > A slash followed by two consecutive asterisks then a slash matches + // > zero or more directories. + // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on. + // '/**/' + ? '(?:\\/[^\\/]+)*' + + // case: /** + // > A trailing `"/**"` matches everything inside. + + // #21: everything inside but it should not include the current folder + : '\\/.+'; +}], +// normal intermediate wildcards +[ +// Never replace escaped '*' +// ignore rule '\*' will match the path '*' + +// 'abc.*/' -> go +// 'abc.*' -> skip this rule, +// coz trailing single wildcard will be handed by [trailing wildcard] +/(^|[^\\]+)(\\\*)+(?=.+)/g, +// '*.js' matches '.js' +// '*.js' doesn't match 'abc' +function (_, p1, p2) { + // 1. + // > An asterisk "*" matches anything except a slash. + // 2. + // > Other consecutive asterisks are considered regular asterisks + // > and will match according to the previous rules. + var unescaped = p2.replace(/\\\*/g, '[^\\/]*'); + return p1 + unescaped; +}], [ +// unescape, revert step 3 except for back slash +// For example, if a user escape a '\\*', +// after step 3, the result will be '\\\\\\*' +/\\\\\\(?=[$.|*+(){^])/g, function () { + return ESCAPE; +}], [ +// '\\\\' -> '\\' +/\\\\/g, function () { + return ESCAPE; +}], [ +// > The range notation, e.g. [a-zA-Z], +// > can be used to match one of the characters in a range. + +// `\` is escaped by step 3 +/(\\)?\[([^\]/]*?)(\\*)($|\])/g, function (match, leadEscape, range, endEscape, close) { + return leadEscape === ESCAPE + // '\\[bar]' -> '\\\\[bar\\]' + ? "\\[".concat(range).concat(cleanRangeBackSlash(endEscape)).concat(close) : close === ']' ? endEscape.length % 2 === 0 + // A normal case, and it is a range notation + // '[bar]' + // '[bar\\\\]' + ? "[".concat(sanitizeRange(range)).concat(endEscape, "]") // Invalid range notaton + // '[bar\\]' -> '[bar\\\\]' + : '[]' : '[]'; +}], +// ending +[ +// 'js' will not match 'js.' +// 'ab' will not match 'abc' +/(?:[^*])$/, +// WTF! +// https://git-scm.com/docs/gitignore +// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) +// which re-fixes #24, #38 + +// > If there is a separator at the end of the pattern then the pattern +// > will only match directories, otherwise the pattern can match both +// > files and directories. + +// 'js*' will not match 'a.js' +// 'js/' will not match 'a.js' +// 'js' will match 'a.js' and 'a.js/' +function (match) { + return /\/$/.test(match) + // foo/ will not match 'foo' + ? "".concat(match, "$") // foo matches 'foo' and 'foo/' + : "".concat(match, "(?=$|\\/$)"); +}]]; +var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/; +var MODE_IGNORE = 'regex'; +var MODE_CHECK_IGNORE = 'checkRegex'; +var UNDERSCORE = '_'; +var TRAILING_WILD_CARD_REPLACERS = (_TRAILING_WILD_CARD_R = {}, _defineProperty(_TRAILING_WILD_CARD_R, MODE_IGNORE, function (_, p1) { + var prefix = p1 + // '\^': + // '/*' does not match EMPTY + // '/*' does not match everything + + // '\\\/': + // 'abc/*' does not match 'abc/' + ? "".concat(p1, "[^/]+") // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*'; + return "".concat(prefix, "(?=$|\\/$)"); +}), _defineProperty(_TRAILING_WILD_CARD_R, MODE_CHECK_IGNORE, function (_, p1) { + // When doing `git check-ignore` + var prefix = p1 + // '\\\/': + // 'abc/*' DOES match 'abc/' ! + ? "".concat(p1, "[^/]*") // 'a*' matches 'a' + // 'a*' matches 'aa' + : '[^/]*'; + return "".concat(prefix, "(?=$|\\/$)"); +}), _TRAILING_WILD_CARD_R); + +// @param {pattern} +var makeRegexPrefix = function makeRegexPrefix(pattern) { + return REPLACERS.reduce(function (prev, _ref) { + var _ref2 = _slicedToArray(_ref, 2), + matcher = _ref2[0], + replacer = _ref2[1]; + return prev.replace(matcher, replacer.bind(pattern)); + }, pattern); +}; +var isString = function isString(subject) { + return typeof subject === 'string'; +}; + +// > A blank line matches no files, so it can serve as a separator for readability. +var checkPattern = function checkPattern(pattern) { + return pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) + + // > A line starting with # serves as a comment. + && pattern.indexOf('#') !== 0; +}; +var splitPattern = function splitPattern(pattern) { + return pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean); +}; +var IgnoreRule = /*#__PURE__*/function () { + function IgnoreRule(pattern, mark, body, ignoreCase, negative, prefix) { + _classCallCheck(this, IgnoreRule); + this.pattern = pattern; + this.mark = mark; + this.negative = negative; + define(this, 'body', body); + define(this, 'ignoreCase', ignoreCase); + define(this, 'regexPrefix', prefix); + } + _createClass(IgnoreRule, [{ + key: "regex", + get: function get() { + var key = UNDERSCORE + MODE_IGNORE; + if (this[key]) { + return this[key]; + } + return this._make(MODE_IGNORE, key); + } + }, { + key: "checkRegex", + get: function get() { + var key = UNDERSCORE + MODE_CHECK_IGNORE; + if (this[key]) { + return this[key]; + } + return this._make(MODE_CHECK_IGNORE, key); + } + }, { + key: "_make", + value: function _make(mode, key) { + var str = this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD, + // It does not need to bind pattern + TRAILING_WILD_CARD_REPLACERS[mode]); + var regex = this.ignoreCase ? new RegExp(str, 'i') : new RegExp(str); + return define(this, key, regex); + } + }]); + return IgnoreRule; +}(); +var createRule = function createRule(_ref3, ignoreCase) { + var pattern = _ref3.pattern, + mark = _ref3.mark; + var negative = false; + var body = pattern; + + // > An optional prefix "!" which negates the pattern; + if (body.indexOf('!') === 0) { + negative = true; + body = body.substr(1); + } + body = body + // > Put a backslash ("\") in front of the first "!" for patterns that + // > begin with a literal "!", for example, `"\!important!.txt"`. + .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!') + // > Put a backslash ("\") in front of the first hash for patterns that + // > begin with a hash. + .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#'); + var regexPrefix = makeRegexPrefix(body); + return new IgnoreRule(pattern, mark, body, ignoreCase, negative, regexPrefix); +}; +var RuleManager = /*#__PURE__*/function () { + function RuleManager(ignoreCase) { + _classCallCheck(this, RuleManager); + this._ignoreCase = ignoreCase; + this._rules = []; + } + _createClass(RuleManager, [{ + key: "_add", + value: function _add(pattern) { + // #32 + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules._rules); + this._added = true; + return; + } + if (isString(pattern)) { + pattern = { + pattern: pattern + }; + } + if (checkPattern(pattern.pattern)) { + var rule = createRule(pattern, this._ignoreCase); + this._added = true; + this._rules.push(rule); + } + } + + // @param {Array | string | Ignore} pattern + }, { + key: "add", + value: function add(pattern) { + this._added = false; + makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._add, this); + return this._added; + } + + // Test one single path without recursively checking parent directories + // + // - checkUnignored `boolean` whether should check if the path is unignored, + // setting `checkUnignored` to `false` could reduce additional + // path matching. + // - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE` + + // @returns {TestResult} true if a file is ignored + }, { + key: "test", + value: function test(path, checkUnignored, mode) { + var ignored = false; + var unignored = false; + var matchedRule; + this._rules.forEach(function (rule) { + var negative = rule.negative; + + // | ignored : unignored + // -------- | --------------------------------------- + // negative | 0:0 | 0:1 | 1:0 | 1:1 + // -------- | ------- | ------- | ------- | -------- + // 0 | TEST | TEST | SKIP | X + // 1 | TESTIF | SKIP | TEST | X + + // - SKIP: always skip + // - TEST: always test + // - TESTIF: only test if checkUnignored + // - X: that never happen + if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { + return; + } + var matched = rule[mode].test(path); + if (!matched) { + return; + } + ignored = !negative; + unignored = negative; + matchedRule = negative ? UNDEFINED : rule; + }); + var ret = { + ignored: ignored, + unignored: unignored + }; + if (matchedRule) { + ret.rule = matchedRule; + } + return ret; + } + }]); + return RuleManager; +}(); +var throwError = function throwError(message, Ctor) { + throw new Ctor(message); +}; +var checkPath = function checkPath(path, originalPath, doThrow) { + if (!isString(path)) { + return doThrow("path must be a string, but got `".concat(originalPath, "`"), TypeError); + } + + // We don't know if we should ignore EMPTY, so throw + if (!path) { + return doThrow("path must not be empty", TypeError); + } + + // Check if it is a relative path + if (checkPath.isNotRelative(path)) { + var r = '`path.relative()`d'; + return doThrow("path should be a ".concat(r, " string, but got \"").concat(originalPath, "\""), RangeError); + } + return true; +}; +var isNotRelative = function isNotRelative(path) { + return REGEX_TEST_INVALID_PATH.test(path); +}; +checkPath.isNotRelative = isNotRelative; + +// On windows, the following function will be replaced +/* istanbul ignore next */ +checkPath.convert = function (p) { + return p; +}; +var Ignore = /*#__PURE__*/function () { + function Ignore() { + var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref4$ignorecase = _ref4.ignorecase, + ignorecase = _ref4$ignorecase === void 0 ? true : _ref4$ignorecase, + _ref4$ignoreCase = _ref4.ignoreCase, + ignoreCase = _ref4$ignoreCase === void 0 ? ignorecase : _ref4$ignoreCase, + _ref4$allowRelativePa = _ref4.allowRelativePaths, + allowRelativePaths = _ref4$allowRelativePa === void 0 ? false : _ref4$allowRelativePa; + _classCallCheck(this, Ignore); + define(this, KEY_IGNORE, true); + this._rules = new RuleManager(ignoreCase); + this._strictPathCheck = !allowRelativePaths; + this._initCache(); + } + _createClass(Ignore, [{ + key: "_initCache", + value: function _initCache() { + // A cache for the result of `.ignores()` + this._ignoreCache = Object.create(null); + + // A cache for the result of `.test()` + this._testCache = Object.create(null); + } + }, { + key: "add", + value: function add(pattern) { + if (this._rules.add(pattern)) { + // Some rules have just added to the ignore, + // making the behavior changed, + // so we need to re-initialize the result cache + this._initCache(); + } + return this; + } + + // legacy + }, { + key: "addPattern", + value: function addPattern(pattern) { + return this.add(pattern); + } + + // @returns {TestResult} + }, { + key: "_test", + value: function _test(originalPath, cache, checkUnignored, slices) { + var path = originalPath + // Supports nullable path + && checkPath.convert(originalPath); + checkPath(path, originalPath, this._strictPathCheck ? throwError : RETURN_FALSE); + return this._t(path, cache, checkUnignored, slices); + } + }, { + key: "checkIgnore", + value: function checkIgnore(path) { + // If the path doest not end with a slash, `.ignores()` is much equivalent + // to `git check-ignore` + if (!REGEX_TEST_TRAILING_SLASH.test(path)) { + return this.test(path); + } + var slices = path.split(SLASH).filter(Boolean); + slices.pop(); + if (slices.length) { + var parent = this._t(slices.join(SLASH) + SLASH, this._testCache, true, slices); + if (parent.ignored) { + return parent; + } + } + return this._rules.test(path, false, MODE_CHECK_IGNORE); + } + }, { + key: "_t", + value: function _t( + // The path to be tested + path, + // The cache for the result of a certain checking + cache, + // Whether should check if the path is unignored + checkUnignored, + // The path slices + slices) { + if (path in cache) { + return cache[path]; + } + if (!slices) { + // path/to/a.js + // ['path', 'to', 'a.js'] + slices = path.split(SLASH).filter(Boolean); + } + slices.pop(); + + // If the path has no parent directory, just test it + if (!slices.length) { + return cache[path] = this._rules.test(path, checkUnignored, MODE_IGNORE); + } + var parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices); + + // If the path contains a parent directory, check the parent first + return cache[path] = parent.ignored + // > It is not possible to re-include a file if a parent directory of + // > that file is excluded. + ? parent : this._rules.test(path, checkUnignored, MODE_IGNORE); + } + }, { + key: "ignores", + value: function ignores(path) { + return this._test(path, this._ignoreCache, false).ignored; + } + }, { + key: "createFilter", + value: function createFilter() { + var _this = this; + return function (path) { + return !_this.ignores(path); + }; + } + }, { + key: "filter", + value: function filter(paths) { + return makeArray(paths).filter(this.createFilter()); + } + + // @returns {TestResult} + }, { + key: "test", + value: function test(path) { + return this._test(path, this._testCache, true); + } + }]); + return Ignore; +}(); +var factory = function factory(options) { + return new Ignore(options); +}; +var isPathValid = function isPathValid(path) { + return checkPath(path && checkPath.convert(path), path, RETURN_FALSE); +}; + +/* istanbul ignore next */ +var setupWindows = function setupWindows() { + /* eslint no-control-regex: "off" */ + var makePosix = function makePosix(str) { + return /^\\\\\?\\/.test(str) || /[\0-\x1F"<>\|]+/.test(str) ? str : str.replace(/\\/g, '/'); + }; + checkPath.convert = makePosix; + + // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/' + // 'd:\\foo' + var REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; + checkPath.isNotRelative = function (path) { + return REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path); + }; +}; + +// Windows +// -------------------------------------------------------------- +/* istanbul ignore next */ +if ( +// Detect `process` so that it can run in browsers. +typeof process !== 'undefined' && process.platform === 'win32') { + setupWindows(); +} + +// COMMONJS_EXPORTS //////////////////////////////////////////////////////////// + +module.exports = factory; + +// Although it is an anti-pattern, +// it is still widely misused by a lot of libraries in github +// Ref: https://github.com/search?q=ignore.default%28%29&type=code +factory["default"] = factory; +module.exports.isPathValid = isPathValid; + +// For testing purposes +define(module.exports, Symbol["for"]('setupWindows'), setupWindows); diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/package.json b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d787bc4d1dc3417121bf6a080e2f4b1514c5d6c3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore/package.json @@ -0,0 +1,87 @@ +{ + "name": "ignore", + "version": "7.0.5", + "description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.", + "types": "index.d.ts", + "files": [ + "legacy.js", + "index.js", + "index.d.ts", + "LICENSE-MIT" + ], + "scripts": { + "prepublishOnly": "npm run build", + "build": "babel -o legacy.js index.js", + + "==================== linting ======================": "", + "lint": "eslint .", + + "===================== import ======================": "", + "ts": "npm run test:ts && npm run test:16", + "test:ts": "ts-node ./test/import/simple.ts", + "test:16": "npm run test:ts:16 && npm run test:cjs:16 && npm run test:mjs:16", + "test:ts:16": "ts-node --compilerOptions '{\"moduleResolution\": \"Node16\", \"module\": \"Node16\"}' ./test/import/simple.ts && tsc ./test/import/simple.ts --lib ES6 --moduleResolution Node16 --module Node16 && node ./test/import/simple.js", + "test:cjs:16": "ts-node --compilerOptions '{\"moduleResolution\": \"Node16\", \"module\": \"Node16\"}' ./test/import/simple.cjs", + "test:mjs:16": "ts-node --compilerOptions '{\"moduleResolution\": \"Node16\", \"module\": \"Node16\"}' ./test/import/simple.mjs && babel -o ./test/import/simple-mjs.js ./test/import/simple.mjs && node ./test/import/simple-mjs.js", + + "===================== cases =======================": "", + "test:cases": "npm run tap test/*.test.js -- --coverage", + "tap": "tap --reporter classic", + + "===================== debug =======================": "", + "test:git": "npm run tap test/git-check-ignore.test.js", + "test:ignore": "npm run tap test/ignore.test.js", + "test:ignore:only": "IGNORE_ONLY_IGNORES=1 npm run tap test/ignore.test.js", + "test:others": "npm run tap test/others.test.js", + "test:no-coverage": "npm run tap test/*.test.js -- --no-check-coverage", + + "test": "npm run lint && npm run ts && npm run build && npm run test:cases", + "test:win32": "IGNORE_TEST_WIN32=1 npm run test", + "report": "tap --coverage-report=html" + }, + "repository": { + "type": "git", + "url": "git@github.com:kaelzhang/node-ignore.git" + }, + "keywords": [ + "ignore", + ".gitignore", + "gitignore", + "npmignore", + "rules", + "manager", + "filter", + "regexp", + "regex", + "fnmatch", + "glob", + "asterisks", + "regular-expression" + ], + "author": "kael", + "license": "MIT", + "bugs": { + "url": "https://github.com/kaelzhang/node-ignore/issues" + }, + "devDependencies": { + "@babel/cli": "^7.22.9", + "@babel/core": "^7.22.9", + "@babel/preset-env": "^7.22.9", + "@typescript-eslint/eslint-plugin": "^8.19.1", + "debug": "^4.3.4", + "eslint": "^8.46.0", + "eslint-config-ostai": "^3.0.0", + "eslint-plugin-import": "^2.28.0", + "mkdirp": "^3.0.1", + "pre-suf": "^1.1.1", + "rimraf": "^6.0.1", + "spawn-sync": "^2.0.0", + "tap": "^16.3.9", + "tmp": "0.2.3", + "ts-node": "^10.9.2", + "typescript": "^5.6.2" + }, + "engines": { + "node": ">= 4" + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/package.json b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/package.json new file mode 100644 index 0000000000000000000000000000000000000000..713d31fdb943015fb3b599bc11d4fc60d6aafa4d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/package.json @@ -0,0 +1,126 @@ +{ + "name": "@typescript-eslint/eslint-plugin", + "version": "8.60.1", + "description": "TypeScript plugin for ESLint", + "files": [ + "dist", + "!**/*.tsbuildinfo", + "index.d.ts", + "raw-plugin.d.ts", + "rules.d.ts", + "package.json", + "./README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json", + "./use-at-your-own-risk/rules": { + "types": "./rules.d.ts", + "default": "./dist/rules/index.js" + }, + "./use-at-your-own-risk/raw-plugin": { + "types": "./raw-plugin.d.ts", + "default": "./dist/raw-plugin.js" + } + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/eslint-plugin" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io/packages/eslint-plugin", + "license": "MIT", + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin", + "typescript" + ], + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0", + "@typescript-eslint/utils": "8.60.1", + "@typescript-eslint/type-utils": "8.60.1", + "@typescript-eslint/scope-manager": "8.60.1", + "@typescript-eslint/visitor-keys": "8.60.1" + }, + "devDependencies": { + "@types/json-schema": "^7.0.15", + "@types/mdast": "^4.0.4", + "@types/natural-compare": "^1.4.3", + "@types/react": "^18.3.21", + "@typescript/native-preview": "7.0.0-dev.20260518.1", + "@vitest/coverage-v8": "^4.0.18", + "ajv": "^6.12.6", + "eslint": "^10.0.0", + "json-schema": "^0.4.0", + "markdown-table": "^3.0.4", + "marked": "^15.0.12", + "mdast-util-from-markdown": "^2.0.2", + "mdast-util-mdx": "^3.0.0", + "micromark-extension-mdxjs": "^3.0.0", + "prettier": "3.8.0", + "rimraf": "^5.0.10", + "title-case": "^4.3.2", + "tsx": "^4.7.2", + "typescript": ">=4.8.4 <6.1.0", + "unist-util-visit": "^5.0.0", + "vitest": "^4.0.18", + "@typescript-eslint/rule-schema-to-typescript-types": "8.60.1", + "@typescript-eslint/rule-tester": "8.60.1" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0", + "@typescript-eslint/parser": "^8.60.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "eslint-plugin", + "includedScripts": [ + "clean" + ], + "targets": { + "generate-breaking-changes": { + "command": "tsx tools/generate-breaking-changes.mts", + "options": { + "cwd": "{projectRoot}" + }, + "dependsOn": [ + "type-utils:build" + ] + }, + "lint": { + "command": "eslint" + }, + "typecheck:tsgo": {} + } + }, + "scripts": { + "build": "pnpm -w exec nx build", + "clean": "rimraf dist/ coverage/", + "format": "pnpm -w run format", + "generate-breaking-changes": "tsx tools/generate-breaking-changes.mts", + "generate-configs": "pnpm -w run generate-configs", + "lint": "pnpm -w exec nx lint", + "test": "pnpm -w exec nx test", + "typecheck": "pnpm -w exec nx typecheck", + "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/raw-plugin.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/raw-plugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..25a093aba9023301f6597aef604abce93c085400 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/raw-plugin.d.ts @@ -0,0 +1,25 @@ +import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint'; + +import type plugin from './index'; + +declare const cjsExport: { + flatConfigs: { + 'flat/all': FlatConfig.ConfigArray; + 'flat/base': FlatConfig.Config; + 'flat/disable-type-checked': FlatConfig.Config; + 'flat/eslint-recommended': FlatConfig.Config; + 'flat/recommended': FlatConfig.ConfigArray; + 'flat/recommended-type-checked': FlatConfig.ConfigArray; + 'flat/recommended-type-checked-only': FlatConfig.ConfigArray; + 'flat/strict': FlatConfig.ConfigArray; + 'flat/strict-type-checked': FlatConfig.ConfigArray; + 'flat/strict-type-checked-only': FlatConfig.ConfigArray; + 'flat/stylistic': FlatConfig.ConfigArray; + 'flat/stylistic-type-checked': FlatConfig.ConfigArray; + 'flat/stylistic-type-checked-only': FlatConfig.ConfigArray; + }; + parser: FlatConfig.Parser; + plugin: typeof plugin; +}; + +export = cjsExport; diff --git a/tools/ui/node_modules/@typescript-eslint/eslint-plugin/rules.d.ts b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/rules.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..db19c5d6959145481eba9866db6d665c624bb0e1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/eslint-plugin/rules.d.ts @@ -0,0 +1,87 @@ +/* +We purposely don't generate types for our plugin because TL;DR: +1) there's no real reason that anyone should do a typed import of our rules, +2) it would require us to change our code so there aren't as many inferred types + +This type declaration exists as a hacky way to add a type to the export for our +internal packages that require it. + +*** Long reason *** + +When you turn on declaration files, TS requires all types to be "fully resolvable" +without changes to the code. +All of our lint rules `export default createRule(...)`, which means they all +implicitly reference the `TSESLint.Rule` type for the export. + +TS wants to transpile each rule file to this `.d.ts` file: + +```ts +import type { TSESLint } from '@typescript-eslint/utils'; +declare const _default: TSESLint.RuleModule; +export default _default; +``` + +Because we don't import `TSESLint` in most files, it means that TS would have to +insert a new import during the declaration emit to make this work. +However TS wants to avoid adding new imports to the file because a new module +could have type side-effects (like global augmentation) which could cause weird +type side-effects in the decl file that wouldn't exist in source TS file. + +So TS errors on most of our rules with the following error: +``` +The inferred type of 'default' cannot be named without a reference to +'../../../../node_modules/@typescript-eslint/utils/src/ts-eslint/Rule'. +This is likely not portable. A type annotation is necessary. ts(2742) +``` +*/ +/* eslint-disable no-restricted-syntax */ + +import type { + RuleModuleWithMetaDocs, + RuleRecommendation, + RuleRecommendationAcrossConfigs, +} from '@typescript-eslint/utils/ts-eslint'; + +interface ESLintPluginDocs { + /** + * Does the rule extend (or is it based off of) an ESLint code rule? + * Alternately accepts the name of the base rule, in case the rule has been renamed. + * This is only used for documentation purposes. + */ + extendsBaseRule?: boolean | string; + + /** + * If a string config name, which starting config this rule is enabled in. + * If an object, which settings it has enabled in each of those configs. + */ + recommended?: RuleRecommendation | RuleRecommendationAcrossConfigs; + + /** + * Does the rule require us to create a full TypeScript Program in order for it + * to type-check code. This is only used for documentation purposes. + */ + requiresTypeChecking?: boolean; +} + +type ESLintPluginRuleModule = RuleModuleWithMetaDocs< + string, + readonly unknown[], + ESLintPluginDocs +>; + +type TypeScriptESLintRules = Record< + string, + RuleModuleWithMetaDocs +>; + +declare const rules: TypeScriptESLintRules; + +declare namespace rules { + export type { + ESLintPluginDocs, + ESLintPluginRuleModule, + TypeScriptESLintRules, + }; +} + +export = rules; diff --git a/tools/ui/node_modules/@typescript-eslint/parser/LICENSE b/tools/ui/node_modules/@typescript-eslint/parser/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a1164108d4d6037cb976384c16e5493917d87157 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/parser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/@typescript-eslint/parser/README.md b/tools/ui/node_modules/@typescript-eslint/parser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..56ee655a56b09c65599bfc06b5d711a65a3c2858 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/parser/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/parser` + +> An ESLint parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/parser.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/parser) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/parser.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/parser) + +👉 See **https://typescript-eslint.io/packages/parser** for documentation on this package. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/tools/ui/node_modules/@typescript-eslint/parser/dist/index.d.ts b/tools/ui/node_modules/@typescript-eslint/parser/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bd61733b27e885d9150bc31cd4dd7267077cc435 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/parser/dist/index.d.ts @@ -0,0 +1,7 @@ +export { parse, parseForESLint, type ParserOptions } from './parser'; +export { clearCaches, createProgram, type ParserServices, type ParserServicesWithoutTypeInformation, type ParserServicesWithTypeInformation, withoutProjectParserOptions, } from '@typescript-eslint/typescript-estree'; +export declare const version: string; +export declare const meta: { + name: string; + version: string; +}; diff --git a/tools/ui/node_modules/@typescript-eslint/parser/dist/index.js b/tools/ui/node_modules/@typescript-eslint/parser/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..47ea577fdbea4494f5c77e3883603d15c6e93821 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/parser/dist/index.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.meta = exports.version = exports.withoutProjectParserOptions = exports.createProgram = exports.clearCaches = exports.parseForESLint = exports.parse = void 0; +var parser_1 = require("./parser"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parser_1.parse; } }); +Object.defineProperty(exports, "parseForESLint", { enumerable: true, get: function () { return parser_1.parseForESLint; } }); +var typescript_estree_1 = require("@typescript-eslint/typescript-estree"); +Object.defineProperty(exports, "clearCaches", { enumerable: true, get: function () { return typescript_estree_1.clearCaches; } }); +Object.defineProperty(exports, "createProgram", { enumerable: true, get: function () { return typescript_estree_1.createProgram; } }); +Object.defineProperty(exports, "withoutProjectParserOptions", { enumerable: true, get: function () { return typescript_estree_1.withoutProjectParserOptions; } }); +// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access +exports.version = require('../package.json').version; +exports.meta = { + name: 'typescript-eslint/parser', + version: exports.version, +}; diff --git a/tools/ui/node_modules/@typescript-eslint/parser/dist/parser.d.ts b/tools/ui/node_modules/@typescript-eslint/parser/dist/parser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3dd68c067cce0d6ed98ee0bdafb5fd5a410abbca --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/parser/dist/parser.d.ts @@ -0,0 +1,22 @@ +import type { ScopeManager } from '@typescript-eslint/scope-manager'; +import type { ParserOptions, TSESTree } from '@typescript-eslint/types'; +import type { AST, ParserServices } from '@typescript-eslint/typescript-estree'; +import type { VisitorKeys } from '@typescript-eslint/visitor-keys'; +import type * as ts from 'typescript'; +interface ESLintProgram extends AST<{ + comment: true; + tokens: true; +}> { + comments: TSESTree.Comment[]; + range: [number, number]; + tokens: TSESTree.Token[]; +} +interface ParseForESLintResult { + ast: ESLintProgram; + scopeManager: ScopeManager; + services: ParserServices; + visitorKeys: VisitorKeys; +} +export declare function parse(code: string | ts.SourceFile, options?: ParserOptions): ParseForESLintResult['ast']; +export declare function parseForESLint(code: string | ts.SourceFile, parserOptions?: ParserOptions | null): ParseForESLintResult; +export type { ParserOptions } from '@typescript-eslint/types'; diff --git a/tools/ui/node_modules/@typescript-eslint/parser/dist/parser.js b/tools/ui/node_modules/@typescript-eslint/parser/dist/parser.js new file mode 100644 index 0000000000000000000000000000000000000000..c13ab5fa8122ec73918f9d5d13898271b904ef36 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/parser/dist/parser.js @@ -0,0 +1,144 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parse = parse; +exports.parseForESLint = parseForESLint; +const scope_manager_1 = require("@typescript-eslint/scope-manager"); +const typescript_estree_1 = require("@typescript-eslint/typescript-estree"); +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +const debug_1 = __importDefault(require("debug")); +const typescript_1 = require("typescript"); +const log = (0, debug_1.default)('typescript-eslint:parser:parser'); +function validateBoolean(value, fallback = false) { + if (typeof value !== 'boolean') { + return fallback; + } + return value; +} +const LIB_FILENAME_REGEX = /lib\.(.+)\.d\.[cm]?ts$/; +function getLib(compilerOptions) { + if (compilerOptions.lib) { + return compilerOptions.lib + .map(lib => LIB_FILENAME_REGEX.exec(lib.toLowerCase())?.[1]) + .filter((lib) => !!lib); + } + const defaultTarget = typescript_estree_1.typescriptVersionIsAtLeast['6.0'] + ? typescript_1.ScriptTarget.LatestStandard + : typescript_1.ScriptTarget.ES5; // eslint-disable-line @typescript-eslint/no-deprecated -- Deprecated in TS 6 but we support TS < 6 + const target = compilerOptions.target ?? defaultTarget; + // https://github.com/microsoft/TypeScript/blob/35ff23d4b0cc715691323ebe54f523c16fe6e3a5/src/compiler/utilitiesPublic.ts#L312-L346 + switch (target) { + case typescript_1.ScriptTarget.ES2015: + return ['es6']; + case typescript_1.ScriptTarget.ES2016: + return ['es2016.full']; + case typescript_1.ScriptTarget.ES2017: + return ['es2017.full']; + case typescript_1.ScriptTarget.ES2018: + return ['es2018.full']; + case typescript_1.ScriptTarget.ES2019: + return ['es2019.full']; + case typescript_1.ScriptTarget.ES2020: + return ['es2020.full']; + case typescript_1.ScriptTarget.ES2021: + return ['es2021.full']; + case typescript_1.ScriptTarget.ES2022: + return ['es2022.full']; + case typescript_1.ScriptTarget.ES2023: + return ['es2023.full']; + case typescript_1.ScriptTarget.ES2024: + return ['es2024.full']; + case typescript_1.ScriptTarget.ES2025: + return ['es2025.full']; + case typescript_1.ScriptTarget.ESNext: + return ['esnext.full']; + default: + return ['lib']; + } +} +function parse(code, options) { + return parseForESLint(code, options).ast; +} +function parseForESLint(code, parserOptions) { + if (!parserOptions || typeof parserOptions !== 'object') { + parserOptions = {}; + } + else { + parserOptions = { ...parserOptions }; + } + // https://eslint.org/docs/user-guide/configuring#specifying-parser-options + // if sourceType is not provided by default eslint expect that it will be set to "script" + if (parserOptions.sourceType !== 'module' && + parserOptions.sourceType !== 'script') { + parserOptions.sourceType = 'script'; + } + if (typeof parserOptions.ecmaFeatures !== 'object') { + parserOptions.ecmaFeatures = {}; + } + /** + * Allow the user to suppress the warning from typescript-estree if they are using an unsupported + * version of TypeScript + */ + const warnOnUnsupportedTypeScriptVersion = validateBoolean(parserOptions.warnOnUnsupportedTypeScriptVersion, true); + const tsestreeOptions = { + jsx: validateBoolean(parserOptions.ecmaFeatures.jsx), + ...(!warnOnUnsupportedTypeScriptVersion && { loggerFn: false }), + ...parserOptions, + // Override errorOnTypeScriptSyntacticAndSemanticIssues and set it to false to prevent use from user config + // https://github.com/typescript-eslint/typescript-eslint/issues/8681#issuecomment-2000411834 + errorOnTypeScriptSyntacticAndSemanticIssues: false, + // comment, loc, range, and tokens should always be set for ESLint usage + // https://github.com/typescript-eslint/typescript-eslint/issues/8347 + comment: true, + loc: true, + range: true, + tokens: true, + }; + const analyzeOptions = { + globalReturn: parserOptions.ecmaFeatures.globalReturn, + jsxFragmentName: parserOptions.jsxFragmentName, + jsxPragma: parserOptions.jsxPragma, + lib: parserOptions.lib, + sourceType: parserOptions.sourceType, + }; + const { ast, services } = (0, typescript_estree_1.parseAndGenerateServices)(code, tsestreeOptions); + ast.sourceType = parserOptions.sourceType; + if (services.program) { + // automatically apply the options configured for the program + const compilerOptions = services.program.getCompilerOptions(); + if (analyzeOptions.lib == null) { + analyzeOptions.lib = getLib(compilerOptions); + log('Resolved libs from program: %o', analyzeOptions.lib); + } + if ( + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + analyzeOptions.jsxPragma === undefined && + compilerOptions.jsxFactory != null) { + // in case the user has specified something like "preact.h" + const factory = compilerOptions.jsxFactory.split('.')[0].trim(); + analyzeOptions.jsxPragma = factory; + log('Resolved jsxPragma from program: %s', analyzeOptions.jsxPragma); + } + if ( + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + analyzeOptions.jsxFragmentName === undefined && + compilerOptions.jsxFragmentFactory != null) { + // in case the user has specified something like "preact.Fragment" + const fragFactory = compilerOptions.jsxFragmentFactory + .split('.')[0] + .trim(); + analyzeOptions.jsxFragmentName = fragFactory; + log('Resolved jsxFragmentName from program: %s', analyzeOptions.jsxFragmentName); + } + } + const scopeManager = (0, scope_manager_1.analyze)(ast, analyzeOptions); + // if not defined - override from the parserOptions + services.emitDecoratorMetadata ??= + parserOptions.emitDecoratorMetadata === true; + services.experimentalDecorators ??= + parserOptions.experimentalDecorators === true; + services.isolatedDeclarations ??= parserOptions.isolatedDeclarations === true; + return { ast, scopeManager, services, visitorKeys: visitor_keys_1.visitorKeys }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/parser/package.json b/tools/ui/node_modules/@typescript-eslint/parser/package.json new file mode 100644 index 0000000000000000000000000000000000000000..89d503b579a34106e28a4968220ecb1fc3b3b2af --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/parser/package.json @@ -0,0 +1,86 @@ +{ + "name": "@typescript-eslint/parser", + "version": "8.60.1", + "description": "An ESLint custom parser which leverages TypeScript ESTree", + "files": [ + "dist", + "!**/*.tsbuildinfo", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/parser" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io/packages/parser", + "license": "MIT", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "typescript", + "parser", + "syntax", + "eslint" + ], + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + }, + "dependencies": { + "debug": "^4.4.3", + "@typescript-eslint/scope-manager": "8.60.1", + "@typescript-eslint/typescript-estree": "8.60.1", + "@typescript-eslint/types": "8.60.1", + "@typescript-eslint/visitor-keys": "8.60.1" + }, + "devDependencies": { + "@typescript/native-preview": "7.0.0-dev.20260518.1", + "@vitest/coverage-v8": "^4.0.18", + "eslint": "^10.0.0", + "glob": "^11.1.0", + "rimraf": "^5.0.10", + "typescript": ">=4.8.4 <6.1.0", + "vitest": "^4.0.18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "parser", + "includedScripts": [ + "clean" + ], + "targets": { + "lint": { + "command": "eslint" + }, + "typecheck:tsgo": {} + } + }, + "scripts": { + "build": "pnpm exec nx build", + "clean": "rimraf dist/ coverage/", + "format": "pnpm -w run format", + "lint": "pnpm -w exec nx lint", + "test": "pnpm -w exec nx test", + "typecheck": "pnpm -w exec nx typecheck", + "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/project-service/LICENSE b/tools/ui/node_modules/@typescript-eslint/project-service/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..310a18f8a6cbbe878d7c2874d6e3323827709b99 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/project-service/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/@typescript-eslint/project-service/README.md b/tools/ui/node_modules/@typescript-eslint/project-service/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cf1a671681d63076a2ffc04b25ab3f8a86cd7f07 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/project-service/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/project-service` + +> Standalone TypeScript project service wrapper for linting. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/project-service.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/project-service) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/project-service.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/project-service) + +A standalone export of the "Project Service" that powers typed linting for typescript-eslint. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/tools/ui/node_modules/@typescript-eslint/project-service/dist/createProjectService.d.ts b/tools/ui/node_modules/@typescript-eslint/project-service/dist/createProjectService.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ee5ec3b90f44de580f14365cd8fd91abc76c82b4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/project-service/dist/createProjectService.d.ts @@ -0,0 +1,65 @@ +import type { ProjectServiceOptions } from '@typescript-eslint/types'; +import type * as ts from 'typescript/lib/tsserverlibrary'; +/** + * Shortcut type to refer to TypeScript's server ProjectService. + */ +export type TypeScriptProjectService = ts.server.ProjectService; +/** + * A created Project Service instance, as well as metadata on its creation. + */ +export interface ProjectServiceAndMetadata { + /** + * Files allowed to be loaded from the default project, if any were specified. + */ + allowDefaultProject: string[] | undefined; + /** + * The performance.now() timestamp of the last reload of the project service. + */ + lastReloadTimestamp: number; + /** + * The maximum number of files that can be matched by the default project. + */ + maximumDefaultProjectFileMatchCount: number; + /** + * The created TypeScript Project Service instance. + */ + service: TypeScriptProjectService; +} +/** + * Settings to create a new Project Service instance with {@link createProjectService}. + */ +export interface CreateProjectServiceSettings { + /** + * Granular options to configure the project service. + */ + options?: ProjectServiceOptions; + /** + * How aggressively (and slowly) to parse JSDoc comments. + */ + jsDocParsingMode?: ts.JSDocParsingMode; + /** + * Root directory for the tsconfig.json file, if not the current directory. + */ + tsconfigRootDir?: string; + /** + * Custom project service host. + * + * @default `ts.sys` with stub watchers + */ + host?: Partial; +} +/** + * Creates a new Project Service instance, as well as metadata on its creation. + * @param settings Settings to create a new Project Service instance. + * @returns A new Project Service instance, as well as metadata on its creation. + * @example + * ```ts + * import { createProjectService } from '@typescript-eslint/project-service'; + * + * const { service } = createProjectService(); + * + * service.openClientFile('index.ts'); + * ``` + */ +export declare function createProjectService({ host, jsDocParsingMode, options: optionsRaw, tsconfigRootDir, }?: CreateProjectServiceSettings): ProjectServiceAndMetadata; +export { type ProjectServiceOptions } from '@typescript-eslint/types'; diff --git a/tools/ui/node_modules/@typescript-eslint/project-service/dist/createProjectService.js b/tools/ui/node_modules/@typescript-eslint/project-service/dist/createProjectService.js new file mode 100644 index 0000000000000000000000000000000000000000..3f569a8a15dc1c5bbacb0971ecc790bef427aa58 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/project-service/dist/createProjectService.js @@ -0,0 +1,138 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createProjectService = createProjectService; +const debug_1 = __importDefault(require("debug")); +const getParsedConfigFileFromTSServer_js_1 = require("./getParsedConfigFileFromTSServer.js"); +const DEFAULT_PROJECT_MATCHED_FILES_THRESHOLD = 8; +const log = (0, debug_1.default)('typescript-eslint:project-service:createProjectService'); +const logTsserverErr = (0, debug_1.default)('typescript-eslint:project-service:tsserver:err'); +const logTsserverInfo = (0, debug_1.default)('typescript-eslint:project-service:tsserver:info'); +const logTsserverPerf = (0, debug_1.default)('typescript-eslint:project-service:tsserver:perf'); +const logTsserverEvent = (0, debug_1.default)('typescript-eslint:project-service:tsserver:event'); +// For TypeScript APIs that expect a function to be passed in +// eslint-disable-next-line @typescript-eslint/no-empty-function +const doNothing = () => { }; +const createStubFileWatcher = () => ({ + close: doNothing, +}); +/** + * Creates a new Project Service instance, as well as metadata on its creation. + * @param settings Settings to create a new Project Service instance. + * @returns A new Project Service instance, as well as metadata on its creation. + * @example + * ```ts + * import { createProjectService } from '@typescript-eslint/project-service'; + * + * const { service } = createProjectService(); + * + * service.openClientFile('index.ts'); + * ``` + */ +function createProjectService({ host, jsDocParsingMode, options: optionsRaw = {}, tsconfigRootDir, } = {}) { + const options = { + defaultProject: 'tsconfig.json', + ...optionsRaw, + }; + // We import this lazily to avoid its cost for users who don't use the service + // TODO: Once we drop support for TS<5.3 we can import from "typescript" directly + // eslint-disable-next-line @typescript-eslint/no-require-imports + const tsserver = require('typescript/lib/tsserverlibrary'); + // TODO: see getWatchProgramsForProjects + // We don't watch the disk, we just refer to these when ESLint calls us + // there's a whole separate update pass in maybeInvalidateProgram at the bottom of getWatchProgramsForProjects + // (this "goes nuclear on TypeScript") + const system = { + ...tsserver.sys, + clearImmediate, + clearTimeout, + setImmediate, + setTimeout, + watchDirectory: createStubFileWatcher, + watchFile: createStubFileWatcher, + // We stop loading any TypeScript plugins by default, to prevent them from attaching disk watchers + // See https://github.com/typescript-eslint/typescript-eslint/issues/9905 + ...(!options.loadTypeScriptPlugins && { + require: () => ({ + error: { + message: 'TypeScript plugins are not required when using parserOptions.projectService.', + }, + module: undefined, + }), + }), + ...host, + }; + const logger = { + close: doNothing, + endGroup: doNothing, + getLogFileName: () => undefined, + // The debug library doesn't use levels without creating a namespace for each. + // Log levels are not passed to the writer so we wouldn't be able to forward + // to a respective namespace. Supporting would require an additional flag for + // granular control. Defaulting to all levels for now. + hasLevel: () => true, + info(s) { + this.msg(s, tsserver.server.Msg.Info); + }, + loggingEnabled: () => + // if none of the debug namespaces are enabled, then don't enable logging in tsserver + logTsserverInfo.enabled || + logTsserverErr.enabled || + logTsserverPerf.enabled, + msg: (s, type) => { + switch (type) { + case tsserver.server.Msg.Err: + logTsserverErr(s); + break; + case tsserver.server.Msg.Perf: + logTsserverPerf(s); + break; + default: + logTsserverInfo(s); + } + }, + perftrc(s) { + this.msg(s, tsserver.server.Msg.Perf); + }, + startGroup: doNothing, + }; + log('Creating Project Service with: %o', options); + const service = new tsserver.server.ProjectService({ + cancellationToken: { isCancellationRequested: () => false }, + eventHandler: logTsserverEvent.enabled + ? (e) => { + logTsserverEvent(e); + } + : undefined, + host: system, + jsDocParsingMode, + logger, + session: undefined, + useInferredProjectPerProjectRoot: false, + useSingleInferredProject: false, + }); + service.setHostConfiguration({ + preferences: { + includePackageJsonAutoImports: 'off', + }, + }); + log('Enabling default project: %s', options.defaultProject); + const configFile = (0, getParsedConfigFileFromTSServer_js_1.getParsedConfigFileFromTSServer)(tsserver, options.defaultProject, !!optionsRaw.defaultProject, tsconfigRootDir); + if (configFile) { + service.setCompilerOptionsForInferredProjects( + // NOTE: The inferred projects API is not intended for source files when a tsconfig + // exists. There is no API that generates an InferredProjectCompilerOptions suggesting + // it is meant for hard coded options passed in. Hard asserting as a work around. + // See https://github.com/microsoft/TypeScript/blob/27bcd4cb5a98bce46c9cdd749752703ead021a4b/src/server/protocol.ts#L1904 + configFile.options); + } + return { + allowDefaultProject: options.allowDefaultProject, + lastReloadTimestamp: performance.now(), + maximumDefaultProjectFileMatchCount: options.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING ?? + DEFAULT_PROJECT_MATCHED_FILES_THRESHOLD, + service, + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/project-service/dist/getParsedConfigFileFromTSServer.d.ts b/tools/ui/node_modules/@typescript-eslint/project-service/dist/getParsedConfigFileFromTSServer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c1ea9e4c5c530fe79945f8095cd99c4611a79885 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/project-service/dist/getParsedConfigFileFromTSServer.d.ts @@ -0,0 +1,2 @@ +import type * as ts from 'typescript/lib/tsserverlibrary'; +export declare function getParsedConfigFileFromTSServer(tsserver: typeof ts, defaultProject: string, throwOnFailure: boolean, tsconfigRootDir?: string): ts.ParsedCommandLine | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/project-service/dist/getParsedConfigFileFromTSServer.js b/tools/ui/node_modules/@typescript-eslint/project-service/dist/getParsedConfigFileFromTSServer.js new file mode 100644 index 0000000000000000000000000000000000000000..9e6d3fb312e0c0a5a592126cbbb6da7d19a2427f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/project-service/dist/getParsedConfigFileFromTSServer.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getParsedConfigFileFromTSServer = getParsedConfigFileFromTSServer; +const tsconfig_utils_1 = require("@typescript-eslint/tsconfig-utils"); +function getParsedConfigFileFromTSServer(tsserver, defaultProject, throwOnFailure, tsconfigRootDir) { + try { + return (0, tsconfig_utils_1.getParsedConfigFile)(tsserver, defaultProject, tsconfigRootDir); + } + catch (error) { + if (throwOnFailure) { + throw new Error(`Could not read Project Service default project '${defaultProject}': ${error.message}`, { cause: error }); + } + } + return undefined; +} diff --git a/tools/ui/node_modules/@typescript-eslint/project-service/dist/index.d.ts b/tools/ui/node_modules/@typescript-eslint/project-service/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..943c04088b69dd7893a20b07baf109c0faf35726 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/project-service/dist/index.d.ts @@ -0,0 +1 @@ +export * from './createProjectService'; diff --git a/tools/ui/node_modules/@typescript-eslint/project-service/dist/index.js b/tools/ui/node_modules/@typescript-eslint/project-service/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f574a9b9df5c75fe597982723879744b624754e9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/project-service/dist/index.js @@ -0,0 +1,17 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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 }); +__exportStar(require("./createProjectService"), exports); diff --git a/tools/ui/node_modules/@typescript-eslint/project-service/package.json b/tools/ui/node_modules/@typescript-eslint/project-service/package.json new file mode 100644 index 0000000000000000000000000000000000000000..bf914cd9e2df2e05fd74b0e455dee7d9ff707100 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/project-service/package.json @@ -0,0 +1,83 @@ +{ + "name": "@typescript-eslint/project-service", + "version": "8.60.1", + "description": "Standalone TypeScript project service wrapper for linting.", + "files": [ + "dist", + "!**/*.tsbuildinfo", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "types": "./dist/index.d.ts", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/project-service" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io", + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + }, + "dependencies": { + "debug": "^4.4.3", + "@typescript-eslint/types": "^8.60.1", + "@typescript-eslint/tsconfig-utils": "^8.60.1" + }, + "devDependencies": { + "@typescript/native-preview": "7.0.0-dev.20260518.1", + "@vitest/coverage-v8": "^4.0.18", + "rimraf": "^5.0.10", + "typescript": ">=4.8.4 <6.1.0", + "vitest": "^4.0.18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "publishConfig": { + "access": "public" + }, + "nx": { + "name": "project-service", + "includedScripts": [ + "clean" + ], + "targets": { + "lint": { + "command": "eslint" + }, + "typecheck:tsgo": {} + } + }, + "scripts": { + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "pnpm exec nx build", + "clean": "rimraf dist/ coverage/", + "format": "pnpm -w run format", + "lint": "pnpm -w exec nx lint", + "test": "pnpm -w exec nx test", + "typecheck": "pnpm -w exec nx typecheck", + "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/LICENSE b/tools/ui/node_modules/@typescript-eslint/scope-manager/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a1164108d4d6037cb976384c16e5493917d87157 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/README.md b/tools/ui/node_modules/@typescript-eslint/scope-manager/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b730e9d83a99b3c3422018d0a3f2b4289aaeb5d8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/README.md @@ -0,0 +1,10 @@ +# `@typescript-eslint/scope-manager` + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/scope-manager.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/scope-manager) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/scope-manager.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/scope-manager) + +👉 See **https://typescript-eslint.io/packages/scope-manager** for documentation on this package. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5198dff5096e65e8baecc55cf6146ceab24707e8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ID.d.ts @@ -0,0 +1,2 @@ +export declare function createIdGenerator(): () => number; +export declare function resetIds(): void; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ID.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ID.js new file mode 100644 index 0000000000000000000000000000000000000000..587fa9173697d6fa2125f5419fcd36daa77ecbbe --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ID.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createIdGenerator = createIdGenerator; +exports.resetIds = resetIds; +const ID_CACHE = new Map(); +let NEXT_KEY = 0; +function createIdGenerator() { + const key = (NEXT_KEY += 1); + ID_CACHE.set(key, 0); + return () => { + const current = ID_CACHE.get(key) ?? 0; + const next = current + 1; + ID_CACHE.set(key, next); + return next; + }; +} +function resetIds() { + ID_CACHE.clear(); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..438d6360dac3365d974e3d597c3edcdf1dcefcb2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.d.ts @@ -0,0 +1,77 @@ +import type { SourceType, TSESTree } from '@typescript-eslint/types'; +import type { Scope } from './scope'; +import type { Variable } from './variable'; +import { BlockScope, CatchScope, ClassScope, ConditionalTypeScope, ForScope, FunctionExpressionNameScope, FunctionScope, FunctionTypeScope, GlobalScope, MappedTypeScope, ModuleScope, SwitchScope, TSEnumScope, TSModuleScope, TypeScope, WithScope } from './scope'; +import { ClassFieldInitializerScope } from './scope/ClassFieldInitializerScope'; +import { ClassStaticBlockScope } from './scope/ClassStaticBlockScope'; +interface ScopeManagerOptions { + globalReturn?: boolean; + impliedStrict?: boolean; + sourceType?: SourceType; +} +/** + * @see https://eslint.org/docs/latest/developer-guide/scope-manager-interface#scopemanager-interface + */ +export declare class ScopeManager { + #private; + currentScope: Scope | null; + readonly declaredVariables: WeakMap; + /** + * The root scope + */ + globalScope: GlobalScope | null; + readonly nodeToScope: WeakMap; + /** + * All scopes + * @public + */ + readonly scopes: Scope[]; + constructor(options: ScopeManagerOptions); + isES6(): boolean; + isGlobalReturn(): boolean; + isImpliedStrict(): boolean; + isModule(): boolean; + isStrictModeSupported(): boolean; + get variables(): Variable[]; + /** + * Get the variables that a given AST node defines. The gotten variables' `def[].node`/`def[].parent` property is the node. + * If the node does not define any variable, this returns an empty array. + * @param node An AST node to get their variables. + */ + getDeclaredVariables(node: TSESTree.Node): Variable[]; + /** + * Get the scope of a given AST node. The gotten scope's `block` property is the node. + * This method never returns `function-expression-name` scope. If the node does not have their scope, this returns `null`. + * + * @param node An AST node to get their scope. + * @param inner If the node has multiple scopes, this returns the outermost scope normally. + * If `inner` is `true` then this returns the innermost scope. + */ + acquire(node: TSESTree.Node, inner?: boolean): Scope | null; + /** + * Adds dynamically created globals to the global scope and resolve their references. + * This method is called by ESLint. + * @param names Names of the globals to create + */ + addGlobals(names: string[]): void; + nestBlockScope(node: BlockScope['block']): BlockScope; + nestCatchScope(node: CatchScope['block']): CatchScope; + nestClassFieldInitializerScope(node: ClassFieldInitializerScope['block']): ClassFieldInitializerScope; + nestClassScope(node: ClassScope['block']): ClassScope; + nestClassStaticBlockScope(node: ClassStaticBlockScope['block']): ClassStaticBlockScope; + nestConditionalTypeScope(node: ConditionalTypeScope['block']): ConditionalTypeScope; + nestForScope(node: ForScope['block']): ForScope; + nestFunctionExpressionNameScope(node: FunctionExpressionNameScope['block']): FunctionExpressionNameScope; + nestFunctionScope(node: FunctionScope['block'], isMethodDefinition: boolean): FunctionScope; + nestFunctionTypeScope(node: FunctionTypeScope['block']): FunctionTypeScope; + nestGlobalScope(node: GlobalScope['block']): GlobalScope; + nestMappedTypeScope(node: MappedTypeScope['block']): MappedTypeScope; + nestModuleScope(node: ModuleScope['block']): ModuleScope; + nestSwitchScope(node: SwitchScope['block']): SwitchScope; + nestTSEnumScope(node: TSEnumScope['block']): TSEnumScope; + nestTSModuleScope(node: TSModuleScope['block']): TSModuleScope; + nestTypeScope(node: TypeScope['block']): TypeScope; + nestWithScope(node: WithScope['block']): WithScope; + protected nestScope(scope: T): T; +} +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js new file mode 100644 index 0000000000000000000000000000000000000000..0f06a7dfff8326d7ba7f16ee572cc97814629585 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/ScopeManager.js @@ -0,0 +1,189 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeManager = void 0; +const assert_1 = require("./assert"); +const scope_1 = require("./scope"); +const ClassFieldInitializerScope_1 = require("./scope/ClassFieldInitializerScope"); +const ClassStaticBlockScope_1 = require("./scope/ClassStaticBlockScope"); +/** + * @see https://eslint.org/docs/latest/developer-guide/scope-manager-interface#scopemanager-interface + */ +class ScopeManager { + #options; + currentScope; + declaredVariables; + /** + * The root scope + */ + globalScope; + nodeToScope; + /** + * All scopes + * @public + */ + scopes; + constructor(options) { + this.scopes = []; + this.globalScope = null; + this.nodeToScope = new WeakMap(); + this.currentScope = null; + this.#options = options; + this.declaredVariables = new WeakMap(); + } + isES6() { + return true; + } + isGlobalReturn() { + return this.#options.globalReturn === true; + } + isImpliedStrict() { + return this.#options.impliedStrict === true; + } + isModule() { + return this.#options.sourceType === 'module'; + } + isStrictModeSupported() { + return true; + } + get variables() { + const variables = new Set(); + function recurse(scope) { + scope.variables.forEach(v => variables.add(v)); + scope.childScopes.forEach(recurse); + } + this.scopes.forEach(recurse); + return [...variables].sort((a, b) => a.$id - b.$id); + } + /** + * Get the variables that a given AST node defines. The gotten variables' `def[].node`/`def[].parent` property is the node. + * If the node does not define any variable, this returns an empty array. + * @param node An AST node to get their variables. + */ + getDeclaredVariables(node) { + return this.declaredVariables.get(node) ?? []; + } + /** + * Get the scope of a given AST node. The gotten scope's `block` property is the node. + * This method never returns `function-expression-name` scope. If the node does not have their scope, this returns `null`. + * + * @param node An AST node to get their scope. + * @param inner If the node has multiple scopes, this returns the outermost scope normally. + * If `inner` is `true` then this returns the innermost scope. + */ + acquire(node, inner = false) { + function predicate(testScope) { + if (testScope.type === scope_1.ScopeType.function && + testScope.functionExpressionScope) { + return false; + } + return true; + } + const scopes = this.nodeToScope.get(node); + if (!scopes || scopes.length === 0) { + return null; + } + // Heuristic selection from all scopes. + // If you would like to get all scopes, please use ScopeManager#acquireAll. + if (scopes.length === 1) { + return scopes[0]; + } + if (inner) { + for (let i = scopes.length - 1; i >= 0; --i) { + const scope = scopes[i]; + if (predicate(scope)) { + return scope; + } + } + return null; + } + return scopes.find(predicate) ?? null; + } + /** + * Adds dynamically created globals to the global scope and resolve their references. + * This method is called by ESLint. + * @param names Names of the globals to create + */ + addGlobals(names) { + this.globalScope?.addVariables(names); + } + nestBlockScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.BlockScope(this, this.currentScope, node)); + } + nestCatchScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.CatchScope(this, this.currentScope, node)); + } + nestClassFieldInitializerScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new ClassFieldInitializerScope_1.ClassFieldInitializerScope(this, this.currentScope, node)); + } + nestClassScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.ClassScope(this, this.currentScope, node)); + } + nestClassStaticBlockScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new ClassStaticBlockScope_1.ClassStaticBlockScope(this, this.currentScope, node)); + } + nestConditionalTypeScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.ConditionalTypeScope(this, this.currentScope, node)); + } + nestForScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.ForScope(this, this.currentScope, node)); + } + nestFunctionExpressionNameScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.FunctionExpressionNameScope(this, this.currentScope, node)); + } + nestFunctionScope(node, isMethodDefinition) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.FunctionScope(this, this.currentScope, node, isMethodDefinition)); + } + nestFunctionTypeScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.FunctionTypeScope(this, this.currentScope, node)); + } + nestGlobalScope(node) { + return this.nestScope(new scope_1.GlobalScope(this, node)); + } + nestMappedTypeScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.MappedTypeScope(this, this.currentScope, node)); + } + nestModuleScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.ModuleScope(this, this.currentScope, node)); + } + nestSwitchScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.SwitchScope(this, this.currentScope, node)); + } + nestTSEnumScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.TSEnumScope(this, this.currentScope, node)); + } + nestTSModuleScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.TSModuleScope(this, this.currentScope, node)); + } + nestTypeScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.TypeScope(this, this.currentScope, node)); + } + nestWithScope(node) { + (0, assert_1.assert)(this.currentScope); + return this.nestScope(new scope_1.WithScope(this, this.currentScope, node)); + } + nestScope(scope) { + if (scope instanceof scope_1.GlobalScope) { + (0, assert_1.assert)(this.currentScope == null); + this.globalScope = scope; + } + this.currentScope = scope; + return scope; + } +} +exports.ScopeManager = ScopeManager; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7313bafae92cdbdd8b11d88280349c1493d37f43 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/analyze.d.ts @@ -0,0 +1,53 @@ +import type { Lib, SourceType, TSESTree } from '@typescript-eslint/types'; +import type { ReferencerOptions } from './referencer'; +import { ScopeManager } from './ScopeManager'; +export interface AnalyzeOptions { + /** + * Known visitor keys. + */ + childVisitorKeys?: ReferencerOptions['childVisitorKeys']; + /** + * Whether the whole script is executed under node.js environment. + * When enabled, the scope manager adds a function scope immediately following the global scope. + * Defaults to `false`. + */ + globalReturn?: boolean; + /** + * Implied strict mode. + * Defaults to `false`. + */ + impliedStrict?: boolean; + /** + * The identifier that's used for JSX Element creation (after transpilation). + * This should not be a member expression - just the root identifier (i.e. use "React" instead of "React.createElement"). + * Defaults to `"React"`. + */ + jsxPragma?: string | null; + /** + * The identifier that's used for JSX fragment elements (after transpilation). + * If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment). + * This should not be a member expression - just the root identifier (i.e. use "h" instead of "h.Fragment"). + * Defaults to `null`. + */ + jsxFragmentName?: string | null; + /** + * The lib used by the project. + * This automatically defines a type variable for any types provided by the configured TS libs. + * Defaults to ['esnext']. + * + * https://www.typescriptlang.org/tsconfig#lib + */ + lib?: Lib[]; + /** + * The source type of the script. + */ + sourceType?: SourceType; + /** + * @deprecated This option never did what it was intended for and will be removed in a future major release. + */ + emitDecoratorMetadata?: boolean; +} +/** + * Takes an AST and returns the analyzed scopes. + */ +export declare function analyze(tree: TSESTree.Program, providedOptions?: AnalyzeOptions): ScopeManager; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/analyze.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/analyze.js new file mode 100644 index 0000000000000000000000000000000000000000..dfedd03c3c500621e959a472a3e9cb9b97ce9ad8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/analyze.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.analyze = analyze; +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +const referencer_1 = require("./referencer"); +const ScopeManager_1 = require("./ScopeManager"); +const DEFAULT_OPTIONS = { + childVisitorKeys: visitor_keys_1.visitorKeys, + emitDecoratorMetadata: false, + globalReturn: false, + impliedStrict: false, + jsxFragmentName: null, + jsxPragma: 'React', + lib: ['es2018'], + sourceType: 'script', +}; +/** + * Takes an AST and returns the analyzed scopes. + */ +function analyze(tree, providedOptions) { + const options = { + childVisitorKeys: providedOptions?.childVisitorKeys ?? DEFAULT_OPTIONS.childVisitorKeys, + emitDecoratorMetadata: false, + globalReturn: providedOptions?.globalReturn ?? DEFAULT_OPTIONS.globalReturn, + impliedStrict: providedOptions?.impliedStrict ?? DEFAULT_OPTIONS.impliedStrict, + jsxFragmentName: providedOptions?.jsxFragmentName ?? DEFAULT_OPTIONS.jsxFragmentName, + jsxPragma: + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + providedOptions?.jsxPragma === undefined + ? DEFAULT_OPTIONS.jsxPragma + : providedOptions.jsxPragma, + lib: providedOptions?.lib ?? ['esnext'], + sourceType: providedOptions?.sourceType ?? DEFAULT_OPTIONS.sourceType, + }; + // ensure the option is lower cased + options.lib = options.lib.map(l => l.toLowerCase()); + const scopeManager = new ScopeManager_1.ScopeManager(options); + const referencer = new referencer_1.Referencer(options, scopeManager); + referencer.visit(tree); + return scopeManager; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..daee0d5f1a2b3e3773215b52ace54302bb4f6807 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/assert.d.ts @@ -0,0 +1 @@ +export declare function assert(value: unknown, message?: string): asserts value; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/assert.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/assert.js new file mode 100644 index 0000000000000000000000000000000000000000..24c3c196a6da99702d95659420fe11735c7581e6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/assert.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assert = assert; +// the base assert module doesn't use ts assertion syntax +function assert(value, message) { + if (value == null) { + throw new Error(message); + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..10c9e9088b793e5720fe8f5157944e1c93683383 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class CatchClauseDefinition extends DefinitionBase { + readonly isTypeDefinition = false; + readonly isVariableDefinition = true; + constructor(name: TSESTree.Identifier, node: CatchClauseDefinition['node']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..a1816c5fbd93c53e049ad7ea544dcb06ea647962 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/CatchClauseDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CatchClauseDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class CatchClauseDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = false; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.CatchClause, name, node, null); + } +} +exports.CatchClauseDefinition = CatchClauseDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ca02c8192e20584a302d84f92fdcde13f74d51f6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class ClassNameDefinition extends DefinitionBase { + readonly isTypeDefinition = true; + readonly isVariableDefinition = true; + constructor(name: TSESTree.Identifier, node: ClassNameDefinition['node']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..55e6cc5ef5c060350f50f70f1f095d922399f071 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ClassNameDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassNameDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class ClassNameDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.ClassName, name, node, null); + } +} +exports.ClassNameDefinition = ClassNameDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95fe4a5571cd08c01f1fbda8449251e529673ad3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.d.ts @@ -0,0 +1,12 @@ +import type { CatchClauseDefinition } from './CatchClauseDefinition'; +import type { ClassNameDefinition } from './ClassNameDefinition'; +import type { FunctionNameDefinition } from './FunctionNameDefinition'; +import type { ImplicitGlobalVariableDefinition } from './ImplicitGlobalVariableDefinition'; +import type { ImportBindingDefinition } from './ImportBindingDefinition'; +import type { ParameterDefinition } from './ParameterDefinition'; +import type { TSEnumMemberDefinition } from './TSEnumMemberDefinition'; +import type { TSEnumNameDefinition } from './TSEnumNameDefinition'; +import type { TSModuleNameDefinition } from './TSModuleNameDefinition'; +import type { TypeDefinition } from './TypeDefinition'; +import type { VariableDefinition } from './VariableDefinition'; +export type Definition = CatchClauseDefinition | ClassNameDefinition | FunctionNameDefinition | ImplicitGlobalVariableDefinition | ImportBindingDefinition | ParameterDefinition | TSEnumMemberDefinition | TSEnumNameDefinition | TSModuleNameDefinition | TypeDefinition | VariableDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/Definition.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cd5ebcb9ac2020c6fe762d7fc4475c01432401f1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.d.ts @@ -0,0 +1,33 @@ +import type { NodeWithParent, TSESTree } from '@typescript-eslint/types'; +import type { DefinitionType } from './DefinitionType'; +export declare abstract class DefinitionBase { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + readonly $id: number; + readonly type: Type; + /** + * The `Identifier` node of this definition + * @public + */ + readonly name: Name; + /** + * The enclosing node of the name. + * @public + */ + readonly node: Node; + /** + * the enclosing statement node of the identifier. + * @public + */ + readonly parent: Parent; + constructor(type: Type, name: Name, node: Node, parent: Parent); + /** + * `true` if the variable is valid in a type context, false otherwise + */ + abstract readonly isTypeDefinition: boolean; + /** + * `true` if the variable is valid in a value context, false otherwise + */ + abstract readonly isVariableDefinition: boolean; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js new file mode 100644 index 0000000000000000000000000000000000000000..3327b11b9cb9b9c94afd23aa6d98cb8e41194e82 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionBase.js @@ -0,0 +1,34 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DefinitionBase = void 0; +const ID_1 = require("../ID"); +const generator = (0, ID_1.createIdGenerator)(); +class DefinitionBase { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + $id = generator(); + type; + /** + * The `Identifier` node of this definition + * @public + */ + name; + /** + * The enclosing node of the name. + * @public + */ + node; + /** + * the enclosing statement node of the identifier. + * @public + */ + parent; + constructor(type, name, node, parent) { + this.type = type; + this.name = name; + this.node = node; + this.parent = parent; + } +} +exports.DefinitionBase = DefinitionBase; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a4321cd42886f1c5c21c7aa790565c2325a8673 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.d.ts @@ -0,0 +1,13 @@ +export declare enum DefinitionType { + CatchClause = "CatchClause", + ClassName = "ClassName", + FunctionName = "FunctionName", + ImplicitGlobalVariable = "ImplicitGlobalVariable", + ImportBinding = "ImportBinding", + Parameter = "Parameter", + TSEnumName = "TSEnumName", + TSEnumMember = "TSEnumMemberName", + TSModuleName = "TSModuleName", + Type = "Type", + Variable = "Variable" +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js new file mode 100644 index 0000000000000000000000000000000000000000..1ac31940882acf860c49cd19a11ce4c04d5e107d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/DefinitionType.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DefinitionType = void 0; +var DefinitionType; +(function (DefinitionType) { + DefinitionType["CatchClause"] = "CatchClause"; + DefinitionType["ClassName"] = "ClassName"; + DefinitionType["FunctionName"] = "FunctionName"; + DefinitionType["ImplicitGlobalVariable"] = "ImplicitGlobalVariable"; + DefinitionType["ImportBinding"] = "ImportBinding"; + DefinitionType["Parameter"] = "Parameter"; + DefinitionType["TSEnumName"] = "TSEnumName"; + DefinitionType["TSEnumMember"] = "TSEnumMemberName"; + DefinitionType["TSModuleName"] = "TSModuleName"; + DefinitionType["Type"] = "Type"; + DefinitionType["Variable"] = "Variable"; +})(DefinitionType || (exports.DefinitionType = DefinitionType = {})); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..200a7c44faab06c7f0c66f90c620f75a81e11fd7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class FunctionNameDefinition extends DefinitionBase { + readonly isTypeDefinition = false; + readonly isVariableDefinition = true; + constructor(name: TSESTree.Identifier, node: FunctionNameDefinition['node']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..ed7998d56d4fab68328850699e5d440bf3eb3194 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/FunctionNameDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionNameDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class FunctionNameDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = false; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.FunctionName, name, node, null); + } +} +exports.FunctionNameDefinition = FunctionNameDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fddb5b42264ee20c6413303096f1aa7f5acb4d85 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.d.ts @@ -0,0 +1,8 @@ +import type { NodeWithParent, TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class ImplicitGlobalVariableDefinition extends DefinitionBase { + readonly isTypeDefinition = false; + readonly isVariableDefinition = true; + constructor(name: TSESTree.BindingName, node: ImplicitGlobalVariableDefinition['node']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..f48182dbe7f8bc68f005a1106075b0a7f355657d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImplicitGlobalVariableDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImplicitGlobalVariableDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class ImplicitGlobalVariableDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = false; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.ImplicitGlobalVariable, name, node, null); + } +} +exports.ImplicitGlobalVariableDefinition = ImplicitGlobalVariableDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bdd228bc2aaba21508d8a709b3443aa788cd5fdd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.d.ts @@ -0,0 +1,9 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class ImportBindingDefinition extends DefinitionBase { + readonly isTypeDefinition = true; + readonly isVariableDefinition = true; + constructor(name: TSESTree.Identifier, node: TSESTree.TSImportEqualsDeclaration, decl: TSESTree.TSImportEqualsDeclaration); + constructor(name: TSESTree.Identifier, node: Exclude, decl: TSESTree.ImportDeclaration); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..e5407f3120d82b4e84b84739730361ab504db884 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ImportBindingDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportBindingDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class ImportBindingDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = true; + constructor(name, node, decl) { + super(DefinitionType_1.DefinitionType.ImportBinding, name, node, decl); + } +} +exports.ImportBindingDefinition = ImportBindingDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..721e03bc21486f88a6da19d202823896fc84f6ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.d.ts @@ -0,0 +1,12 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class ParameterDefinition extends DefinitionBase { + /** + * Whether the parameter definition is a part of a rest parameter. + */ + readonly isTypeDefinition = false; + readonly isVariableDefinition = true; + readonly rest: boolean; + constructor(name: TSESTree.BindingName, node: ParameterDefinition['node'], rest: boolean); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..81a48951cdeaa1c0f05cd3883e4bd2b99807fea7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/ParameterDefinition.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ParameterDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class ParameterDefinition extends DefinitionBase_1.DefinitionBase { + /** + * Whether the parameter definition is a part of a rest parameter. + */ + isTypeDefinition = false; + isVariableDefinition = true; + rest; + constructor(name, node, rest) { + super(DefinitionType_1.DefinitionType.Parameter, name, node, null); + this.rest = rest; + } +} +exports.ParameterDefinition = ParameterDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eeb30614de1bd7155ef22609f4e3bf3eaf741839 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class TSEnumMemberDefinition extends DefinitionBase { + readonly isTypeDefinition = true; + readonly isVariableDefinition = true; + constructor(name: TSESTree.Identifier | TSESTree.StringLiteral, node: TSEnumMemberDefinition['node']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..c6da19044b8009d609f3be5422a3f47cc7879dcd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumMemberDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSEnumMemberDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class TSEnumMemberDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.TSEnumMember, name, node, null); + } +} +exports.TSEnumMemberDefinition = TSEnumMemberDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ffd577e95a03293eb07164098f58ff70bd36e05 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class TSEnumNameDefinition extends DefinitionBase { + readonly isTypeDefinition = true; + readonly isVariableDefinition = true; + constructor(name: TSESTree.Identifier, node: TSEnumNameDefinition['node']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..d5453d2647ec20f0cf6588fb63116a5f64a1186d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSEnumNameDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSEnumNameDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class TSEnumNameDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.TSEnumName, name, node, null); + } +} +exports.TSEnumNameDefinition = TSEnumNameDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5088b2bf9d4b1fc1a5e6197750daafc3f6fb961e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class TSModuleNameDefinition extends DefinitionBase { + readonly isTypeDefinition = true; + readonly isVariableDefinition = true; + constructor(name: TSESTree.Identifier, node: TSModuleNameDefinition['node']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..93fb8470537f3c4cf6061ba4c664f7845e231907 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TSModuleNameDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSModuleNameDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class TSModuleNameDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = true; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.TSModuleName, name, node, null); + } +} +exports.TSModuleNameDefinition = TSModuleNameDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4740a9ce255cdabfa44a1420e4385a085a024aa9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class TypeDefinition extends DefinitionBase { + readonly isTypeDefinition = true; + readonly isVariableDefinition = false; + constructor(name: TSESTree.Identifier, node: TypeDefinition['node']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..2966fde970f66d52f41dc5d9f2a510c76a7373f0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/TypeDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class TypeDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = true; + isVariableDefinition = false; + constructor(name, node) { + super(DefinitionType_1.DefinitionType.Type, name, node, null); + } +} +exports.TypeDefinition = TypeDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5b75b2cd3a9c493aa555810ef8477115e6ad9f7c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; +export declare class VariableDefinition extends DefinitionBase { + readonly isTypeDefinition = false; + readonly isVariableDefinition = true; + constructor(name: TSESTree.Identifier, node: VariableDefinition['node'], decl: TSESTree.VariableDeclaration); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js new file mode 100644 index 0000000000000000000000000000000000000000..fc30f8385bad6c44bbbd62bbe71dbcc89b5e701d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/VariableDefinition.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VariableDefinition = void 0; +const DefinitionBase_1 = require("./DefinitionBase"); +const DefinitionType_1 = require("./DefinitionType"); +class VariableDefinition extends DefinitionBase_1.DefinitionBase { + isTypeDefinition = false; + isVariableDefinition = true; + constructor(name, node, decl) { + super(DefinitionType_1.DefinitionType.Variable, name, node, decl); + } +} +exports.VariableDefinition = VariableDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9bd1f0123370fd9d0f2c89ffb5f7f194e81b2870 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/index.d.ts @@ -0,0 +1,13 @@ +export * from './CatchClauseDefinition'; +export * from './ClassNameDefinition'; +export * from './Definition'; +export * from './DefinitionType'; +export * from './FunctionNameDefinition'; +export * from './ImplicitGlobalVariableDefinition'; +export * from './ImportBindingDefinition'; +export * from './ParameterDefinition'; +export * from './TSEnumMemberDefinition'; +export * from './TSEnumNameDefinition'; +export * from './TSModuleNameDefinition'; +export * from './TypeDefinition'; +export * from './VariableDefinition'; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js new file mode 100644 index 0000000000000000000000000000000000000000..67fad66bf217eea248cecb40de0db1c529fc9206 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/definition/index.js @@ -0,0 +1,29 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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 }); +__exportStar(require("./CatchClauseDefinition"), exports); +__exportStar(require("./ClassNameDefinition"), exports); +__exportStar(require("./Definition"), exports); +__exportStar(require("./DefinitionType"), exports); +__exportStar(require("./FunctionNameDefinition"), exports); +__exportStar(require("./ImplicitGlobalVariableDefinition"), exports); +__exportStar(require("./ImportBindingDefinition"), exports); +__exportStar(require("./ParameterDefinition"), exports); +__exportStar(require("./TSEnumMemberDefinition"), exports); +__exportStar(require("./TSEnumNameDefinition"), exports); +__exportStar(require("./TSModuleNameDefinition"), exports); +__exportStar(require("./TypeDefinition"), exports); +__exportStar(require("./VariableDefinition"), exports); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e1feec0dca6e87c894909e84fd9e522bbed8780c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/index.d.ts @@ -0,0 +1,8 @@ +export { analyze, type AnalyzeOptions } from './analyze'; +export * from './definition'; +export { PatternVisitor, type PatternVisitorCallback, type PatternVisitorOptions, } from './referencer/PatternVisitor'; +export { Reference } from './referencer/Reference'; +export { Visitor } from './referencer/Visitor'; +export * from './scope'; +export { ScopeManager } from './ScopeManager'; +export * from './variable'; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/index.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3ecc7a33765bebb70180e3a16fd514c89f694a9c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/index.js @@ -0,0 +1,30 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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.ScopeManager = exports.Visitor = exports.Reference = exports.PatternVisitor = exports.analyze = void 0; +var analyze_1 = require("./analyze"); +Object.defineProperty(exports, "analyze", { enumerable: true, get: function () { return analyze_1.analyze; } }); +__exportStar(require("./definition"), exports); +var PatternVisitor_1 = require("./referencer/PatternVisitor"); +Object.defineProperty(exports, "PatternVisitor", { enumerable: true, get: function () { return PatternVisitor_1.PatternVisitor; } }); +var Reference_1 = require("./referencer/Reference"); +Object.defineProperty(exports, "Reference", { enumerable: true, get: function () { return Reference_1.Reference; } }); +var Visitor_1 = require("./referencer/Visitor"); +Object.defineProperty(exports, "Visitor", { enumerable: true, get: function () { return Visitor_1.Visitor; } }); +__exportStar(require("./scope"), exports); +var ScopeManager_1 = require("./ScopeManager"); +Object.defineProperty(exports, "ScopeManager", { enumerable: true, get: function () { return ScopeManager_1.ScopeManager; } }); +__exportStar(require("./variable"), exports); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..de5f223e7913679063fe18e9cae8a1623d8439ec --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.d.ts @@ -0,0 +1,15 @@ +export declare const TYPE: Readonly<{ + eslintImplicitGlobalSetting: "readonly"; + isTypeVariable: true; + isValueVariable: false; +}>; +export declare const VALUE: Readonly<{ + eslintImplicitGlobalSetting: "readonly"; + isTypeVariable: false; + isValueVariable: true; +}>; +export declare const TYPE_VALUE: Readonly<{ + eslintImplicitGlobalSetting: "readonly"; + isTypeVariable: true; + isValueVariable: true; +}>; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.js new file mode 100644 index 0000000000000000000000000000000000000000..52febf4e0e6b79044fe72780b1cc9f3c33801da5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/base-config.js @@ -0,0 +1,22 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TYPE_VALUE = exports.VALUE = exports.TYPE = void 0; +exports.TYPE = Object.freeze({ + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, +}); +exports.VALUE = Object.freeze({ + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: false, + isValueVariable: true, +}); +exports.TYPE_VALUE = Object.freeze({ + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: true, +}); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8fd08723ac5612313a8df7046fb484f70672838 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const decorators: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.js new file mode 100644 index 0000000000000000000000000000000000000000..4b8c452bf0e944dbe639f1759646b3dd8ade2461 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.js @@ -0,0 +1,25 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decorators = void 0; +const base_config_1 = require("./base-config"); +exports.decorators = { + libs: [], + variables: [ + ['ClassMemberDecoratorContext', base_config_1.TYPE], + ['DecoratorContext', base_config_1.TYPE], + ['DecoratorMetadataObject', base_config_1.TYPE], + ['DecoratorMetadata', base_config_1.TYPE], + ['ClassDecoratorContext', base_config_1.TYPE], + ['ClassMethodDecoratorContext', base_config_1.TYPE], + ['ClassGetterDecoratorContext', base_config_1.TYPE], + ['ClassSetterDecoratorContext', base_config_1.TYPE], + ['ClassAccessorDecoratorContext', base_config_1.TYPE], + ['ClassAccessorDecoratorTarget', base_config_1.TYPE], + ['ClassAccessorDecoratorResult', base_config_1.TYPE], + ['ClassFieldDecoratorContext', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2b40a2d70d6df5510ab1514fe3da68bc6b115fa --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const decorators_legacy: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.js new file mode 100644 index 0000000000000000000000000000000000000000..c6c196d61b0123383bee4567dd9ded362b181bba --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/decorators.legacy.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decorators_legacy = void 0; +const base_config_1 = require("./base-config"); +exports.decorators_legacy = { + libs: [], + variables: [ + ['ClassDecorator', base_config_1.TYPE], + ['PropertyDecorator', base_config_1.TYPE], + ['MethodDecorator', base_config_1.TYPE], + ['ParameterDecorator', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d4d6d20a62a2df2f86ccbb3cb5c38c97d84a4e6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const dom_asynciterable: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.js new file mode 100644 index 0000000000000000000000000000000000000000..5ea1b19634ee50e018f96eb009431a28f065012f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.asynciterable.js @@ -0,0 +1,11 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dom_asynciterable = void 0; +exports.dom_asynciterable = { + libs: [], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..be8282b2e0091363fa870939bbc49aeaef7a1cdd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const dom: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..681e7a198a08350408fce134b687fab36d385d97 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const dom_iterable: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js new file mode 100644 index 0000000000000000000000000000000000000000..39bfe68bb6fca7674b94ae82f85b424d6e78fc29 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.iterable.js @@ -0,0 +1,11 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dom_iterable = void 0; +exports.dom_iterable = { + libs: [], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js new file mode 100644 index 0000000000000000000000000000000000000000..d979279dd681fefe17cfbbf7e271c6726c106b02 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/dom.js @@ -0,0 +1,1812 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.dom = void 0; +const base_config_1 = require("./base-config"); +const es2015_1 = require("./es2015"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +exports.dom = { + libs: [es2015_1.es2015, es2018_asynciterable_1.es2018_asynciterable], + variables: [ + ['AacEncoderConfig', base_config_1.TYPE], + ['AddEventListenerOptions', base_config_1.TYPE], + ['AddressErrors', base_config_1.TYPE], + ['AesCbcParams', base_config_1.TYPE], + ['AesCtrParams', base_config_1.TYPE], + ['AesDerivedKeyParams', base_config_1.TYPE], + ['AesGcmParams', base_config_1.TYPE], + ['AesKeyAlgorithm', base_config_1.TYPE], + ['AesKeyGenParams', base_config_1.TYPE], + ['Algorithm', base_config_1.TYPE], + ['AllAcceptedCredentialsOptions', base_config_1.TYPE], + ['AnalyserOptions', base_config_1.TYPE], + ['AnimationEventInit', base_config_1.TYPE], + ['AnimationPlaybackEventInit', base_config_1.TYPE], + ['AssignedNodesOptions', base_config_1.TYPE], + ['AudioBufferOptions', base_config_1.TYPE], + ['AudioBufferSourceOptions', base_config_1.TYPE], + ['AudioConfiguration', base_config_1.TYPE], + ['AudioContextOptions', base_config_1.TYPE], + ['AudioDataCopyToOptions', base_config_1.TYPE], + ['AudioDataInit', base_config_1.TYPE], + ['AudioDecoderConfig', base_config_1.TYPE], + ['AudioDecoderInit', base_config_1.TYPE], + ['AudioDecoderSupport', base_config_1.TYPE], + ['AudioEncoderConfig', base_config_1.TYPE], + ['AudioEncoderInit', base_config_1.TYPE], + ['AudioEncoderSupport', base_config_1.TYPE], + ['AudioNodeOptions', base_config_1.TYPE], + ['AudioProcessingEventInit', base_config_1.TYPE], + ['AudioTimestamp', base_config_1.TYPE], + ['AudioWorkletNodeOptions', base_config_1.TYPE], + ['AuthenticationExtensionsClientInputs', base_config_1.TYPE], + ['AuthenticationExtensionsClientInputsJSON', base_config_1.TYPE], + ['AuthenticationExtensionsClientOutputs', base_config_1.TYPE], + ['AuthenticationExtensionsClientOutputsJSON', base_config_1.TYPE], + ['AuthenticationExtensionsLargeBlobInputs', base_config_1.TYPE], + ['AuthenticationExtensionsLargeBlobInputsJSON', base_config_1.TYPE], + ['AuthenticationExtensionsLargeBlobOutputs', base_config_1.TYPE], + ['AuthenticationExtensionsLargeBlobOutputsJSON', base_config_1.TYPE], + ['AuthenticationExtensionsPRFInputs', base_config_1.TYPE], + ['AuthenticationExtensionsPRFInputsJSON', base_config_1.TYPE], + ['AuthenticationExtensionsPRFOutputs', base_config_1.TYPE], + ['AuthenticationExtensionsPRFOutputsJSON', base_config_1.TYPE], + ['AuthenticationExtensionsPRFValues', base_config_1.TYPE], + ['AuthenticationExtensionsPRFValuesJSON', base_config_1.TYPE], + ['AuthenticationResponseJSON', base_config_1.TYPE], + ['AuthenticatorAssertionResponseJSON', base_config_1.TYPE], + ['AuthenticatorAttestationResponseJSON', base_config_1.TYPE], + ['AuthenticatorSelectionCriteria', base_config_1.TYPE], + ['AvcEncoderConfig', base_config_1.TYPE], + ['BiquadFilterOptions', base_config_1.TYPE], + ['BlobEventInit', base_config_1.TYPE], + ['BlobPropertyBag', base_config_1.TYPE], + ['CSSMatrixComponentOptions', base_config_1.TYPE], + ['CSSNumericType', base_config_1.TYPE], + ['CSSStyleSheetInit', base_config_1.TYPE], + ['CacheQueryOptions', base_config_1.TYPE], + ['CanvasRenderingContext2DSettings', base_config_1.TYPE], + ['CaretPositionFromPointOptions', base_config_1.TYPE], + ['ChannelMergerOptions', base_config_1.TYPE], + ['ChannelSplitterOptions', base_config_1.TYPE], + ['CheckVisibilityOptions', base_config_1.TYPE], + ['ClientQueryOptions', base_config_1.TYPE], + ['ClipboardEventInit', base_config_1.TYPE], + ['ClipboardItemOptions', base_config_1.TYPE], + ['CloseEventInit', base_config_1.TYPE], + ['CommandEventInit', base_config_1.TYPE], + ['CompositionEventInit', base_config_1.TYPE], + ['ComputedEffectTiming', base_config_1.TYPE], + ['ComputedKeyframe', base_config_1.TYPE], + ['ConstantSourceOptions', base_config_1.TYPE], + ['ConstrainBooleanOrDOMStringParameters', base_config_1.TYPE], + ['ConstrainBooleanParameters', base_config_1.TYPE], + ['ConstrainDOMStringParameters', base_config_1.TYPE], + ['ConstrainDoubleRange', base_config_1.TYPE], + ['ConstrainULongRange', base_config_1.TYPE], + ['ContentVisibilityAutoStateChangeEventInit', base_config_1.TYPE], + ['ConvolverOptions', base_config_1.TYPE], + ['CookieChangeEventInit', base_config_1.TYPE], + ['CookieInit', base_config_1.TYPE], + ['CookieListItem', base_config_1.TYPE], + ['CookieStoreDeleteOptions', base_config_1.TYPE], + ['CookieStoreGetOptions', base_config_1.TYPE], + ['CredentialCreationOptions', base_config_1.TYPE], + ['CredentialPropertiesOutput', base_config_1.TYPE], + ['CredentialRequestOptions', base_config_1.TYPE], + ['CryptoKeyPair', base_config_1.TYPE], + ['CurrentUserDetailsOptions', base_config_1.TYPE], + ['CustomEventInit', base_config_1.TYPE], + ['DOMMatrix2DInit', base_config_1.TYPE], + ['DOMMatrixInit', base_config_1.TYPE], + ['DOMPointInit', base_config_1.TYPE], + ['DOMQuadInit', base_config_1.TYPE], + ['DOMRectInit', base_config_1.TYPE], + ['DelayOptions', base_config_1.TYPE], + ['DeviceMotionEventAccelerationInit', base_config_1.TYPE], + ['DeviceMotionEventInit', base_config_1.TYPE], + ['DeviceMotionEventRotationRateInit', base_config_1.TYPE], + ['DeviceOrientationEventInit', base_config_1.TYPE], + ['DisplayMediaStreamOptions', base_config_1.TYPE], + ['DocumentTimelineOptions', base_config_1.TYPE], + ['DoubleRange', base_config_1.TYPE], + ['DragEventInit', base_config_1.TYPE], + ['DynamicsCompressorOptions', base_config_1.TYPE], + ['EcKeyAlgorithm', base_config_1.TYPE], + ['EcKeyGenParams', base_config_1.TYPE], + ['EcKeyImportParams', base_config_1.TYPE], + ['EcdhKeyDeriveParams', base_config_1.TYPE], + ['EcdsaParams', base_config_1.TYPE], + ['EffectTiming', base_config_1.TYPE], + ['ElementCreationOptions', base_config_1.TYPE], + ['ElementDefinitionOptions', base_config_1.TYPE], + ['EncodedAudioChunkInit', base_config_1.TYPE], + ['EncodedAudioChunkMetadata', base_config_1.TYPE], + ['EncodedVideoChunkInit', base_config_1.TYPE], + ['EncodedVideoChunkMetadata', base_config_1.TYPE], + ['ErrorEventInit', base_config_1.TYPE], + ['EventInit', base_config_1.TYPE], + ['EventListenerOptions', base_config_1.TYPE], + ['EventModifierInit', base_config_1.TYPE], + ['EventSourceInit', base_config_1.TYPE], + ['FilePropertyBag', base_config_1.TYPE], + ['FileSystemCreateWritableOptions', base_config_1.TYPE], + ['FileSystemFlags', base_config_1.TYPE], + ['FileSystemGetDirectoryOptions', base_config_1.TYPE], + ['FileSystemGetFileOptions', base_config_1.TYPE], + ['FileSystemRemoveOptions', base_config_1.TYPE], + ['FocusEventInit', base_config_1.TYPE], + ['FocusOptions', base_config_1.TYPE], + ['FontFaceDescriptors', base_config_1.TYPE], + ['FontFaceSetLoadEventInit', base_config_1.TYPE], + ['FormDataEventInit', base_config_1.TYPE], + ['FullscreenOptions', base_config_1.TYPE], + ['GPUBindGroupDescriptor', base_config_1.TYPE], + ['GPUBindGroupEntry', base_config_1.TYPE], + ['GPUBindGroupLayoutDescriptor', base_config_1.TYPE], + ['GPUBindGroupLayoutEntry', base_config_1.TYPE], + ['GPUBlendComponent', base_config_1.TYPE], + ['GPUBlendState', base_config_1.TYPE], + ['GPUBufferBinding', base_config_1.TYPE], + ['GPUBufferBindingLayout', base_config_1.TYPE], + ['GPUBufferDescriptor', base_config_1.TYPE], + ['GPUCanvasConfiguration', base_config_1.TYPE], + ['GPUCanvasToneMapping', base_config_1.TYPE], + ['GPUColorDict', base_config_1.TYPE], + ['GPUColorTargetState', base_config_1.TYPE], + ['GPUCommandBufferDescriptor', base_config_1.TYPE], + ['GPUCommandEncoderDescriptor', base_config_1.TYPE], + ['GPUComputePassDescriptor', base_config_1.TYPE], + ['GPUComputePassTimestampWrites', base_config_1.TYPE], + ['GPUComputePipelineDescriptor', base_config_1.TYPE], + ['GPUCopyExternalImageDestInfo', base_config_1.TYPE], + ['GPUCopyExternalImageSourceInfo', base_config_1.TYPE], + ['GPUDepthStencilState', base_config_1.TYPE], + ['GPUDeviceDescriptor', base_config_1.TYPE], + ['GPUExtent3DDict', base_config_1.TYPE], + ['GPUExternalTextureBindingLayout', base_config_1.TYPE], + ['GPUExternalTextureDescriptor', base_config_1.TYPE], + ['GPUFragmentState', base_config_1.TYPE], + ['GPUMultisampleState', base_config_1.TYPE], + ['GPUObjectDescriptorBase', base_config_1.TYPE], + ['GPUOrigin2DDict', base_config_1.TYPE], + ['GPUOrigin3DDict', base_config_1.TYPE], + ['GPUPipelineDescriptorBase', base_config_1.TYPE], + ['GPUPipelineErrorInit', base_config_1.TYPE], + ['GPUPipelineLayoutDescriptor', base_config_1.TYPE], + ['GPUPrimitiveState', base_config_1.TYPE], + ['GPUProgrammableStage', base_config_1.TYPE], + ['GPUQuerySetDescriptor', base_config_1.TYPE], + ['GPUQueueDescriptor', base_config_1.TYPE], + ['GPURenderBundleDescriptor', base_config_1.TYPE], + ['GPURenderBundleEncoderDescriptor', base_config_1.TYPE], + ['GPURenderPassColorAttachment', base_config_1.TYPE], + ['GPURenderPassDepthStencilAttachment', base_config_1.TYPE], + ['GPURenderPassDescriptor', base_config_1.TYPE], + ['GPURenderPassLayout', base_config_1.TYPE], + ['GPURenderPassTimestampWrites', base_config_1.TYPE], + ['GPURenderPipelineDescriptor', base_config_1.TYPE], + ['GPURequestAdapterOptions', base_config_1.TYPE], + ['GPUSamplerBindingLayout', base_config_1.TYPE], + ['GPUSamplerDescriptor', base_config_1.TYPE], + ['GPUShaderModuleDescriptor', base_config_1.TYPE], + ['GPUStencilFaceState', base_config_1.TYPE], + ['GPUStorageTextureBindingLayout', base_config_1.TYPE], + ['GPUTexelCopyBufferInfo', base_config_1.TYPE], + ['GPUTexelCopyBufferLayout', base_config_1.TYPE], + ['GPUTexelCopyTextureInfo', base_config_1.TYPE], + ['GPUTextureBindingLayout', base_config_1.TYPE], + ['GPUTextureDescriptor', base_config_1.TYPE], + ['GPUTextureViewDescriptor', base_config_1.TYPE], + ['GPUUncapturedErrorEventInit', base_config_1.TYPE], + ['GPUVertexAttribute', base_config_1.TYPE], + ['GPUVertexBufferLayout', base_config_1.TYPE], + ['GPUVertexState', base_config_1.TYPE], + ['GainOptions', base_config_1.TYPE], + ['GamepadEffectParameters', base_config_1.TYPE], + ['GamepadEventInit', base_config_1.TYPE], + ['GetAnimationsOptions', base_config_1.TYPE], + ['GetComposedRangesOptions', base_config_1.TYPE], + ['GetHTMLOptions', base_config_1.TYPE], + ['GetNotificationOptions', base_config_1.TYPE], + ['GetRootNodeOptions', base_config_1.TYPE], + ['HashChangeEventInit', base_config_1.TYPE], + ['HkdfParams', base_config_1.TYPE], + ['HmacImportParams', base_config_1.TYPE], + ['HmacKeyAlgorithm', base_config_1.TYPE], + ['HmacKeyGenParams', base_config_1.TYPE], + ['IDBDatabaseInfo', base_config_1.TYPE], + ['IDBIndexParameters', base_config_1.TYPE], + ['IDBObjectStoreParameters', base_config_1.TYPE], + ['IDBTransactionOptions', base_config_1.TYPE], + ['IDBVersionChangeEventInit', base_config_1.TYPE], + ['IIRFilterOptions', base_config_1.TYPE], + ['IdleRequestOptions', base_config_1.TYPE], + ['ImageBitmapOptions', base_config_1.TYPE], + ['ImageBitmapRenderingContextSettings', base_config_1.TYPE], + ['ImageDataSettings', base_config_1.TYPE], + ['ImageDecodeOptions', base_config_1.TYPE], + ['ImageDecodeResult', base_config_1.TYPE], + ['ImageDecoderInit', base_config_1.TYPE], + ['ImageEncodeOptions', base_config_1.TYPE], + ['ImportNodeOptions', base_config_1.TYPE], + ['InputEventInit', base_config_1.TYPE], + ['IntersectionObserverInit', base_config_1.TYPE], + ['JsonWebKey', base_config_1.TYPE], + ['KeyAlgorithm', base_config_1.TYPE], + ['KeySystemTrackConfiguration', base_config_1.TYPE], + ['KeyboardEventInit', base_config_1.TYPE], + ['Keyframe', base_config_1.TYPE], + ['KeyframeAnimationOptions', base_config_1.TYPE], + ['KeyframeEffectOptions', base_config_1.TYPE], + ['LockInfo', base_config_1.TYPE], + ['LockManagerSnapshot', base_config_1.TYPE], + ['LockOptions', base_config_1.TYPE], + ['MIDIConnectionEventInit', base_config_1.TYPE], + ['MIDIMessageEventInit', base_config_1.TYPE], + ['MIDIOptions', base_config_1.TYPE], + ['MediaCapabilitiesDecodingInfo', base_config_1.TYPE], + ['MediaCapabilitiesEncodingInfo', base_config_1.TYPE], + ['MediaCapabilitiesInfo', base_config_1.TYPE], + ['MediaCapabilitiesKeySystemConfiguration', base_config_1.TYPE], + ['MediaConfiguration', base_config_1.TYPE], + ['MediaDecodingConfiguration', base_config_1.TYPE], + ['MediaElementAudioSourceOptions', base_config_1.TYPE], + ['MediaEncodingConfiguration', base_config_1.TYPE], + ['MediaEncryptedEventInit', base_config_1.TYPE], + ['MediaImage', base_config_1.TYPE], + ['MediaKeyMessageEventInit', base_config_1.TYPE], + ['MediaKeySystemConfiguration', base_config_1.TYPE], + ['MediaKeySystemMediaCapability', base_config_1.TYPE], + ['MediaKeysPolicy', base_config_1.TYPE], + ['MediaMetadataInit', base_config_1.TYPE], + ['MediaPositionState', base_config_1.TYPE], + ['MediaQueryListEventInit', base_config_1.TYPE], + ['MediaRecorderOptions', base_config_1.TYPE], + ['MediaSessionActionDetails', base_config_1.TYPE], + ['MediaSettingsRange', base_config_1.TYPE], + ['MediaStreamAudioSourceOptions', base_config_1.TYPE], + ['MediaStreamConstraints', base_config_1.TYPE], + ['MediaStreamTrackEventInit', base_config_1.TYPE], + ['MediaTrackCapabilities', base_config_1.TYPE], + ['MediaTrackConstraintSet', base_config_1.TYPE], + ['MediaTrackConstraints', base_config_1.TYPE], + ['MediaTrackSettings', base_config_1.TYPE], + ['MediaTrackSupportedConstraints', base_config_1.TYPE], + ['MessageEventInit', base_config_1.TYPE], + ['MouseEventInit', base_config_1.TYPE], + ['MultiCacheQueryOptions', base_config_1.TYPE], + ['MutationObserverInit', base_config_1.TYPE], + ['NavigateEventInit', base_config_1.TYPE], + ['NavigationCurrentEntryChangeEventInit', base_config_1.TYPE], + ['NavigationInterceptOptions', base_config_1.TYPE], + ['NavigationNavigateOptions', base_config_1.TYPE], + ['NavigationOptions', base_config_1.TYPE], + ['NavigationPreloadState', base_config_1.TYPE], + ['NavigationReloadOptions', base_config_1.TYPE], + ['NavigationResult', base_config_1.TYPE], + ['NavigationUpdateCurrentEntryOptions', base_config_1.TYPE], + ['NotificationOptions', base_config_1.TYPE], + ['OfflineAudioCompletionEventInit', base_config_1.TYPE], + ['OfflineAudioContextOptions', base_config_1.TYPE], + ['OptionalEffectTiming', base_config_1.TYPE], + ['OpusEncoderConfig', base_config_1.TYPE], + ['OscillatorOptions', base_config_1.TYPE], + ['PageRevealEventInit', base_config_1.TYPE], + ['PageSwapEventInit', base_config_1.TYPE], + ['PageTransitionEventInit', base_config_1.TYPE], + ['PannerOptions', base_config_1.TYPE], + ['PayerErrors', base_config_1.TYPE], + ['PaymentCurrencyAmount', base_config_1.TYPE], + ['PaymentDetailsBase', base_config_1.TYPE], + ['PaymentDetailsInit', base_config_1.TYPE], + ['PaymentDetailsModifier', base_config_1.TYPE], + ['PaymentDetailsUpdate', base_config_1.TYPE], + ['PaymentItem', base_config_1.TYPE], + ['PaymentMethodChangeEventInit', base_config_1.TYPE], + ['PaymentMethodData', base_config_1.TYPE], + ['PaymentOptions', base_config_1.TYPE], + ['PaymentRequestUpdateEventInit', base_config_1.TYPE], + ['PaymentShippingOption', base_config_1.TYPE], + ['PaymentValidationErrors', base_config_1.TYPE], + ['Pbkdf2Params', base_config_1.TYPE], + ['PerformanceMarkOptions', base_config_1.TYPE], + ['PerformanceMeasureOptions', base_config_1.TYPE], + ['PerformanceObserverInit', base_config_1.TYPE], + ['PeriodicWaveConstraints', base_config_1.TYPE], + ['PeriodicWaveOptions', base_config_1.TYPE], + ['PermissionDescriptor', base_config_1.TYPE], + ['PhotoCapabilities', base_config_1.TYPE], + ['PhotoSettings', base_config_1.TYPE], + ['PictureInPictureEventInit', base_config_1.TYPE], + ['PlaneLayout', base_config_1.TYPE], + ['PointerEventInit', base_config_1.TYPE], + ['PointerLockOptions', base_config_1.TYPE], + ['PopStateEventInit', base_config_1.TYPE], + ['PositionOptions', base_config_1.TYPE], + ['ProgressEventInit', base_config_1.TYPE], + ['PromiseRejectionEventInit', base_config_1.TYPE], + ['PropertyDefinition', base_config_1.TYPE], + ['PropertyIndexedKeyframes', base_config_1.TYPE], + ['PublicKeyCredentialCreationOptions', base_config_1.TYPE], + ['PublicKeyCredentialCreationOptionsJSON', base_config_1.TYPE], + ['PublicKeyCredentialDescriptor', base_config_1.TYPE], + ['PublicKeyCredentialDescriptorJSON', base_config_1.TYPE], + ['PublicKeyCredentialEntity', base_config_1.TYPE], + ['PublicKeyCredentialParameters', base_config_1.TYPE], + ['PublicKeyCredentialRequestOptions', base_config_1.TYPE], + ['PublicKeyCredentialRequestOptionsJSON', base_config_1.TYPE], + ['PublicKeyCredentialRpEntity', base_config_1.TYPE], + ['PublicKeyCredentialUserEntity', base_config_1.TYPE], + ['PublicKeyCredentialUserEntityJSON', base_config_1.TYPE], + ['PushSubscriptionJSON', base_config_1.TYPE], + ['PushSubscriptionOptionsInit', base_config_1.TYPE], + ['QueuingStrategy', base_config_1.TYPE], + ['QueuingStrategyInit', base_config_1.TYPE], + ['RTCAnswerOptions', base_config_1.TYPE], + ['RTCCertificateExpiration', base_config_1.TYPE], + ['RTCConfiguration', base_config_1.TYPE], + ['RTCDTMFToneChangeEventInit', base_config_1.TYPE], + ['RTCDataChannelEventInit', base_config_1.TYPE], + ['RTCDataChannelInit', base_config_1.TYPE], + ['RTCDtlsFingerprint', base_config_1.TYPE], + ['RTCEncodedAudioFrameMetadata', base_config_1.TYPE], + ['RTCEncodedFrameMetadata', base_config_1.TYPE], + ['RTCEncodedVideoFrameMetadata', base_config_1.TYPE], + ['RTCErrorEventInit', base_config_1.TYPE], + ['RTCErrorInit', base_config_1.TYPE], + ['RTCIceCandidateInit', base_config_1.TYPE], + ['RTCIceCandidatePairStats', base_config_1.TYPE], + ['RTCIceServer', base_config_1.TYPE], + ['RTCInboundRtpStreamStats', base_config_1.TYPE], + ['RTCLocalIceCandidateInit', base_config_1.TYPE], + ['RTCLocalSessionDescriptionInit', base_config_1.TYPE], + ['RTCOfferAnswerOptions', base_config_1.TYPE], + ['RTCOfferOptions', base_config_1.TYPE], + ['RTCOutboundRtpStreamStats', base_config_1.TYPE], + ['RTCPeerConnectionIceErrorEventInit', base_config_1.TYPE], + ['RTCPeerConnectionIceEventInit', base_config_1.TYPE], + ['RTCReceivedRtpStreamStats', base_config_1.TYPE], + ['RTCRtcpParameters', base_config_1.TYPE], + ['RTCRtpCapabilities', base_config_1.TYPE], + ['RTCRtpCodec', base_config_1.TYPE], + ['RTCRtpCodecParameters', base_config_1.TYPE], + ['RTCRtpCodingParameters', base_config_1.TYPE], + ['RTCRtpContributingSource', base_config_1.TYPE], + ['RTCRtpEncodingParameters', base_config_1.TYPE], + ['RTCRtpHeaderExtensionCapability', base_config_1.TYPE], + ['RTCRtpHeaderExtensionParameters', base_config_1.TYPE], + ['RTCRtpParameters', base_config_1.TYPE], + ['RTCRtpReceiveParameters', base_config_1.TYPE], + ['RTCRtpSendParameters', base_config_1.TYPE], + ['RTCRtpStreamStats', base_config_1.TYPE], + ['RTCRtpSynchronizationSource', base_config_1.TYPE], + ['RTCRtpTransceiverInit', base_config_1.TYPE], + ['RTCSentRtpStreamStats', base_config_1.TYPE], + ['RTCSessionDescriptionInit', base_config_1.TYPE], + ['RTCSetParameterOptions', base_config_1.TYPE], + ['RTCStats', base_config_1.TYPE], + ['RTCTrackEventInit', base_config_1.TYPE], + ['RTCTransportStats', base_config_1.TYPE], + ['ReadableStreamBYOBReaderReadOptions', base_config_1.TYPE], + ['ReadableStreamGetReaderOptions', base_config_1.TYPE], + ['ReadableStreamIteratorOptions', base_config_1.TYPE], + ['ReadableStreamReadDoneResult', base_config_1.TYPE], + ['ReadableStreamReadValueResult', base_config_1.TYPE], + ['ReadableWritablePair', base_config_1.TYPE], + ['RegistrationOptions', base_config_1.TYPE], + ['RegistrationResponseJSON', base_config_1.TYPE], + ['Report', base_config_1.TYPE], + ['ReportBody', base_config_1.TYPE], + ['ReportingObserverOptions', base_config_1.TYPE], + ['RequestInit', base_config_1.TYPE], + ['ResizeObserverOptions', base_config_1.TYPE], + ['ResponseInit', base_config_1.TYPE], + ['RsaHashedImportParams', base_config_1.TYPE], + ['RsaHashedKeyAlgorithm', base_config_1.TYPE], + ['RsaHashedKeyGenParams', base_config_1.TYPE], + ['RsaKeyAlgorithm', base_config_1.TYPE], + ['RsaKeyGenParams', base_config_1.TYPE], + ['RsaOaepParams', base_config_1.TYPE], + ['RsaOtherPrimesInfo', base_config_1.TYPE], + ['RsaPssParams', base_config_1.TYPE], + ['SVGBoundingBoxOptions', base_config_1.TYPE], + ['SanitizerAttributeNamespace', base_config_1.TYPE], + ['SanitizerConfig', base_config_1.TYPE], + ['SanitizerElementNamespace', base_config_1.TYPE], + ['SanitizerElementNamespaceWithAttributes', base_config_1.TYPE], + ['SchedulerPostTaskOptions', base_config_1.TYPE], + ['ScrollIntoViewOptions', base_config_1.TYPE], + ['ScrollOptions', base_config_1.TYPE], + ['ScrollTimelineOptions', base_config_1.TYPE], + ['ScrollToOptions', base_config_1.TYPE], + ['SecurityPolicyViolationEventInit', base_config_1.TYPE], + ['ShadowRootInit', base_config_1.TYPE], + ['ShareData', base_config_1.TYPE], + ['ShowPopoverOptions', base_config_1.TYPE], + ['SpeechRecognitionErrorEventInit', base_config_1.TYPE], + ['SpeechRecognitionEventInit', base_config_1.TYPE], + ['SpeechSynthesisErrorEventInit', base_config_1.TYPE], + ['SpeechSynthesisEventInit', base_config_1.TYPE], + ['StartViewTransitionOptions', base_config_1.TYPE], + ['StaticRangeInit', base_config_1.TYPE], + ['StereoPannerOptions', base_config_1.TYPE], + ['StorageEstimate', base_config_1.TYPE], + ['StorageEventInit', base_config_1.TYPE], + ['StreamPipeOptions', base_config_1.TYPE], + ['StructuredSerializeOptions', base_config_1.TYPE], + ['SubmitEventInit', base_config_1.TYPE], + ['SvcOutputMetadata', base_config_1.TYPE], + ['TaskControllerInit', base_config_1.TYPE], + ['TaskPriorityChangeEventInit', base_config_1.TYPE], + ['TaskSignalAnyInit', base_config_1.TYPE], + ['TextDecodeOptions', base_config_1.TYPE], + ['TextDecoderOptions', base_config_1.TYPE], + ['TextEncoderEncodeIntoResult', base_config_1.TYPE], + ['TimelineRangeOffset', base_config_1.TYPE], + ['ToggleEventInit', base_config_1.TYPE], + ['TogglePopoverOptions', base_config_1.TYPE], + ['TouchEventInit', base_config_1.TYPE], + ['TouchInit', base_config_1.TYPE], + ['TrackEventInit', base_config_1.TYPE], + ['Transformer', base_config_1.TYPE], + ['TransitionEventInit', base_config_1.TYPE], + ['UIEventInit', base_config_1.TYPE], + ['ULongRange', base_config_1.TYPE], + ['URLPatternComponentResult', base_config_1.TYPE], + ['URLPatternInit', base_config_1.TYPE], + ['URLPatternOptions', base_config_1.TYPE], + ['URLPatternResult', base_config_1.TYPE], + ['UnderlyingByteSource', base_config_1.TYPE], + ['UnderlyingDefaultSource', base_config_1.TYPE], + ['UnderlyingSink', base_config_1.TYPE], + ['UnderlyingSource', base_config_1.TYPE], + ['UnknownCredentialOptions', base_config_1.TYPE], + ['ValidityStateFlags', base_config_1.TYPE], + ['VideoColorSpaceInit', base_config_1.TYPE], + ['VideoConfiguration', base_config_1.TYPE], + ['VideoDecoderConfig', base_config_1.TYPE], + ['VideoDecoderInit', base_config_1.TYPE], + ['VideoDecoderSupport', base_config_1.TYPE], + ['VideoEncoderConfig', base_config_1.TYPE], + ['VideoEncoderEncodeOptions', base_config_1.TYPE], + ['VideoEncoderEncodeOptionsForAvc', base_config_1.TYPE], + ['VideoEncoderInit', base_config_1.TYPE], + ['VideoEncoderSupport', base_config_1.TYPE], + ['VideoFrameBufferInit', base_config_1.TYPE], + ['VideoFrameCallbackMetadata', base_config_1.TYPE], + ['VideoFrameCopyToOptions', base_config_1.TYPE], + ['VideoFrameInit', base_config_1.TYPE], + ['ViewTimelineOptions', base_config_1.TYPE], + ['WaveShaperOptions', base_config_1.TYPE], + ['WebGLContextAttributes', base_config_1.TYPE], + ['WebGLContextEventInit', base_config_1.TYPE], + ['WebTransportCloseInfo', base_config_1.TYPE], + ['WebTransportErrorOptions', base_config_1.TYPE], + ['WebTransportHash', base_config_1.TYPE], + ['WebTransportOptions', base_config_1.TYPE], + ['WebTransportSendOptions', base_config_1.TYPE], + ['WebTransportSendStreamOptions', base_config_1.TYPE], + ['WheelEventInit', base_config_1.TYPE], + ['WindowPostMessageOptions', base_config_1.TYPE], + ['WorkerOptions', base_config_1.TYPE], + ['WorkletOptions', base_config_1.TYPE], + ['WriteParams', base_config_1.TYPE], + ['NodeFilter', base_config_1.TYPE_VALUE], + ['XPathNSResolver', base_config_1.TYPE], + ['ANGLE_instanced_arrays', base_config_1.TYPE], + ['ARIAMixin', base_config_1.TYPE], + ['AbortController', base_config_1.TYPE_VALUE], + ['AbortSignalEventMap', base_config_1.TYPE], + ['AbortSignal', base_config_1.TYPE_VALUE], + ['AbstractRange', base_config_1.TYPE_VALUE], + ['AbstractWorkerEventMap', base_config_1.TYPE], + ['AbstractWorker', base_config_1.TYPE], + ['AnalyserNode', base_config_1.TYPE_VALUE], + ['Animatable', base_config_1.TYPE], + ['AnimationEventMap', base_config_1.TYPE], + ['Animation', base_config_1.TYPE_VALUE], + ['AnimationEffect', base_config_1.TYPE_VALUE], + ['AnimationEvent', base_config_1.TYPE_VALUE], + ['AnimationFrameProvider', base_config_1.TYPE], + ['AnimationPlaybackEvent', base_config_1.TYPE_VALUE], + ['AnimationTimeline', base_config_1.TYPE_VALUE], + ['Attr', base_config_1.TYPE_VALUE], + ['AudioBuffer', base_config_1.TYPE_VALUE], + ['AudioBufferSourceNode', base_config_1.TYPE_VALUE], + ['AudioContext', base_config_1.TYPE_VALUE], + ['AudioData', base_config_1.TYPE_VALUE], + ['AudioDecoderEventMap', base_config_1.TYPE], + ['AudioDecoder', base_config_1.TYPE_VALUE], + ['AudioDestinationNode', base_config_1.TYPE_VALUE], + ['AudioEncoderEventMap', base_config_1.TYPE], + ['AudioEncoder', base_config_1.TYPE_VALUE], + ['AudioListener', base_config_1.TYPE_VALUE], + ['AudioNode', base_config_1.TYPE_VALUE], + ['AudioParam', base_config_1.TYPE_VALUE], + ['AudioParamMap', base_config_1.TYPE_VALUE], + ['AudioProcessingEvent', base_config_1.TYPE_VALUE], + ['AudioScheduledSourceNodeEventMap', base_config_1.TYPE], + ['AudioScheduledSourceNode', base_config_1.TYPE_VALUE], + ['AudioWorklet', base_config_1.TYPE_VALUE], + ['AudioWorkletNodeEventMap', base_config_1.TYPE], + ['AudioWorkletNode', base_config_1.TYPE_VALUE], + ['AuthenticatorAssertionResponse', base_config_1.TYPE_VALUE], + ['AuthenticatorAttestationResponse', base_config_1.TYPE_VALUE], + ['AuthenticatorResponse', base_config_1.TYPE_VALUE], + ['BarProp', base_config_1.TYPE_VALUE], + ['BaseAudioContextEventMap', base_config_1.TYPE], + ['BaseAudioContext', base_config_1.TYPE_VALUE], + ['BeforeUnloadEvent', base_config_1.TYPE_VALUE], + ['BiquadFilterNode', base_config_1.TYPE_VALUE], + ['Blob', base_config_1.TYPE_VALUE], + ['BlobEvent', base_config_1.TYPE_VALUE], + ['Body', base_config_1.TYPE], + ['BroadcastChannelEventMap', base_config_1.TYPE], + ['BroadcastChannel', base_config_1.TYPE_VALUE], + ['ByteLengthQueuingStrategy', base_config_1.TYPE_VALUE], + ['CDATASection', base_config_1.TYPE_VALUE], + ['CSSAnimation', base_config_1.TYPE_VALUE], + ['CSSConditionRule', base_config_1.TYPE_VALUE], + ['CSSContainerRule', base_config_1.TYPE_VALUE], + ['CSSCounterStyleRule', base_config_1.TYPE_VALUE], + ['CSSFontFaceRule', base_config_1.TYPE_VALUE], + ['CSSFontFeatureValuesRule', base_config_1.TYPE_VALUE], + ['CSSFontPaletteValuesRule', base_config_1.TYPE_VALUE], + ['CSSGroupingRule', base_config_1.TYPE_VALUE], + ['CSSImageValue', base_config_1.TYPE_VALUE], + ['CSSImportRule', base_config_1.TYPE_VALUE], + ['CSSKeyframeRule', base_config_1.TYPE_VALUE], + ['CSSKeyframesRule', base_config_1.TYPE_VALUE], + ['CSSKeywordValue', base_config_1.TYPE_VALUE], + ['CSSLayerBlockRule', base_config_1.TYPE_VALUE], + ['CSSLayerStatementRule', base_config_1.TYPE_VALUE], + ['CSSMathClamp', base_config_1.TYPE_VALUE], + ['CSSMathInvert', base_config_1.TYPE_VALUE], + ['CSSMathMax', base_config_1.TYPE_VALUE], + ['CSSMathMin', base_config_1.TYPE_VALUE], + ['CSSMathNegate', base_config_1.TYPE_VALUE], + ['CSSMathProduct', base_config_1.TYPE_VALUE], + ['CSSMathSum', base_config_1.TYPE_VALUE], + ['CSSMathValue', base_config_1.TYPE_VALUE], + ['CSSMatrixComponent', base_config_1.TYPE_VALUE], + ['CSSMediaRule', base_config_1.TYPE_VALUE], + ['CSSNamespaceRule', base_config_1.TYPE_VALUE], + ['CSSNestedDeclarations', base_config_1.TYPE_VALUE], + ['CSSNumericArray', base_config_1.TYPE_VALUE], + ['CSSNumericValue', base_config_1.TYPE_VALUE], + ['CSSPageDescriptors', base_config_1.TYPE_VALUE], + ['CSSPageRule', base_config_1.TYPE_VALUE], + ['CSSPerspective', base_config_1.TYPE_VALUE], + ['CSSPositionTryDescriptors', base_config_1.TYPE_VALUE], + ['CSSPositionTryRule', base_config_1.TYPE_VALUE], + ['CSSPropertyRule', base_config_1.TYPE_VALUE], + ['CSSRotate', base_config_1.TYPE_VALUE], + ['CSSRule', base_config_1.TYPE_VALUE], + ['CSSRuleList', base_config_1.TYPE_VALUE], + ['CSSScale', base_config_1.TYPE_VALUE], + ['CSSScopeRule', base_config_1.TYPE_VALUE], + ['CSSSkew', base_config_1.TYPE_VALUE], + ['CSSSkewX', base_config_1.TYPE_VALUE], + ['CSSSkewY', base_config_1.TYPE_VALUE], + ['CSSStartingStyleRule', base_config_1.TYPE_VALUE], + ['CSSStyleDeclarationBase', base_config_1.TYPE], + ['CSSStyleDeclaration', base_config_1.TYPE_VALUE], + ['CSSStyleProperties', base_config_1.TYPE_VALUE], + ['CSSStyleRule', base_config_1.TYPE_VALUE], + ['CSSStyleSheet', base_config_1.TYPE_VALUE], + ['CSSStyleValue', base_config_1.TYPE_VALUE], + ['CSSSupportsRule', base_config_1.TYPE_VALUE], + ['CSSTransformComponent', base_config_1.TYPE_VALUE], + ['CSSTransformValue', base_config_1.TYPE_VALUE], + ['CSSTransition', base_config_1.TYPE_VALUE], + ['CSSTranslate', base_config_1.TYPE_VALUE], + ['CSSUnitValue', base_config_1.TYPE_VALUE], + ['CSSUnparsedValue', base_config_1.TYPE_VALUE], + ['CSSVariableReferenceValue', base_config_1.TYPE_VALUE], + ['CSSViewTransitionRule', base_config_1.TYPE_VALUE], + ['Cache', base_config_1.TYPE_VALUE], + ['CacheStorage', base_config_1.TYPE_VALUE], + ['CanvasCaptureMediaStreamTrack', base_config_1.TYPE_VALUE], + ['CanvasCompositing', base_config_1.TYPE], + ['CanvasDrawImage', base_config_1.TYPE], + ['CanvasDrawPath', base_config_1.TYPE], + ['CanvasFillStrokeStyles', base_config_1.TYPE], + ['CanvasFilters', base_config_1.TYPE], + ['CanvasGradient', base_config_1.TYPE_VALUE], + ['CanvasImageData', base_config_1.TYPE], + ['CanvasImageSmoothing', base_config_1.TYPE], + ['CanvasPath', base_config_1.TYPE], + ['CanvasPathDrawingStyles', base_config_1.TYPE], + ['CanvasPattern', base_config_1.TYPE_VALUE], + ['CanvasRect', base_config_1.TYPE], + ['CanvasRenderingContext2D', base_config_1.TYPE_VALUE], + ['CanvasSettings', base_config_1.TYPE], + ['CanvasShadowStyles', base_config_1.TYPE], + ['CanvasState', base_config_1.TYPE], + ['CanvasText', base_config_1.TYPE], + ['CanvasTextDrawingStyles', base_config_1.TYPE], + ['CanvasTransform', base_config_1.TYPE], + ['CanvasUserInterface', base_config_1.TYPE], + ['CaretPosition', base_config_1.TYPE_VALUE], + ['ChannelMergerNode', base_config_1.TYPE_VALUE], + ['ChannelSplitterNode', base_config_1.TYPE_VALUE], + ['CharacterData', base_config_1.TYPE_VALUE], + ['ChildNode', base_config_1.TYPE], + ['ClientRect', base_config_1.TYPE], + ['Clipboard', base_config_1.TYPE_VALUE], + ['ClipboardEvent', base_config_1.TYPE_VALUE], + ['ClipboardItem', base_config_1.TYPE_VALUE], + ['CloseEvent', base_config_1.TYPE_VALUE], + ['CommandEvent', base_config_1.TYPE_VALUE], + ['Comment', base_config_1.TYPE_VALUE], + ['CompositionEvent', base_config_1.TYPE_VALUE], + ['CompressionStream', base_config_1.TYPE_VALUE], + ['ConstantSourceNode', base_config_1.TYPE_VALUE], + ['ContentVisibilityAutoStateChangeEvent', base_config_1.TYPE_VALUE], + ['ConvolverNode', base_config_1.TYPE_VALUE], + ['CookieChangeEvent', base_config_1.TYPE_VALUE], + ['CookieStoreEventMap', base_config_1.TYPE], + ['CookieStore', base_config_1.TYPE_VALUE], + ['CookieStoreManager', base_config_1.TYPE_VALUE], + ['CountQueuingStrategy', base_config_1.TYPE_VALUE], + ['Credential', base_config_1.TYPE_VALUE], + ['CredentialsContainer', base_config_1.TYPE_VALUE], + ['Crypto', base_config_1.TYPE_VALUE], + ['CryptoKey', base_config_1.TYPE_VALUE], + ['CustomElementRegistry', base_config_1.TYPE_VALUE], + ['CustomEvent', base_config_1.TYPE_VALUE], + ['CustomStateSet', base_config_1.TYPE_VALUE], + ['DOMException', base_config_1.TYPE_VALUE], + ['DOMImplementation', base_config_1.TYPE_VALUE], + ['DOMMatrix', base_config_1.TYPE_VALUE], + ['SVGMatrix', base_config_1.TYPE_VALUE], + ['WebKitCSSMatrix', base_config_1.TYPE_VALUE], + ['DOMMatrixReadOnly', base_config_1.TYPE_VALUE], + ['DOMParser', base_config_1.TYPE_VALUE], + ['DOMPoint', base_config_1.TYPE_VALUE], + ['SVGPoint', base_config_1.TYPE_VALUE], + ['DOMPointReadOnly', base_config_1.TYPE_VALUE], + ['DOMQuad', base_config_1.TYPE_VALUE], + ['DOMRect', base_config_1.TYPE_VALUE], + ['SVGRect', base_config_1.TYPE_VALUE], + ['DOMRectList', base_config_1.TYPE_VALUE], + ['DOMRectReadOnly', base_config_1.TYPE_VALUE], + ['DOMStringList', base_config_1.TYPE_VALUE], + ['DOMStringMap', base_config_1.TYPE_VALUE], + ['DOMTokenList', base_config_1.TYPE_VALUE], + ['DataTransfer', base_config_1.TYPE_VALUE], + ['DataTransferItem', base_config_1.TYPE_VALUE], + ['DataTransferItemList', base_config_1.TYPE_VALUE], + ['DecompressionStream', base_config_1.TYPE_VALUE], + ['DelayNode', base_config_1.TYPE_VALUE], + ['DeviceMotionEvent', base_config_1.TYPE_VALUE], + ['DeviceMotionEventAcceleration', base_config_1.TYPE], + ['DeviceMotionEventRotationRate', base_config_1.TYPE], + ['DeviceOrientationEvent', base_config_1.TYPE_VALUE], + ['DigitalCredential', base_config_1.TYPE_VALUE], + ['DocumentEventMap', base_config_1.TYPE], + ['Document', base_config_1.TYPE_VALUE], + ['DocumentFragment', base_config_1.TYPE_VALUE], + ['DocumentOrShadowRoot', base_config_1.TYPE], + ['DocumentTimeline', base_config_1.TYPE_VALUE], + ['DocumentType', base_config_1.TYPE_VALUE], + ['DragEvent', base_config_1.TYPE_VALUE], + ['DynamicsCompressorNode', base_config_1.TYPE_VALUE], + ['EXT_blend_minmax', base_config_1.TYPE], + ['EXT_color_buffer_float', base_config_1.TYPE], + ['EXT_color_buffer_half_float', base_config_1.TYPE], + ['EXT_float_blend', base_config_1.TYPE], + ['EXT_frag_depth', base_config_1.TYPE], + ['EXT_sRGB', base_config_1.TYPE], + ['EXT_shader_texture_lod', base_config_1.TYPE], + ['EXT_texture_compression_bptc', base_config_1.TYPE], + ['EXT_texture_compression_rgtc', base_config_1.TYPE], + ['EXT_texture_filter_anisotropic', base_config_1.TYPE], + ['EXT_texture_norm16', base_config_1.TYPE], + ['ElementEventMap', base_config_1.TYPE], + ['Element', base_config_1.TYPE_VALUE], + ['ElementCSSInlineStyle', base_config_1.TYPE], + ['ElementContentEditable', base_config_1.TYPE], + ['ElementInternals', base_config_1.TYPE_VALUE], + ['EncodedAudioChunk', base_config_1.TYPE_VALUE], + ['EncodedVideoChunk', base_config_1.TYPE_VALUE], + ['ErrorEvent', base_config_1.TYPE_VALUE], + ['Event', base_config_1.TYPE_VALUE], + ['EventCounts', base_config_1.TYPE_VALUE], + ['EventListener', base_config_1.TYPE], + ['EventListenerObject', base_config_1.TYPE], + ['EventSourceEventMap', base_config_1.TYPE], + ['EventSource', base_config_1.TYPE_VALUE], + ['EventTarget', base_config_1.TYPE_VALUE], + ['External', base_config_1.TYPE_VALUE], + ['File', base_config_1.TYPE_VALUE], + ['FileList', base_config_1.TYPE_VALUE], + ['FileReaderEventMap', base_config_1.TYPE], + ['FileReader', base_config_1.TYPE_VALUE], + ['FileSystem', base_config_1.TYPE_VALUE], + ['FileSystemDirectoryEntry', base_config_1.TYPE_VALUE], + ['FileSystemDirectoryHandle', base_config_1.TYPE_VALUE], + ['FileSystemDirectoryReader', base_config_1.TYPE_VALUE], + ['FileSystemEntry', base_config_1.TYPE_VALUE], + ['FileSystemFileEntry', base_config_1.TYPE_VALUE], + ['FileSystemFileHandle', base_config_1.TYPE_VALUE], + ['FileSystemHandle', base_config_1.TYPE_VALUE], + ['FileSystemWritableFileStream', base_config_1.TYPE_VALUE], + ['FocusEvent', base_config_1.TYPE_VALUE], + ['FontFace', base_config_1.TYPE_VALUE], + ['FontFaceSetEventMap', base_config_1.TYPE], + ['FontFaceSet', base_config_1.TYPE_VALUE], + ['FontFaceSetLoadEvent', base_config_1.TYPE_VALUE], + ['FontFaceSource', base_config_1.TYPE], + ['FormData', base_config_1.TYPE_VALUE], + ['FormDataEvent', base_config_1.TYPE_VALUE], + ['FragmentDirective', base_config_1.TYPE_VALUE], + ['GPU', base_config_1.TYPE_VALUE], + ['GPUAdapter', base_config_1.TYPE_VALUE], + ['GPUAdapterInfo', base_config_1.TYPE_VALUE], + ['GPUBindGroup', base_config_1.TYPE_VALUE], + ['GPUBindGroupLayout', base_config_1.TYPE_VALUE], + ['GPUBindingCommandsMixin', base_config_1.TYPE], + ['GPUBuffer', base_config_1.TYPE_VALUE], + ['GPUCanvasContext', base_config_1.TYPE_VALUE], + ['GPUCommandBuffer', base_config_1.TYPE_VALUE], + ['GPUCommandEncoder', base_config_1.TYPE_VALUE], + ['GPUCompilationInfo', base_config_1.TYPE_VALUE], + ['GPUCompilationMessage', base_config_1.TYPE_VALUE], + ['GPUComputePassEncoder', base_config_1.TYPE_VALUE], + ['GPUComputePipeline', base_config_1.TYPE_VALUE], + ['GPUDebugCommandsMixin', base_config_1.TYPE], + ['GPUDeviceEventMap', base_config_1.TYPE], + ['GPUDevice', base_config_1.TYPE_VALUE], + ['GPUDeviceLostInfo', base_config_1.TYPE_VALUE], + ['GPUError', base_config_1.TYPE_VALUE], + ['GPUExternalTexture', base_config_1.TYPE_VALUE], + ['GPUInternalError', base_config_1.TYPE_VALUE], + ['GPUObjectBase', base_config_1.TYPE], + ['GPUOutOfMemoryError', base_config_1.TYPE_VALUE], + ['GPUPipelineBase', base_config_1.TYPE], + ['GPUPipelineError', base_config_1.TYPE_VALUE], + ['GPUPipelineLayout', base_config_1.TYPE_VALUE], + ['GPUQuerySet', base_config_1.TYPE_VALUE], + ['GPUQueue', base_config_1.TYPE_VALUE], + ['GPURenderBundle', base_config_1.TYPE_VALUE], + ['GPURenderBundleEncoder', base_config_1.TYPE_VALUE], + ['GPURenderCommandsMixin', base_config_1.TYPE], + ['GPURenderPassEncoder', base_config_1.TYPE_VALUE], + ['GPURenderPipeline', base_config_1.TYPE_VALUE], + ['GPUSampler', base_config_1.TYPE_VALUE], + ['GPUShaderModule', base_config_1.TYPE_VALUE], + ['GPUSupportedFeatures', base_config_1.TYPE_VALUE], + ['GPUSupportedLimits', base_config_1.TYPE_VALUE], + ['GPUTexture', base_config_1.TYPE_VALUE], + ['GPUTextureView', base_config_1.TYPE_VALUE], + ['GPUUncapturedErrorEvent', base_config_1.TYPE_VALUE], + ['GPUValidationError', base_config_1.TYPE_VALUE], + ['GainNode', base_config_1.TYPE_VALUE], + ['Gamepad', base_config_1.TYPE_VALUE], + ['GamepadButton', base_config_1.TYPE_VALUE], + ['GamepadEvent', base_config_1.TYPE_VALUE], + ['GamepadHapticActuator', base_config_1.TYPE_VALUE], + ['GenericTransformStream', base_config_1.TYPE], + ['Geolocation', base_config_1.TYPE_VALUE], + ['GeolocationCoordinates', base_config_1.TYPE_VALUE], + ['GeolocationPosition', base_config_1.TYPE_VALUE], + ['GeolocationPositionError', base_config_1.TYPE_VALUE], + ['GlobalEventHandlersEventMap', base_config_1.TYPE], + ['GlobalEventHandlers', base_config_1.TYPE], + ['HTMLAllCollection', base_config_1.TYPE_VALUE], + ['HTMLAnchorElement', base_config_1.TYPE_VALUE], + ['HTMLAreaElement', base_config_1.TYPE_VALUE], + ['HTMLAudioElement', base_config_1.TYPE_VALUE], + ['HTMLBRElement', base_config_1.TYPE_VALUE], + ['HTMLBaseElement', base_config_1.TYPE_VALUE], + ['HTMLBodyElementEventMap', base_config_1.TYPE], + ['HTMLBodyElement', base_config_1.TYPE_VALUE], + ['HTMLButtonElement', base_config_1.TYPE_VALUE], + ['HTMLCanvasElement', base_config_1.TYPE_VALUE], + ['HTMLCollectionBase', base_config_1.TYPE], + ['HTMLCollection', base_config_1.TYPE_VALUE], + ['HTMLCollectionOf', base_config_1.TYPE], + ['HTMLDListElement', base_config_1.TYPE_VALUE], + ['HTMLDataElement', base_config_1.TYPE_VALUE], + ['HTMLDataListElement', base_config_1.TYPE_VALUE], + ['HTMLDetailsElement', base_config_1.TYPE_VALUE], + ['HTMLDialogElement', base_config_1.TYPE_VALUE], + ['HTMLDirectoryElement', base_config_1.TYPE_VALUE], + ['HTMLDivElement', base_config_1.TYPE_VALUE], + ['HTMLDocument', base_config_1.TYPE_VALUE], + ['HTMLElementEventMap', base_config_1.TYPE], + ['HTMLElement', base_config_1.TYPE_VALUE], + ['HTMLEmbedElement', base_config_1.TYPE_VALUE], + ['HTMLFieldSetElement', base_config_1.TYPE_VALUE], + ['HTMLFontElement', base_config_1.TYPE_VALUE], + ['HTMLFormControlsCollection', base_config_1.TYPE_VALUE], + ['HTMLFormElement', base_config_1.TYPE_VALUE], + ['HTMLFrameElement', base_config_1.TYPE_VALUE], + ['HTMLFrameSetElementEventMap', base_config_1.TYPE], + ['HTMLFrameSetElement', base_config_1.TYPE_VALUE], + ['HTMLHRElement', base_config_1.TYPE_VALUE], + ['HTMLHeadElement', base_config_1.TYPE_VALUE], + ['HTMLHeadingElement', base_config_1.TYPE_VALUE], + ['HTMLHtmlElement', base_config_1.TYPE_VALUE], + ['HTMLHyperlinkElementUtils', base_config_1.TYPE], + ['HTMLIFrameElement', base_config_1.TYPE_VALUE], + ['HTMLImageElement', base_config_1.TYPE_VALUE], + ['HTMLInputElement', base_config_1.TYPE_VALUE], + ['HTMLLIElement', base_config_1.TYPE_VALUE], + ['HTMLLabelElement', base_config_1.TYPE_VALUE], + ['HTMLLegendElement', base_config_1.TYPE_VALUE], + ['HTMLLinkElement', base_config_1.TYPE_VALUE], + ['HTMLMapElement', base_config_1.TYPE_VALUE], + ['HTMLMarqueeElement', base_config_1.TYPE_VALUE], + ['HTMLMediaElementEventMap', base_config_1.TYPE], + ['HTMLMediaElement', base_config_1.TYPE_VALUE], + ['HTMLMenuElement', base_config_1.TYPE_VALUE], + ['HTMLMetaElement', base_config_1.TYPE_VALUE], + ['HTMLMeterElement', base_config_1.TYPE_VALUE], + ['HTMLModElement', base_config_1.TYPE_VALUE], + ['HTMLOListElement', base_config_1.TYPE_VALUE], + ['HTMLObjectElement', base_config_1.TYPE_VALUE], + ['HTMLOptGroupElement', base_config_1.TYPE_VALUE], + ['HTMLOptionElement', base_config_1.TYPE_VALUE], + ['HTMLOptionsCollection', base_config_1.TYPE_VALUE], + ['HTMLOrSVGElement', base_config_1.TYPE], + ['HTMLOutputElement', base_config_1.TYPE_VALUE], + ['HTMLParagraphElement', base_config_1.TYPE_VALUE], + ['HTMLParamElement', base_config_1.TYPE_VALUE], + ['HTMLPictureElement', base_config_1.TYPE_VALUE], + ['HTMLPreElement', base_config_1.TYPE_VALUE], + ['HTMLProgressElement', base_config_1.TYPE_VALUE], + ['HTMLQuoteElement', base_config_1.TYPE_VALUE], + ['HTMLScriptElement', base_config_1.TYPE_VALUE], + ['HTMLSelectElement', base_config_1.TYPE_VALUE], + ['HTMLSlotElement', base_config_1.TYPE_VALUE], + ['HTMLSourceElement', base_config_1.TYPE_VALUE], + ['HTMLSpanElement', base_config_1.TYPE_VALUE], + ['HTMLStyleElement', base_config_1.TYPE_VALUE], + ['HTMLTableCaptionElement', base_config_1.TYPE_VALUE], + ['HTMLTableCellElement', base_config_1.TYPE_VALUE], + ['HTMLTableColElement', base_config_1.TYPE_VALUE], + ['HTMLTableDataCellElement', base_config_1.TYPE], + ['HTMLTableElement', base_config_1.TYPE_VALUE], + ['HTMLTableHeaderCellElement', base_config_1.TYPE], + ['HTMLTableRowElement', base_config_1.TYPE_VALUE], + ['HTMLTableSectionElement', base_config_1.TYPE_VALUE], + ['HTMLTemplateElement', base_config_1.TYPE_VALUE], + ['HTMLTextAreaElement', base_config_1.TYPE_VALUE], + ['HTMLTimeElement', base_config_1.TYPE_VALUE], + ['HTMLTitleElement', base_config_1.TYPE_VALUE], + ['HTMLTrackElement', base_config_1.TYPE_VALUE], + ['HTMLUListElement', base_config_1.TYPE_VALUE], + ['HTMLUnknownElement', base_config_1.TYPE_VALUE], + ['HTMLVideoElementEventMap', base_config_1.TYPE], + ['HTMLVideoElement', base_config_1.TYPE_VALUE], + ['HashChangeEvent', base_config_1.TYPE_VALUE], + ['Headers', base_config_1.TYPE_VALUE], + ['Highlight', base_config_1.TYPE_VALUE], + ['HighlightRegistry', base_config_1.TYPE_VALUE], + ['History', base_config_1.TYPE_VALUE], + ['IDBCursor', base_config_1.TYPE_VALUE], + ['IDBCursorWithValue', base_config_1.TYPE_VALUE], + ['IDBDatabaseEventMap', base_config_1.TYPE], + ['IDBDatabase', base_config_1.TYPE_VALUE], + ['IDBFactory', base_config_1.TYPE_VALUE], + ['IDBIndex', base_config_1.TYPE_VALUE], + ['IDBKeyRange', base_config_1.TYPE_VALUE], + ['IDBObjectStore', base_config_1.TYPE_VALUE], + ['IDBOpenDBRequestEventMap', base_config_1.TYPE], + ['IDBOpenDBRequest', base_config_1.TYPE_VALUE], + ['IDBRequestEventMap', base_config_1.TYPE], + ['IDBRequest', base_config_1.TYPE_VALUE], + ['IDBTransactionEventMap', base_config_1.TYPE], + ['IDBTransaction', base_config_1.TYPE_VALUE], + ['IDBVersionChangeEvent', base_config_1.TYPE_VALUE], + ['IIRFilterNode', base_config_1.TYPE_VALUE], + ['IdleDeadline', base_config_1.TYPE_VALUE], + ['ImageBitmap', base_config_1.TYPE_VALUE], + ['ImageBitmapRenderingContext', base_config_1.TYPE_VALUE], + ['ImageCapture', base_config_1.TYPE_VALUE], + ['ImageData', base_config_1.TYPE_VALUE], + ['ImageDecoder', base_config_1.TYPE_VALUE], + ['ImageTrack', base_config_1.TYPE_VALUE], + ['ImageTrackList', base_config_1.TYPE_VALUE], + ['ImportMeta', base_config_1.TYPE], + ['InputDeviceInfo', base_config_1.TYPE_VALUE], + ['InputEvent', base_config_1.TYPE_VALUE], + ['IntersectionObserver', base_config_1.TYPE_VALUE], + ['IntersectionObserverEntry', base_config_1.TYPE_VALUE], + ['KHR_parallel_shader_compile', base_config_1.TYPE], + ['KeyboardEvent', base_config_1.TYPE_VALUE], + ['KeyframeEffect', base_config_1.TYPE_VALUE], + ['LargestContentfulPaint', base_config_1.TYPE_VALUE], + ['LinkStyle', base_config_1.TYPE], + ['Location', base_config_1.TYPE_VALUE], + ['Lock', base_config_1.TYPE_VALUE], + ['LockManager', base_config_1.TYPE_VALUE], + ['MIDIAccessEventMap', base_config_1.TYPE], + ['MIDIAccess', base_config_1.TYPE_VALUE], + ['MIDIConnectionEvent', base_config_1.TYPE_VALUE], + ['MIDIInputEventMap', base_config_1.TYPE], + ['MIDIInput', base_config_1.TYPE_VALUE], + ['MIDIInputMap', base_config_1.TYPE_VALUE], + ['MIDIMessageEvent', base_config_1.TYPE_VALUE], + ['MIDIOutput', base_config_1.TYPE_VALUE], + ['MIDIOutputMap', base_config_1.TYPE_VALUE], + ['MIDIPortEventMap', base_config_1.TYPE], + ['MIDIPort', base_config_1.TYPE_VALUE], + ['MathMLElementEventMap', base_config_1.TYPE], + ['MathMLElement', base_config_1.TYPE_VALUE], + ['MediaCapabilities', base_config_1.TYPE_VALUE], + ['MediaDeviceInfo', base_config_1.TYPE_VALUE], + ['MediaDevicesEventMap', base_config_1.TYPE], + ['MediaDevices', base_config_1.TYPE_VALUE], + ['MediaElementAudioSourceNode', base_config_1.TYPE_VALUE], + ['MediaEncryptedEvent', base_config_1.TYPE_VALUE], + ['MediaError', base_config_1.TYPE_VALUE], + ['MediaKeyMessageEvent', base_config_1.TYPE_VALUE], + ['MediaKeySessionEventMap', base_config_1.TYPE], + ['MediaKeySession', base_config_1.TYPE_VALUE], + ['MediaKeyStatusMap', base_config_1.TYPE_VALUE], + ['MediaKeySystemAccess', base_config_1.TYPE_VALUE], + ['MediaKeys', base_config_1.TYPE_VALUE], + ['MediaList', base_config_1.TYPE_VALUE], + ['MediaMetadata', base_config_1.TYPE_VALUE], + ['MediaQueryListEventMap', base_config_1.TYPE], + ['MediaQueryList', base_config_1.TYPE_VALUE], + ['MediaQueryListEvent', base_config_1.TYPE_VALUE], + ['MediaRecorderEventMap', base_config_1.TYPE], + ['MediaRecorder', base_config_1.TYPE_VALUE], + ['MediaSession', base_config_1.TYPE_VALUE], + ['MediaSourceEventMap', base_config_1.TYPE], + ['MediaSource', base_config_1.TYPE_VALUE], + ['MediaSourceHandle', base_config_1.TYPE_VALUE], + ['MediaStreamEventMap', base_config_1.TYPE], + ['MediaStream', base_config_1.TYPE_VALUE], + ['MediaStreamAudioDestinationNode', base_config_1.TYPE_VALUE], + ['MediaStreamAudioSourceNode', base_config_1.TYPE_VALUE], + ['MediaStreamTrackEventMap', base_config_1.TYPE], + ['MediaStreamTrack', base_config_1.TYPE_VALUE], + ['MediaStreamTrackEvent', base_config_1.TYPE_VALUE], + ['MessageChannel', base_config_1.TYPE_VALUE], + ['MessageEvent', base_config_1.TYPE_VALUE], + ['MessageEventTargetEventMap', base_config_1.TYPE], + ['MessageEventTarget', base_config_1.TYPE], + ['MessagePortEventMap', base_config_1.TYPE], + ['MessagePort', base_config_1.TYPE_VALUE], + ['MimeType', base_config_1.TYPE_VALUE], + ['MimeTypeArray', base_config_1.TYPE_VALUE], + ['MouseEvent', base_config_1.TYPE_VALUE], + ['MutationObserver', base_config_1.TYPE_VALUE], + ['MutationRecord', base_config_1.TYPE_VALUE], + ['NamedNodeMap', base_config_1.TYPE_VALUE], + ['NavigateEvent', base_config_1.TYPE_VALUE], + ['NavigationEventMap', base_config_1.TYPE], + ['Navigation', base_config_1.TYPE_VALUE], + ['NavigationActivation', base_config_1.TYPE_VALUE], + ['NavigationCurrentEntryChangeEvent', base_config_1.TYPE_VALUE], + ['NavigationDestination', base_config_1.TYPE_VALUE], + ['NavigationHistoryEntryEventMap', base_config_1.TYPE], + ['NavigationHistoryEntry', base_config_1.TYPE_VALUE], + ['NavigationPrecommitController', base_config_1.TYPE_VALUE], + ['NavigationPreloadManager', base_config_1.TYPE_VALUE], + ['NavigationTransition', base_config_1.TYPE_VALUE], + ['Navigator', base_config_1.TYPE_VALUE], + ['NavigatorAutomationInformation', base_config_1.TYPE], + ['NavigatorBadge', base_config_1.TYPE], + ['NavigatorConcurrentHardware', base_config_1.TYPE], + ['NavigatorContentUtils', base_config_1.TYPE], + ['NavigatorCookies', base_config_1.TYPE], + ['NavigatorGPU', base_config_1.TYPE], + ['NavigatorID', base_config_1.TYPE], + ['NavigatorLanguage', base_config_1.TYPE], + ['NavigatorLocks', base_config_1.TYPE], + ['NavigatorLogin', base_config_1.TYPE_VALUE], + ['NavigatorOnLine', base_config_1.TYPE], + ['NavigatorPlugins', base_config_1.TYPE], + ['NavigatorStorage', base_config_1.TYPE], + ['Node', base_config_1.TYPE_VALUE], + ['NodeIterator', base_config_1.TYPE_VALUE], + ['NodeList', base_config_1.TYPE_VALUE], + ['NodeListOf', base_config_1.TYPE], + ['NonDocumentTypeChildNode', base_config_1.TYPE], + ['NonElementParentNode', base_config_1.TYPE], + ['NotificationEventMap', base_config_1.TYPE], + ['Notification', base_config_1.TYPE_VALUE], + ['OES_draw_buffers_indexed', base_config_1.TYPE], + ['OES_element_index_uint', base_config_1.TYPE], + ['OES_fbo_render_mipmap', base_config_1.TYPE], + ['OES_standard_derivatives', base_config_1.TYPE], + ['OES_texture_float', base_config_1.TYPE], + ['OES_texture_float_linear', base_config_1.TYPE], + ['OES_texture_half_float', base_config_1.TYPE], + ['OES_texture_half_float_linear', base_config_1.TYPE], + ['OES_vertex_array_object', base_config_1.TYPE], + ['OVR_multiview2', base_config_1.TYPE], + ['OfflineAudioCompletionEvent', base_config_1.TYPE_VALUE], + ['OfflineAudioContextEventMap', base_config_1.TYPE], + ['OfflineAudioContext', base_config_1.TYPE_VALUE], + ['OffscreenCanvasEventMap', base_config_1.TYPE], + ['OffscreenCanvas', base_config_1.TYPE_VALUE], + ['OffscreenCanvasRenderingContext2D', base_config_1.TYPE_VALUE], + ['OscillatorNode', base_config_1.TYPE_VALUE], + ['OverconstrainedError', base_config_1.TYPE_VALUE], + ['PageRevealEvent', base_config_1.TYPE_VALUE], + ['PageSwapEvent', base_config_1.TYPE_VALUE], + ['PageTransitionEvent', base_config_1.TYPE_VALUE], + ['PaintTimingMixin', base_config_1.TYPE], + ['PannerNode', base_config_1.TYPE_VALUE], + ['ParentNode', base_config_1.TYPE], + ['Path2D', base_config_1.TYPE_VALUE], + ['PaymentAddress', base_config_1.TYPE_VALUE], + ['PaymentMethodChangeEvent', base_config_1.TYPE_VALUE], + ['PaymentRequestEventMap', base_config_1.TYPE], + ['PaymentRequest', base_config_1.TYPE_VALUE], + ['PaymentRequestUpdateEvent', base_config_1.TYPE_VALUE], + ['PaymentResponseEventMap', base_config_1.TYPE], + ['PaymentResponse', base_config_1.TYPE_VALUE], + ['PerformanceEventMap', base_config_1.TYPE], + ['Performance', base_config_1.TYPE_VALUE], + ['PerformanceEntry', base_config_1.TYPE_VALUE], + ['PerformanceEventTiming', base_config_1.TYPE_VALUE], + ['PerformanceMark', base_config_1.TYPE_VALUE], + ['PerformanceMeasure', base_config_1.TYPE_VALUE], + ['PerformanceNavigation', base_config_1.TYPE_VALUE], + ['PerformanceNavigationTiming', base_config_1.TYPE_VALUE], + ['PerformanceObserver', base_config_1.TYPE_VALUE], + ['PerformanceObserverEntryList', base_config_1.TYPE_VALUE], + ['PerformancePaintTiming', base_config_1.TYPE_VALUE], + ['PerformanceResourceTiming', base_config_1.TYPE_VALUE], + ['PerformanceServerTiming', base_config_1.TYPE_VALUE], + ['PerformanceTiming', base_config_1.TYPE_VALUE], + ['PeriodicWave', base_config_1.TYPE_VALUE], + ['PermissionStatusEventMap', base_config_1.TYPE], + ['PermissionStatus', base_config_1.TYPE_VALUE], + ['Permissions', base_config_1.TYPE_VALUE], + ['PictureInPictureEvent', base_config_1.TYPE_VALUE], + ['PictureInPictureWindowEventMap', base_config_1.TYPE], + ['PictureInPictureWindow', base_config_1.TYPE_VALUE], + ['Plugin', base_config_1.TYPE_VALUE], + ['PluginArray', base_config_1.TYPE_VALUE], + ['PointerEvent', base_config_1.TYPE_VALUE], + ['PopStateEvent', base_config_1.TYPE_VALUE], + ['PopoverTargetAttributes', base_config_1.TYPE], + ['ProcessingInstruction', base_config_1.TYPE_VALUE], + ['ProgressEvent', base_config_1.TYPE_VALUE], + ['PromiseRejectionEvent', base_config_1.TYPE_VALUE], + ['PublicKeyCredential', base_config_1.TYPE_VALUE], + ['PushManager', base_config_1.TYPE_VALUE], + ['PushManagerAttribute', base_config_1.TYPE], + ['PushSubscription', base_config_1.TYPE_VALUE], + ['PushSubscriptionOptions', base_config_1.TYPE_VALUE], + ['RTCCertificate', base_config_1.TYPE_VALUE], + ['RTCDTMFSenderEventMap', base_config_1.TYPE], + ['RTCDTMFSender', base_config_1.TYPE_VALUE], + ['RTCDTMFToneChangeEvent', base_config_1.TYPE_VALUE], + ['RTCDataChannelEventMap', base_config_1.TYPE], + ['RTCDataChannel', base_config_1.TYPE_VALUE], + ['RTCDataChannelEvent', base_config_1.TYPE_VALUE], + ['RTCDtlsTransportEventMap', base_config_1.TYPE], + ['RTCDtlsTransport', base_config_1.TYPE_VALUE], + ['RTCEncodedAudioFrame', base_config_1.TYPE_VALUE], + ['RTCEncodedVideoFrame', base_config_1.TYPE_VALUE], + ['RTCError', base_config_1.TYPE_VALUE], + ['RTCErrorEvent', base_config_1.TYPE_VALUE], + ['RTCIceCandidate', base_config_1.TYPE_VALUE], + ['RTCIceCandidatePair', base_config_1.TYPE], + ['RTCIceTransportEventMap', base_config_1.TYPE], + ['RTCIceTransport', base_config_1.TYPE_VALUE], + ['RTCPeerConnectionEventMap', base_config_1.TYPE], + ['RTCPeerConnection', base_config_1.TYPE_VALUE], + ['RTCPeerConnectionIceErrorEvent', base_config_1.TYPE_VALUE], + ['RTCPeerConnectionIceEvent', base_config_1.TYPE_VALUE], + ['RTCRtpReceiver', base_config_1.TYPE_VALUE], + ['RTCRtpScriptTransform', base_config_1.TYPE_VALUE], + ['RTCRtpSender', base_config_1.TYPE_VALUE], + ['RTCRtpTransceiver', base_config_1.TYPE_VALUE], + ['RTCSctpTransportEventMap', base_config_1.TYPE], + ['RTCSctpTransport', base_config_1.TYPE_VALUE], + ['RTCSessionDescription', base_config_1.TYPE_VALUE], + ['RTCStatsReport', base_config_1.TYPE_VALUE], + ['RTCTrackEvent', base_config_1.TYPE_VALUE], + ['RadioNodeList', base_config_1.TYPE_VALUE], + ['Range', base_config_1.TYPE_VALUE], + ['ReadableByteStreamController', base_config_1.TYPE_VALUE], + ['ReadableStream', base_config_1.TYPE_VALUE], + ['ReadableStreamBYOBReader', base_config_1.TYPE_VALUE], + ['ReadableStreamBYOBRequest', base_config_1.TYPE_VALUE], + ['ReadableStreamDefaultController', base_config_1.TYPE_VALUE], + ['ReadableStreamDefaultReader', base_config_1.TYPE_VALUE], + ['ReadableStreamGenericReader', base_config_1.TYPE], + ['RemotePlaybackEventMap', base_config_1.TYPE], + ['RemotePlayback', base_config_1.TYPE_VALUE], + ['ReportingObserver', base_config_1.TYPE_VALUE], + ['Request', base_config_1.TYPE_VALUE], + ['ResizeObserver', base_config_1.TYPE_VALUE], + ['ResizeObserverEntry', base_config_1.TYPE_VALUE], + ['ResizeObserverSize', base_config_1.TYPE_VALUE], + ['Response', base_config_1.TYPE_VALUE], + ['SVGAElement', base_config_1.TYPE_VALUE], + ['SVGAngle', base_config_1.TYPE_VALUE], + ['SVGAnimateElement', base_config_1.TYPE_VALUE], + ['SVGAnimateMotionElement', base_config_1.TYPE_VALUE], + ['SVGAnimateTransformElement', base_config_1.TYPE_VALUE], + ['SVGAnimatedAngle', base_config_1.TYPE_VALUE], + ['SVGAnimatedBoolean', base_config_1.TYPE_VALUE], + ['SVGAnimatedEnumeration', base_config_1.TYPE_VALUE], + ['SVGAnimatedInteger', base_config_1.TYPE_VALUE], + ['SVGAnimatedLength', base_config_1.TYPE_VALUE], + ['SVGAnimatedLengthList', base_config_1.TYPE_VALUE], + ['SVGAnimatedNumber', base_config_1.TYPE_VALUE], + ['SVGAnimatedNumberList', base_config_1.TYPE_VALUE], + ['SVGAnimatedPoints', base_config_1.TYPE], + ['SVGAnimatedPreserveAspectRatio', base_config_1.TYPE_VALUE], + ['SVGAnimatedRect', base_config_1.TYPE_VALUE], + ['SVGAnimatedString', base_config_1.TYPE_VALUE], + ['SVGAnimatedTransformList', base_config_1.TYPE_VALUE], + ['SVGAnimationElement', base_config_1.TYPE_VALUE], + ['SVGCircleElement', base_config_1.TYPE_VALUE], + ['SVGClipPathElement', base_config_1.TYPE_VALUE], + ['SVGComponentTransferFunctionElement', base_config_1.TYPE_VALUE], + ['SVGDefsElement', base_config_1.TYPE_VALUE], + ['SVGDescElement', base_config_1.TYPE_VALUE], + ['SVGElementEventMap', base_config_1.TYPE], + ['SVGElement', base_config_1.TYPE_VALUE], + ['SVGEllipseElement', base_config_1.TYPE_VALUE], + ['SVGFEBlendElement', base_config_1.TYPE_VALUE], + ['SVGFEColorMatrixElement', base_config_1.TYPE_VALUE], + ['SVGFEComponentTransferElement', base_config_1.TYPE_VALUE], + ['SVGFECompositeElement', base_config_1.TYPE_VALUE], + ['SVGFEConvolveMatrixElement', base_config_1.TYPE_VALUE], + ['SVGFEDiffuseLightingElement', base_config_1.TYPE_VALUE], + ['SVGFEDisplacementMapElement', base_config_1.TYPE_VALUE], + ['SVGFEDistantLightElement', base_config_1.TYPE_VALUE], + ['SVGFEDropShadowElement', base_config_1.TYPE_VALUE], + ['SVGFEFloodElement', base_config_1.TYPE_VALUE], + ['SVGFEFuncAElement', base_config_1.TYPE_VALUE], + ['SVGFEFuncBElement', base_config_1.TYPE_VALUE], + ['SVGFEFuncGElement', base_config_1.TYPE_VALUE], + ['SVGFEFuncRElement', base_config_1.TYPE_VALUE], + ['SVGFEGaussianBlurElement', base_config_1.TYPE_VALUE], + ['SVGFEImageElement', base_config_1.TYPE_VALUE], + ['SVGFEMergeElement', base_config_1.TYPE_VALUE], + ['SVGFEMergeNodeElement', base_config_1.TYPE_VALUE], + ['SVGFEMorphologyElement', base_config_1.TYPE_VALUE], + ['SVGFEOffsetElement', base_config_1.TYPE_VALUE], + ['SVGFEPointLightElement', base_config_1.TYPE_VALUE], + ['SVGFESpecularLightingElement', base_config_1.TYPE_VALUE], + ['SVGFESpotLightElement', base_config_1.TYPE_VALUE], + ['SVGFETileElement', base_config_1.TYPE_VALUE], + ['SVGFETurbulenceElement', base_config_1.TYPE_VALUE], + ['SVGFilterElement', base_config_1.TYPE_VALUE], + ['SVGFilterPrimitiveStandardAttributes', base_config_1.TYPE], + ['SVGFitToViewBox', base_config_1.TYPE], + ['SVGForeignObjectElement', base_config_1.TYPE_VALUE], + ['SVGGElement', base_config_1.TYPE_VALUE], + ['SVGGeometryElement', base_config_1.TYPE_VALUE], + ['SVGGradientElement', base_config_1.TYPE_VALUE], + ['SVGGraphicsElement', base_config_1.TYPE_VALUE], + ['SVGImageElement', base_config_1.TYPE_VALUE], + ['SVGLength', base_config_1.TYPE_VALUE], + ['SVGLengthList', base_config_1.TYPE_VALUE], + ['SVGLineElement', base_config_1.TYPE_VALUE], + ['SVGLinearGradientElement', base_config_1.TYPE_VALUE], + ['SVGMPathElement', base_config_1.TYPE_VALUE], + ['SVGMarkerElement', base_config_1.TYPE_VALUE], + ['SVGMaskElement', base_config_1.TYPE_VALUE], + ['SVGMetadataElement', base_config_1.TYPE_VALUE], + ['SVGNumber', base_config_1.TYPE_VALUE], + ['SVGNumberList', base_config_1.TYPE_VALUE], + ['SVGPathElement', base_config_1.TYPE_VALUE], + ['SVGPatternElement', base_config_1.TYPE_VALUE], + ['SVGPointList', base_config_1.TYPE_VALUE], + ['SVGPolygonElement', base_config_1.TYPE_VALUE], + ['SVGPolylineElement', base_config_1.TYPE_VALUE], + ['SVGPreserveAspectRatio', base_config_1.TYPE_VALUE], + ['SVGRadialGradientElement', base_config_1.TYPE_VALUE], + ['SVGRectElement', base_config_1.TYPE_VALUE], + ['SVGSVGElementEventMap', base_config_1.TYPE], + ['SVGSVGElement', base_config_1.TYPE_VALUE], + ['SVGScriptElement', base_config_1.TYPE_VALUE], + ['SVGSetElement', base_config_1.TYPE_VALUE], + ['SVGStopElement', base_config_1.TYPE_VALUE], + ['SVGStringList', base_config_1.TYPE_VALUE], + ['SVGStyleElement', base_config_1.TYPE_VALUE], + ['SVGSwitchElement', base_config_1.TYPE_VALUE], + ['SVGSymbolElement', base_config_1.TYPE_VALUE], + ['SVGTSpanElement', base_config_1.TYPE_VALUE], + ['SVGTests', base_config_1.TYPE], + ['SVGTextContentElement', base_config_1.TYPE_VALUE], + ['SVGTextElement', base_config_1.TYPE_VALUE], + ['SVGTextPathElement', base_config_1.TYPE_VALUE], + ['SVGTextPositioningElement', base_config_1.TYPE_VALUE], + ['SVGTitleElement', base_config_1.TYPE_VALUE], + ['SVGTransform', base_config_1.TYPE_VALUE], + ['SVGTransformList', base_config_1.TYPE_VALUE], + ['SVGURIReference', base_config_1.TYPE], + ['SVGUnitTypes', base_config_1.TYPE_VALUE], + ['SVGUseElement', base_config_1.TYPE_VALUE], + ['SVGViewElement', base_config_1.TYPE_VALUE], + ['Sanitizer', base_config_1.TYPE_VALUE], + ['Scheduler', base_config_1.TYPE_VALUE], + ['Screen', base_config_1.TYPE_VALUE], + ['ScreenOrientationEventMap', base_config_1.TYPE], + ['ScreenOrientation', base_config_1.TYPE_VALUE], + ['ScriptProcessorNodeEventMap', base_config_1.TYPE], + ['ScriptProcessorNode', base_config_1.TYPE_VALUE], + ['ScrollTimeline', base_config_1.TYPE_VALUE], + ['SecurityPolicyViolationEvent', base_config_1.TYPE_VALUE], + ['Selection', base_config_1.TYPE_VALUE], + ['ServiceWorkerEventMap', base_config_1.TYPE], + ['ServiceWorker', base_config_1.TYPE_VALUE], + ['ServiceWorkerContainerEventMap', base_config_1.TYPE], + ['ServiceWorkerContainer', base_config_1.TYPE_VALUE], + ['ServiceWorkerRegistrationEventMap', base_config_1.TYPE], + ['ServiceWorkerRegistration', base_config_1.TYPE_VALUE], + ['ShadowRootEventMap', base_config_1.TYPE], + ['ShadowRoot', base_config_1.TYPE_VALUE], + ['SharedWorker', base_config_1.TYPE_VALUE], + ['Slottable', base_config_1.TYPE], + ['SourceBufferEventMap', base_config_1.TYPE], + ['SourceBuffer', base_config_1.TYPE_VALUE], + ['SourceBufferListEventMap', base_config_1.TYPE], + ['SourceBufferList', base_config_1.TYPE_VALUE], + ['SpeechRecognitionAlternative', base_config_1.TYPE_VALUE], + ['SpeechRecognitionErrorEvent', base_config_1.TYPE_VALUE], + ['SpeechRecognitionEvent', base_config_1.TYPE_VALUE], + ['SpeechRecognitionResult', base_config_1.TYPE_VALUE], + ['SpeechRecognitionResultList', base_config_1.TYPE_VALUE], + ['SpeechSynthesisEventMap', base_config_1.TYPE], + ['SpeechSynthesis', base_config_1.TYPE_VALUE], + ['SpeechSynthesisErrorEvent', base_config_1.TYPE_VALUE], + ['SpeechSynthesisEvent', base_config_1.TYPE_VALUE], + ['SpeechSynthesisUtteranceEventMap', base_config_1.TYPE], + ['SpeechSynthesisUtterance', base_config_1.TYPE_VALUE], + ['SpeechSynthesisVoice', base_config_1.TYPE_VALUE], + ['StaticRange', base_config_1.TYPE_VALUE], + ['StereoPannerNode', base_config_1.TYPE_VALUE], + ['Storage', base_config_1.TYPE_VALUE], + ['StorageEvent', base_config_1.TYPE_VALUE], + ['StorageManager', base_config_1.TYPE_VALUE], + ['StylePropertyMap', base_config_1.TYPE_VALUE], + ['StylePropertyMapReadOnly', base_config_1.TYPE_VALUE], + ['StyleSheet', base_config_1.TYPE_VALUE], + ['StyleSheetList', base_config_1.TYPE_VALUE], + ['SubmitEvent', base_config_1.TYPE_VALUE], + ['SubtleCrypto', base_config_1.TYPE_VALUE], + ['TaskController', base_config_1.TYPE_VALUE], + ['TaskPriorityChangeEvent', base_config_1.TYPE_VALUE], + ['TaskSignalEventMap', base_config_1.TYPE], + ['TaskSignal', base_config_1.TYPE_VALUE], + ['Text', base_config_1.TYPE_VALUE], + ['TextDecoder', base_config_1.TYPE_VALUE], + ['TextDecoderCommon', base_config_1.TYPE], + ['TextDecoderStream', base_config_1.TYPE_VALUE], + ['TextEncoder', base_config_1.TYPE_VALUE], + ['TextEncoderCommon', base_config_1.TYPE], + ['TextEncoderStream', base_config_1.TYPE_VALUE], + ['TextEvent', base_config_1.TYPE_VALUE], + ['TextMetrics', base_config_1.TYPE_VALUE], + ['TextTrackEventMap', base_config_1.TYPE], + ['TextTrack', base_config_1.TYPE_VALUE], + ['TextTrackCueEventMap', base_config_1.TYPE], + ['TextTrackCue', base_config_1.TYPE_VALUE], + ['TextTrackCueList', base_config_1.TYPE_VALUE], + ['TextTrackListEventMap', base_config_1.TYPE], + ['TextTrackList', base_config_1.TYPE_VALUE], + ['TimeRanges', base_config_1.TYPE_VALUE], + ['ToggleEvent', base_config_1.TYPE_VALUE], + ['Touch', base_config_1.TYPE_VALUE], + ['TouchEvent', base_config_1.TYPE_VALUE], + ['TouchList', base_config_1.TYPE_VALUE], + ['TrackEvent', base_config_1.TYPE_VALUE], + ['TransformStream', base_config_1.TYPE_VALUE], + ['TransformStreamDefaultController', base_config_1.TYPE_VALUE], + ['TransitionEvent', base_config_1.TYPE_VALUE], + ['TreeWalker', base_config_1.TYPE_VALUE], + ['UIEvent', base_config_1.TYPE_VALUE], + ['URL', base_config_1.TYPE_VALUE], + ['webkitURL', base_config_1.TYPE_VALUE], + ['URLPattern', base_config_1.TYPE_VALUE], + ['URLSearchParams', base_config_1.TYPE_VALUE], + ['UserActivation', base_config_1.TYPE_VALUE], + ['VTTCue', base_config_1.TYPE_VALUE], + ['VTTRegion', base_config_1.TYPE_VALUE], + ['ValidityState', base_config_1.TYPE_VALUE], + ['VideoColorSpace', base_config_1.TYPE_VALUE], + ['VideoDecoderEventMap', base_config_1.TYPE], + ['VideoDecoder', base_config_1.TYPE_VALUE], + ['VideoEncoderEventMap', base_config_1.TYPE], + ['VideoEncoder', base_config_1.TYPE_VALUE], + ['VideoFrame', base_config_1.TYPE_VALUE], + ['VideoPlaybackQuality', base_config_1.TYPE_VALUE], + ['ViewTimeline', base_config_1.TYPE_VALUE], + ['ViewTransition', base_config_1.TYPE_VALUE], + ['ViewTransitionTypeSet', base_config_1.TYPE_VALUE], + ['VisualViewportEventMap', base_config_1.TYPE], + ['VisualViewport', base_config_1.TYPE_VALUE], + ['WEBGL_color_buffer_float', base_config_1.TYPE], + ['WEBGL_compressed_texture_astc', base_config_1.TYPE], + ['WEBGL_compressed_texture_etc', base_config_1.TYPE], + ['WEBGL_compressed_texture_etc1', base_config_1.TYPE], + ['WEBGL_compressed_texture_pvrtc', base_config_1.TYPE], + ['WEBGL_compressed_texture_s3tc', base_config_1.TYPE], + ['WEBGL_compressed_texture_s3tc_srgb', base_config_1.TYPE], + ['WEBGL_debug_renderer_info', base_config_1.TYPE], + ['WEBGL_debug_shaders', base_config_1.TYPE], + ['WEBGL_depth_texture', base_config_1.TYPE], + ['WEBGL_draw_buffers', base_config_1.TYPE], + ['WEBGL_lose_context', base_config_1.TYPE], + ['WEBGL_multi_draw', base_config_1.TYPE], + ['WGSLLanguageFeatures', base_config_1.TYPE_VALUE], + ['WakeLock', base_config_1.TYPE_VALUE], + ['WakeLockSentinelEventMap', base_config_1.TYPE], + ['WakeLockSentinel', base_config_1.TYPE_VALUE], + ['WaveShaperNode', base_config_1.TYPE_VALUE], + ['WebGL2RenderingContext', base_config_1.TYPE_VALUE], + ['WebGL2RenderingContextBase', base_config_1.TYPE], + ['WebGL2RenderingContextOverloads', base_config_1.TYPE], + ['WebGLActiveInfo', base_config_1.TYPE_VALUE], + ['WebGLBuffer', base_config_1.TYPE_VALUE], + ['WebGLContextEvent', base_config_1.TYPE_VALUE], + ['WebGLFramebuffer', base_config_1.TYPE_VALUE], + ['WebGLProgram', base_config_1.TYPE_VALUE], + ['WebGLQuery', base_config_1.TYPE_VALUE], + ['WebGLRenderbuffer', base_config_1.TYPE_VALUE], + ['WebGLRenderingContext', base_config_1.TYPE_VALUE], + ['WebGLRenderingContextBase', base_config_1.TYPE], + ['WebGLRenderingContextOverloads', base_config_1.TYPE], + ['WebGLSampler', base_config_1.TYPE_VALUE], + ['WebGLShader', base_config_1.TYPE_VALUE], + ['WebGLShaderPrecisionFormat', base_config_1.TYPE_VALUE], + ['WebGLSync', base_config_1.TYPE_VALUE], + ['WebGLTexture', base_config_1.TYPE_VALUE], + ['WebGLTransformFeedback', base_config_1.TYPE_VALUE], + ['WebGLUniformLocation', base_config_1.TYPE_VALUE], + ['WebGLVertexArrayObject', base_config_1.TYPE_VALUE], + ['WebGLVertexArrayObjectOES', base_config_1.TYPE], + ['WebSocketEventMap', base_config_1.TYPE], + ['WebSocket', base_config_1.TYPE_VALUE], + ['WebTransport', base_config_1.TYPE_VALUE], + ['WebTransportBidirectionalStream', base_config_1.TYPE_VALUE], + ['WebTransportDatagramDuplexStream', base_config_1.TYPE_VALUE], + ['WebTransportError', base_config_1.TYPE_VALUE], + ['WheelEvent', base_config_1.TYPE_VALUE], + ['WindowEventMap', base_config_1.TYPE], + ['Window', base_config_1.TYPE_VALUE], + ['WindowEventHandlersEventMap', base_config_1.TYPE], + ['WindowEventHandlers', base_config_1.TYPE], + ['WindowLocalStorage', base_config_1.TYPE], + ['WindowOrWorkerGlobalScope', base_config_1.TYPE], + ['WindowSessionStorage', base_config_1.TYPE], + ['WorkerEventMap', base_config_1.TYPE], + ['Worker', base_config_1.TYPE_VALUE], + ['Worklet', base_config_1.TYPE_VALUE], + ['WritableStream', base_config_1.TYPE_VALUE], + ['WritableStreamDefaultController', base_config_1.TYPE_VALUE], + ['WritableStreamDefaultWriter', base_config_1.TYPE_VALUE], + ['XMLDocument', base_config_1.TYPE_VALUE], + ['XMLHttpRequestEventMap', base_config_1.TYPE], + ['XMLHttpRequest', base_config_1.TYPE_VALUE], + ['XMLHttpRequestEventTargetEventMap', base_config_1.TYPE], + ['XMLHttpRequestEventTarget', base_config_1.TYPE_VALUE], + ['XMLHttpRequestUpload', base_config_1.TYPE_VALUE], + ['XMLSerializer', base_config_1.TYPE_VALUE], + ['XPathEvaluator', base_config_1.TYPE_VALUE], + ['XPathEvaluatorBase', base_config_1.TYPE], + ['XPathExpression', base_config_1.TYPE_VALUE], + ['XPathResult', base_config_1.TYPE_VALUE], + ['XSLTProcessor', base_config_1.TYPE_VALUE], + ['CSS', base_config_1.TYPE_VALUE], + ['WebAssembly', base_config_1.TYPE_VALUE], + ['Console', base_config_1.TYPE], + ['AudioDataOutputCallback', base_config_1.TYPE], + ['BlobCallback', base_config_1.TYPE], + ['CustomElementConstructor', base_config_1.TYPE], + ['DecodeErrorCallback', base_config_1.TYPE], + ['DecodeSuccessCallback', base_config_1.TYPE], + ['EncodedAudioChunkOutputCallback', base_config_1.TYPE], + ['EncodedVideoChunkOutputCallback', base_config_1.TYPE], + ['ErrorCallback', base_config_1.TYPE], + ['FileCallback', base_config_1.TYPE], + ['FileSystemEntriesCallback', base_config_1.TYPE], + ['FileSystemEntryCallback', base_config_1.TYPE], + ['FrameRequestCallback', base_config_1.TYPE], + ['FunctionStringCallback', base_config_1.TYPE], + ['IdleRequestCallback', base_config_1.TYPE], + ['IntersectionObserverCallback', base_config_1.TYPE], + ['LockGrantedCallback', base_config_1.TYPE], + ['MediaSessionActionHandler', base_config_1.TYPE], + ['MutationCallback', base_config_1.TYPE], + ['NavigationInterceptHandler', base_config_1.TYPE], + ['NavigationPrecommitHandler', base_config_1.TYPE], + ['NotificationPermissionCallback', base_config_1.TYPE], + ['OnBeforeUnloadEventHandlerNonNull', base_config_1.TYPE], + ['OnErrorEventHandlerNonNull', base_config_1.TYPE], + ['PerformanceObserverCallback', base_config_1.TYPE], + ['PositionCallback', base_config_1.TYPE], + ['PositionErrorCallback', base_config_1.TYPE], + ['QueuingStrategySize', base_config_1.TYPE], + ['RTCPeerConnectionErrorCallback', base_config_1.TYPE], + ['RTCSessionDescriptionCallback', base_config_1.TYPE], + ['RemotePlaybackAvailabilityCallback', base_config_1.TYPE], + ['ReportingObserverCallback', base_config_1.TYPE], + ['ResizeObserverCallback', base_config_1.TYPE], + ['SchedulerPostTaskCallback', base_config_1.TYPE], + ['TransformerFlushCallback', base_config_1.TYPE], + ['TransformerStartCallback', base_config_1.TYPE], + ['TransformerTransformCallback', base_config_1.TYPE], + ['UnderlyingSinkAbortCallback', base_config_1.TYPE], + ['UnderlyingSinkCloseCallback', base_config_1.TYPE], + ['UnderlyingSinkStartCallback', base_config_1.TYPE], + ['UnderlyingSinkWriteCallback', base_config_1.TYPE], + ['UnderlyingSourceCancelCallback', base_config_1.TYPE], + ['UnderlyingSourcePullCallback', base_config_1.TYPE], + ['UnderlyingSourceStartCallback', base_config_1.TYPE], + ['VideoFrameOutputCallback', base_config_1.TYPE], + ['VideoFrameRequestCallback', base_config_1.TYPE], + ['ViewTransitionUpdateCallback', base_config_1.TYPE], + ['VoidFunction', base_config_1.TYPE], + ['WebCodecsErrorCallback', base_config_1.TYPE], + ['HTMLElementTagNameMap', base_config_1.TYPE], + ['HTMLElementDeprecatedTagNameMap', base_config_1.TYPE], + ['SVGElementTagNameMap', base_config_1.TYPE], + ['MathMLElementTagNameMap', base_config_1.TYPE], + ['ElementTagNameMap', base_config_1.TYPE], + ['AlgorithmIdentifier', base_config_1.TYPE], + ['AllowSharedBufferSource', base_config_1.TYPE], + ['AutoFill', base_config_1.TYPE], + ['AutoFillField', base_config_1.TYPE], + ['AutoFillSection', base_config_1.TYPE], + ['Base64URLString', base_config_1.TYPE], + ['BigInteger', base_config_1.TYPE], + ['BlobPart', base_config_1.TYPE], + ['BodyInit', base_config_1.TYPE], + ['BufferSource', base_config_1.TYPE], + ['COSEAlgorithmIdentifier', base_config_1.TYPE], + ['CSSKeywordish', base_config_1.TYPE], + ['CSSNumberish', base_config_1.TYPE], + ['CSSPerspectiveValue', base_config_1.TYPE], + ['CSSUnparsedSegment', base_config_1.TYPE], + ['CanvasImageSource', base_config_1.TYPE], + ['ClipboardItemData', base_config_1.TYPE], + ['ClipboardItems', base_config_1.TYPE], + ['ConstrainBoolean', base_config_1.TYPE], + ['ConstrainBooleanOrDOMString', base_config_1.TYPE], + ['ConstrainDOMString', base_config_1.TYPE], + ['ConstrainDouble', base_config_1.TYPE], + ['ConstrainULong', base_config_1.TYPE], + ['CookieList', base_config_1.TYPE], + ['DOMHighResTimeStamp', base_config_1.TYPE], + ['EpochTimeStamp', base_config_1.TYPE], + ['EventListenerOrEventListenerObject', base_config_1.TYPE], + ['FileSystemWriteChunkType', base_config_1.TYPE], + ['Float32List', base_config_1.TYPE], + ['FormDataEntryValue', base_config_1.TYPE], + ['GLbitfield', base_config_1.TYPE], + ['GLboolean', base_config_1.TYPE], + ['GLclampf', base_config_1.TYPE], + ['GLenum', base_config_1.TYPE], + ['GLfloat', base_config_1.TYPE], + ['GLint', base_config_1.TYPE], + ['GLint64', base_config_1.TYPE], + ['GLintptr', base_config_1.TYPE], + ['GLsizei', base_config_1.TYPE], + ['GLsizeiptr', base_config_1.TYPE], + ['GLuint', base_config_1.TYPE], + ['GLuint64', base_config_1.TYPE], + ['GPUBindingResource', base_config_1.TYPE], + ['GPUBufferDynamicOffset', base_config_1.TYPE], + ['GPUBufferUsageFlags', base_config_1.TYPE], + ['GPUColor', base_config_1.TYPE], + ['GPUColorWriteFlags', base_config_1.TYPE], + ['GPUCopyExternalImageSource', base_config_1.TYPE], + ['GPUDepthBias', base_config_1.TYPE], + ['GPUExtent3D', base_config_1.TYPE], + ['GPUFlagsConstant', base_config_1.TYPE], + ['GPUIndex32', base_config_1.TYPE], + ['GPUIntegerCoordinate', base_config_1.TYPE], + ['GPUIntegerCoordinateOut', base_config_1.TYPE], + ['GPUMapModeFlags', base_config_1.TYPE], + ['GPUOrigin2D', base_config_1.TYPE], + ['GPUOrigin3D', base_config_1.TYPE], + ['GPUPipelineConstantValue', base_config_1.TYPE], + ['GPUSampleMask', base_config_1.TYPE], + ['GPUShaderStageFlags', base_config_1.TYPE], + ['GPUSignedOffset32', base_config_1.TYPE], + ['GPUSize32', base_config_1.TYPE], + ['GPUSize32Out', base_config_1.TYPE], + ['GPUSize64', base_config_1.TYPE], + ['GPUSize64Out', base_config_1.TYPE], + ['GPUStencilValue', base_config_1.TYPE], + ['GPUTextureUsageFlags', base_config_1.TYPE], + ['HTMLOrSVGImageElement', base_config_1.TYPE], + ['HTMLOrSVGScriptElement', base_config_1.TYPE], + ['HashAlgorithmIdentifier', base_config_1.TYPE], + ['HeadersInit', base_config_1.TYPE], + ['IDBValidKey', base_config_1.TYPE], + ['ImageBitmapSource', base_config_1.TYPE], + ['ImageBufferSource', base_config_1.TYPE], + ['ImageDataArray', base_config_1.TYPE], + ['Int32List', base_config_1.TYPE], + ['LineAndPositionSetting', base_config_1.TYPE], + ['MediaProvider', base_config_1.TYPE], + ['MessageEventSource', base_config_1.TYPE], + ['MutationRecordType', base_config_1.TYPE], + ['NamedCurve', base_config_1.TYPE], + ['OffscreenRenderingContext', base_config_1.TYPE], + ['OnBeforeUnloadEventHandler', base_config_1.TYPE], + ['OnErrorEventHandler', base_config_1.TYPE], + ['OptionalPostfixToken', base_config_1.TYPE], + ['OptionalPrefixToken', base_config_1.TYPE], + ['PerformanceEntryList', base_config_1.TYPE], + ['PublicKeyCredentialClientCapabilities', base_config_1.TYPE], + ['RTCRtpReceiverTransform', base_config_1.TYPE], + ['RTCRtpSenderTransform', base_config_1.TYPE], + ['ReadableStreamController', base_config_1.TYPE], + ['ReadableStreamReadResult', base_config_1.TYPE], + ['ReadableStreamReader', base_config_1.TYPE], + ['RenderingContext', base_config_1.TYPE], + ['ReportList', base_config_1.TYPE], + ['RequestInfo', base_config_1.TYPE], + ['SanitizerAttribute', base_config_1.TYPE], + ['SanitizerElement', base_config_1.TYPE], + ['SanitizerElementWithAttributes', base_config_1.TYPE], + ['SelectionDirection', base_config_1.TYPE], + ['TexImageSource', base_config_1.TYPE], + ['TimerHandler', base_config_1.TYPE], + ['Transferable', base_config_1.TYPE], + ['URLPatternInput', base_config_1.TYPE], + ['Uint32List', base_config_1.TYPE], + ['VibratePattern', base_config_1.TYPE], + ['WindowProxy', base_config_1.TYPE], + ['XMLHttpRequestBodyInit', base_config_1.TYPE], + ['AacBitstreamFormat', base_config_1.TYPE], + ['AlignSetting', base_config_1.TYPE], + ['AlphaOption', base_config_1.TYPE], + ['AnimationPlayState', base_config_1.TYPE], + ['AnimationReplaceState', base_config_1.TYPE], + ['AppendMode', base_config_1.TYPE], + ['AttestationConveyancePreference', base_config_1.TYPE], + ['AudioContextLatencyCategory', base_config_1.TYPE], + ['AudioContextState', base_config_1.TYPE], + ['AudioSampleFormat', base_config_1.TYPE], + ['AuthenticatorAttachment', base_config_1.TYPE], + ['AuthenticatorTransport', base_config_1.TYPE], + ['AutoFillAddressKind', base_config_1.TYPE], + ['AutoFillBase', base_config_1.TYPE], + ['AutoFillContactField', base_config_1.TYPE], + ['AutoFillContactKind', base_config_1.TYPE], + ['AutoFillCredentialField', base_config_1.TYPE], + ['AutoFillNormalField', base_config_1.TYPE], + ['AutoKeyword', base_config_1.TYPE], + ['AutomationRate', base_config_1.TYPE], + ['AvcBitstreamFormat', base_config_1.TYPE], + ['BinaryType', base_config_1.TYPE], + ['BiquadFilterType', base_config_1.TYPE], + ['BitrateMode', base_config_1.TYPE], + ['CSSMathOperator', base_config_1.TYPE], + ['CSSNumericBaseType', base_config_1.TYPE], + ['CanPlayTypeResult', base_config_1.TYPE], + ['CanvasDirection', base_config_1.TYPE], + ['CanvasFillRule', base_config_1.TYPE], + ['CanvasFontKerning', base_config_1.TYPE], + ['CanvasFontStretch', base_config_1.TYPE], + ['CanvasFontVariantCaps', base_config_1.TYPE], + ['CanvasLineCap', base_config_1.TYPE], + ['CanvasLineJoin', base_config_1.TYPE], + ['CanvasTextAlign', base_config_1.TYPE], + ['CanvasTextBaseline', base_config_1.TYPE], + ['CanvasTextRendering', base_config_1.TYPE], + ['ChannelCountMode', base_config_1.TYPE], + ['ChannelInterpretation', base_config_1.TYPE], + ['ClientTypes', base_config_1.TYPE], + ['CodecState', base_config_1.TYPE], + ['ColorGamut', base_config_1.TYPE], + ['ColorSpaceConversion', base_config_1.TYPE], + ['CompositeOperation', base_config_1.TYPE], + ['CompositeOperationOrAuto', base_config_1.TYPE], + ['CompressionFormat', base_config_1.TYPE], + ['CookieSameSite', base_config_1.TYPE], + ['CredentialMediationRequirement', base_config_1.TYPE], + ['DOMParserSupportedType', base_config_1.TYPE], + ['DirectionSetting', base_config_1.TYPE], + ['DisplayCaptureSurfaceType', base_config_1.TYPE], + ['DistanceModelType', base_config_1.TYPE], + ['DocumentReadyState', base_config_1.TYPE], + ['DocumentVisibilityState', base_config_1.TYPE], + ['EncodedAudioChunkType', base_config_1.TYPE], + ['EncodedVideoChunkType', base_config_1.TYPE], + ['EndOfStreamError', base_config_1.TYPE], + ['EndingType', base_config_1.TYPE], + ['FileSystemHandleKind', base_config_1.TYPE], + ['FillLightMode', base_config_1.TYPE], + ['FillMode', base_config_1.TYPE], + ['FontDisplay', base_config_1.TYPE], + ['FontFaceLoadStatus', base_config_1.TYPE], + ['FontFaceSetLoadStatus', base_config_1.TYPE], + ['FullscreenNavigationUI', base_config_1.TYPE], + ['GPUAddressMode', base_config_1.TYPE], + ['GPUAutoLayoutMode', base_config_1.TYPE], + ['GPUBlendFactor', base_config_1.TYPE], + ['GPUBlendOperation', base_config_1.TYPE], + ['GPUBufferBindingType', base_config_1.TYPE], + ['GPUBufferMapState', base_config_1.TYPE], + ['GPUCanvasAlphaMode', base_config_1.TYPE], + ['GPUCanvasToneMappingMode', base_config_1.TYPE], + ['GPUCompareFunction', base_config_1.TYPE], + ['GPUCompilationMessageType', base_config_1.TYPE], + ['GPUCullMode', base_config_1.TYPE], + ['GPUDeviceLostReason', base_config_1.TYPE], + ['GPUErrorFilter', base_config_1.TYPE], + ['GPUFeatureName', base_config_1.TYPE], + ['GPUFilterMode', base_config_1.TYPE], + ['GPUFrontFace', base_config_1.TYPE], + ['GPUIndexFormat', base_config_1.TYPE], + ['GPULoadOp', base_config_1.TYPE], + ['GPUMipmapFilterMode', base_config_1.TYPE], + ['GPUPipelineErrorReason', base_config_1.TYPE], + ['GPUPowerPreference', base_config_1.TYPE], + ['GPUPrimitiveTopology', base_config_1.TYPE], + ['GPUQueryType', base_config_1.TYPE], + ['GPUSamplerBindingType', base_config_1.TYPE], + ['GPUStencilOperation', base_config_1.TYPE], + ['GPUStorageTextureAccess', base_config_1.TYPE], + ['GPUStoreOp', base_config_1.TYPE], + ['GPUTextureAspect', base_config_1.TYPE], + ['GPUTextureDimension', base_config_1.TYPE], + ['GPUTextureFormat', base_config_1.TYPE], + ['GPUTextureSampleType', base_config_1.TYPE], + ['GPUTextureViewDimension', base_config_1.TYPE], + ['GPUVertexFormat', base_config_1.TYPE], + ['GPUVertexStepMode', base_config_1.TYPE], + ['GamepadHapticEffectType', base_config_1.TYPE], + ['GamepadHapticsResult', base_config_1.TYPE], + ['GamepadMappingType', base_config_1.TYPE], + ['GlobalCompositeOperation', base_config_1.TYPE], + ['HardwareAcceleration', base_config_1.TYPE], + ['HdrMetadataType', base_config_1.TYPE], + ['HighlightType', base_config_1.TYPE], + ['IDBCursorDirection', base_config_1.TYPE], + ['IDBRequestReadyState', base_config_1.TYPE], + ['IDBTransactionDurability', base_config_1.TYPE], + ['IDBTransactionMode', base_config_1.TYPE], + ['ImageDataPixelFormat', base_config_1.TYPE], + ['ImageOrientation', base_config_1.TYPE], + ['ImageSmoothingQuality', base_config_1.TYPE], + ['InsertPosition', base_config_1.TYPE], + ['IterationCompositeOperation', base_config_1.TYPE], + ['KeyFormat', base_config_1.TYPE], + ['KeyType', base_config_1.TYPE], + ['KeyUsage', base_config_1.TYPE], + ['LatencyMode', base_config_1.TYPE], + ['LineAlignSetting', base_config_1.TYPE], + ['LockMode', base_config_1.TYPE], + ['LoginStatus', base_config_1.TYPE], + ['MIDIPortConnectionState', base_config_1.TYPE], + ['MIDIPortDeviceState', base_config_1.TYPE], + ['MIDIPortType', base_config_1.TYPE], + ['MediaDecodingType', base_config_1.TYPE], + ['MediaDeviceKind', base_config_1.TYPE], + ['MediaEncodingType', base_config_1.TYPE], + ['MediaKeyMessageType', base_config_1.TYPE], + ['MediaKeySessionClosedReason', base_config_1.TYPE], + ['MediaKeySessionType', base_config_1.TYPE], + ['MediaKeyStatus', base_config_1.TYPE], + ['MediaKeysRequirement', base_config_1.TYPE], + ['MediaSessionAction', base_config_1.TYPE], + ['MediaSessionPlaybackState', base_config_1.TYPE], + ['MediaStreamTrackState', base_config_1.TYPE], + ['NavigationFocusReset', base_config_1.TYPE], + ['NavigationHistoryBehavior', base_config_1.TYPE], + ['NavigationScrollBehavior', base_config_1.TYPE], + ['NavigationTimingType', base_config_1.TYPE], + ['NavigationType', base_config_1.TYPE], + ['NotificationDirection', base_config_1.TYPE], + ['NotificationPermission', base_config_1.TYPE], + ['OffscreenRenderingContextId', base_config_1.TYPE], + ['OpusBitstreamFormat', base_config_1.TYPE], + ['OrientationLockType', base_config_1.TYPE], + ['OrientationType', base_config_1.TYPE], + ['OscillatorType', base_config_1.TYPE], + ['OverSampleType', base_config_1.TYPE], + ['PanningModelType', base_config_1.TYPE], + ['PaymentComplete', base_config_1.TYPE], + ['PaymentShippingType', base_config_1.TYPE], + ['PermissionName', base_config_1.TYPE], + ['PermissionState', base_config_1.TYPE], + ['PlaybackDirection', base_config_1.TYPE], + ['PositionAlignSetting', base_config_1.TYPE], + ['PredefinedColorSpace', base_config_1.TYPE], + ['PremultiplyAlpha', base_config_1.TYPE], + ['PresentationStyle', base_config_1.TYPE], + ['PublicKeyCredentialType', base_config_1.TYPE], + ['PushEncryptionKeyName', base_config_1.TYPE], + ['RTCBundlePolicy', base_config_1.TYPE], + ['RTCDataChannelState', base_config_1.TYPE], + ['RTCDegradationPreference', base_config_1.TYPE], + ['RTCDtlsRole', base_config_1.TYPE], + ['RTCDtlsTransportState', base_config_1.TYPE], + ['RTCErrorDetailType', base_config_1.TYPE], + ['RTCIceCandidateType', base_config_1.TYPE], + ['RTCIceComponent', base_config_1.TYPE], + ['RTCIceConnectionState', base_config_1.TYPE], + ['RTCIceGathererState', base_config_1.TYPE], + ['RTCIceGatheringState', base_config_1.TYPE], + ['RTCIceProtocol', base_config_1.TYPE], + ['RTCIceRole', base_config_1.TYPE], + ['RTCIceTcpCandidateType', base_config_1.TYPE], + ['RTCIceTransportPolicy', base_config_1.TYPE], + ['RTCIceTransportState', base_config_1.TYPE], + ['RTCPeerConnectionState', base_config_1.TYPE], + ['RTCPriorityType', base_config_1.TYPE], + ['RTCQualityLimitationReason', base_config_1.TYPE], + ['RTCRtcpMuxPolicy', base_config_1.TYPE], + ['RTCRtpTransceiverDirection', base_config_1.TYPE], + ['RTCSctpTransportState', base_config_1.TYPE], + ['RTCSdpType', base_config_1.TYPE], + ['RTCSignalingState', base_config_1.TYPE], + ['RTCStatsIceCandidatePairState', base_config_1.TYPE], + ['RTCStatsType', base_config_1.TYPE], + ['ReadableStreamReaderMode', base_config_1.TYPE], + ['ReadableStreamType', base_config_1.TYPE], + ['ReadyState', base_config_1.TYPE], + ['RecordingState', base_config_1.TYPE], + ['RedEyeReduction', base_config_1.TYPE], + ['ReferrerPolicy', base_config_1.TYPE], + ['RemotePlaybackState', base_config_1.TYPE], + ['RequestCache', base_config_1.TYPE], + ['RequestCredentials', base_config_1.TYPE], + ['RequestDestination', base_config_1.TYPE], + ['RequestMode', base_config_1.TYPE], + ['RequestPriority', base_config_1.TYPE], + ['RequestRedirect', base_config_1.TYPE], + ['ResidentKeyRequirement', base_config_1.TYPE], + ['ResizeObserverBoxOptions', base_config_1.TYPE], + ['ResizeQuality', base_config_1.TYPE], + ['ResponseType', base_config_1.TYPE], + ['SanitizerPresets', base_config_1.TYPE], + ['ScrollAxis', base_config_1.TYPE], + ['ScrollBehavior', base_config_1.TYPE], + ['ScrollLogicalPosition', base_config_1.TYPE], + ['ScrollRestoration', base_config_1.TYPE], + ['ScrollSetting', base_config_1.TYPE], + ['SecurityPolicyViolationEventDisposition', base_config_1.TYPE], + ['SelectionMode', base_config_1.TYPE], + ['ServiceWorkerState', base_config_1.TYPE], + ['ServiceWorkerUpdateViaCache', base_config_1.TYPE], + ['ShadowRootMode', base_config_1.TYPE], + ['SlotAssignmentMode', base_config_1.TYPE], + ['SpeechRecognitionErrorCode', base_config_1.TYPE], + ['SpeechSynthesisErrorCode', base_config_1.TYPE], + ['TaskPriority', base_config_1.TYPE], + ['TextTrackKind', base_config_1.TYPE], + ['TextTrackMode', base_config_1.TYPE], + ['TouchType', base_config_1.TYPE], + ['TransferFunction', base_config_1.TYPE], + ['UserVerificationRequirement', base_config_1.TYPE], + ['VideoColorPrimaries', base_config_1.TYPE], + ['VideoEncoderBitrateMode', base_config_1.TYPE], + ['VideoFacingModeEnum', base_config_1.TYPE], + ['VideoMatrixCoefficients', base_config_1.TYPE], + ['VideoPixelFormat', base_config_1.TYPE], + ['VideoTransferCharacteristics', base_config_1.TYPE], + ['WakeLockType', base_config_1.TYPE], + ['WebGLPowerPreference', base_config_1.TYPE], + ['WebTransportCongestionControl', base_config_1.TYPE], + ['WebTransportErrorSource', base_config_1.TYPE], + ['WorkerType', base_config_1.TYPE], + ['WriteCommandType', base_config_1.TYPE], + ['XMLHttpRequestResponseType', base_config_1.TYPE], + ['FormDataIterator', base_config_1.TYPE], + ['HeadersIterator', base_config_1.TYPE], + ['MediaKeyStatusMapIterator', base_config_1.TYPE], + ['StylePropertyMapReadOnlyIterator', base_config_1.TYPE], + ['URLSearchParamsIterator', base_config_1.TYPE], + ['FileSystemDirectoryHandleAsyncIterator', base_config_1.TYPE], + ['ReadableStreamAsyncIterator', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3aee50975cc0de593b96682f933425df6eee93e1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2015_collection: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js new file mode 100644 index 0000000000000000000000000000000000000000..30f3035b3a90be0a7b5c48faf60eb4ae6831bb23 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.collection.js @@ -0,0 +1,23 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_collection = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_collection = { + libs: [], + variables: [ + ['Map', base_config_1.TYPE_VALUE], + ['MapConstructor', base_config_1.TYPE], + ['ReadonlyMap', base_config_1.TYPE], + ['WeakMap', base_config_1.TYPE_VALUE], + ['WeakMapConstructor', base_config_1.TYPE], + ['Set', base_config_1.TYPE_VALUE], + ['SetConstructor', base_config_1.TYPE], + ['ReadonlySet', base_config_1.TYPE], + ['WeakSet', base_config_1.TYPE_VALUE], + ['WeakSetConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..86fbc58c3f59a846604c6cd8752ea7f5c9939471 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2015_core: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js new file mode 100644 index 0000000000000000000000000000000000000000..f8c2a08ad1e4fb1fb042c859d4c9246e6e1777aa --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.core.js @@ -0,0 +1,34 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_core = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_core = { + libs: [], + variables: [ + ['Array', base_config_1.TYPE], + ['ArrayConstructor', base_config_1.TYPE], + ['DateConstructor', base_config_1.TYPE], + ['Function', base_config_1.TYPE], + ['Math', base_config_1.TYPE], + ['NumberConstructor', base_config_1.TYPE], + ['ObjectConstructor', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE], + ['RegExpConstructor', base_config_1.TYPE], + ['String', base_config_1.TYPE], + ['StringConstructor', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5e1c3ed5d625635266f12e59775e76d4c67b1d3c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2015: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eec0b1fbef48cde40d2aec49e609683404c5b1b8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2015_generator: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js new file mode 100644 index 0000000000000000000000000000000000000000..0b51a8561c4b7d1e974399618e60b700bc032f32 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.generator.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_generator = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +exports.es2015_generator = { + libs: [es2015_iterable_1.es2015_iterable], + variables: [ + ['Generator', base_config_1.TYPE], + ['GeneratorFunction', base_config_1.TYPE], + ['GeneratorFunctionConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..39ad182e70e1b28a2a8f8d5a105859dfff7d5fc3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2015_iterable: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js new file mode 100644 index 0000000000000000000000000000000000000000..d91a0a7d8e00372280ccc95eff683894e17a1f79 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.iterable.js @@ -0,0 +1,62 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_iterable = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2015_iterable = { + libs: [es2015_symbol_1.es2015_symbol], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['IteratorYieldResult', base_config_1.TYPE], + ['IteratorReturnResult', base_config_1.TYPE], + ['IteratorResult', base_config_1.TYPE], + ['Iterator', base_config_1.TYPE], + ['Iterable', base_config_1.TYPE], + ['IterableIterator', base_config_1.TYPE], + ['IteratorObject', base_config_1.TYPE], + ['BuiltinIteratorReturn', base_config_1.TYPE], + ['ArrayIterator', base_config_1.TYPE], + ['Array', base_config_1.TYPE], + ['ArrayConstructor', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['IArguments', base_config_1.TYPE], + ['MapIterator', base_config_1.TYPE], + ['Map', base_config_1.TYPE], + ['ReadonlyMap', base_config_1.TYPE], + ['MapConstructor', base_config_1.TYPE], + ['WeakMap', base_config_1.TYPE], + ['WeakMapConstructor', base_config_1.TYPE], + ['SetIterator', base_config_1.TYPE], + ['Set', base_config_1.TYPE], + ['ReadonlySet', base_config_1.TYPE], + ['SetConstructor', base_config_1.TYPE], + ['WeakSet', base_config_1.TYPE], + ['WeakSetConstructor', base_config_1.TYPE], + ['Promise', base_config_1.TYPE], + ['PromiseConstructor', base_config_1.TYPE], + ['StringIterator', base_config_1.TYPE], + ['String', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Int8ArrayConstructor', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ArrayConstructor', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Uint8ClampedArrayConstructor', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Int16ArrayConstructor', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Uint16ArrayConstructor', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Int32ArrayConstructor', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Uint32ArrayConstructor', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float32ArrayConstructor', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ['Float64ArrayConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js new file mode 100644 index 0000000000000000000000000000000000000000..44ab404a1a3a59d8593afe55030f3df1ca0f0c12 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.js @@ -0,0 +1,32 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015 = void 0; +const es5_1 = require("./es5"); +const es2015_collection_1 = require("./es2015.collection"); +const es2015_core_1 = require("./es2015.core"); +const es2015_generator_1 = require("./es2015.generator"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_promise_1 = require("./es2015.promise"); +const es2015_proxy_1 = require("./es2015.proxy"); +const es2015_reflect_1 = require("./es2015.reflect"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es2015 = { + libs: [ + es5_1.es5, + es2015_core_1.es2015_core, + es2015_collection_1.es2015_collection, + es2015_iterable_1.es2015_iterable, + es2015_generator_1.es2015_generator, + es2015_promise_1.es2015_promise, + es2015_proxy_1.es2015_proxy, + es2015_reflect_1.es2015_reflect, + es2015_symbol_1.es2015_symbol, + es2015_symbol_wellknown_1.es2015_symbol_wellknown, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4bb3cbb8bccecc170d7b8a27e46de1a600349fa7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2015_promise: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js new file mode 100644 index 0000000000000000000000000000000000000000..aca59619443181fb11208085a6c218fb3027509d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.promise.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_promise = { + libs: [], + variables: [['PromiseConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d0ef95c092d030dd2f8c0e21869fb794d020dc39 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2015_proxy: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js new file mode 100644 index 0000000000000000000000000000000000000000..2ce5022e4cbb564a077fd31cdfd67c773d8c1ad4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.proxy.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_proxy = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_proxy = { + libs: [], + variables: [ + ['ProxyHandler', base_config_1.TYPE], + ['ProxyConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..263b2c051246e6f63d526ac3cf4284a55c3bcd39 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2015_reflect: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js new file mode 100644 index 0000000000000000000000000000000000000000..0e29c2e40df008fe365cea0e51f731278502789c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.reflect.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_reflect = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_reflect = { + libs: [], + variables: [['Reflect', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e1a8346d4455f07913d51546d7219c2f1a6c3dfc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2015_symbol: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js new file mode 100644 index 0000000000000000000000000000000000000000..2baaf5ab0ef9023a6678e43cfa98f6141bd640b3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_symbol = void 0; +const base_config_1 = require("./base-config"); +exports.es2015_symbol = { + libs: [], + variables: [['SymbolConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bedc85017a5c1a6a25d89b97a45c20b58c87ed39 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2015_symbol_wellknown: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js new file mode 100644 index 0000000000000000000000000000000000000000..fc5dadd71e57df1fb0557a31b2b86b3686d38b36 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2015.symbol.wellknown.js @@ -0,0 +1,47 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2015_symbol_wellknown = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2015_symbol_wellknown = { + libs: [es2015_symbol_1.es2015_symbol], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['Symbol', base_config_1.TYPE], + ['Array', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['Date', base_config_1.TYPE], + ['Map', base_config_1.TYPE], + ['WeakMap', base_config_1.TYPE], + ['Set', base_config_1.TYPE], + ['WeakSet', base_config_1.TYPE], + ['JSON', base_config_1.TYPE], + ['Function', base_config_1.TYPE], + ['GeneratorFunction', base_config_1.TYPE], + ['Math', base_config_1.TYPE], + ['Promise', base_config_1.TYPE], + ['PromiseConstructor', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE], + ['RegExpConstructor', base_config_1.TYPE], + ['String', base_config_1.TYPE], + ['ArrayBuffer', base_config_1.TYPE], + ['DataView', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ['ArrayConstructor', base_config_1.TYPE], + ['MapConstructor', base_config_1.TYPE], + ['SetConstructor', base_config_1.TYPE], + ['ArrayBufferConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e4ff90e2475014933916633fe9dafe8f98372b19 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2016_array_include: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js new file mode 100644 index 0000000000000000000000000000000000000000..baab2d1bcf83c5b9a823f19164c65c325cdad771 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.array.include.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016_array_include = void 0; +const base_config_1 = require("./base-config"); +exports.es2016_array_include = { + libs: [], + variables: [ + ['Array', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f943687d95e710074292b97a7f091f9cc4394375 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2016: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ac847f617ab3b3afe78a1763f018b3590330c7a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2016_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js new file mode 100644 index 0000000000000000000000000000000000000000..029ae1c3db1af3a3b9b3db086bf232c2276a111b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.full.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016_full = void 0; +const dom_1 = require("./dom"); +const dom_iterable_1 = require("./dom.iterable"); +const es2016_1 = require("./es2016"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2016_full = { + libs: [es2016_1.es2016, dom_1.dom, webworker_importscripts_1.webworker_importscripts, scripthost_1.scripthost, dom_iterable_1.dom_iterable], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..68cc6af7f349e635967799f2ba65871841d8a292 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2016_intl: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.js new file mode 100644 index 0000000000000000000000000000000000000000..e32da505103ce7bd6736a8858d1e1021e9a7d661 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2016_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js new file mode 100644 index 0000000000000000000000000000000000000000..b98f66db72c7d61eca3ea86d4bfe61f15c12d177 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2016.js @@ -0,0 +1,14 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2016 = void 0; +const es2015_1 = require("./es2015"); +const es2016_array_include_1 = require("./es2016.array.include"); +const es2016_intl_1 = require("./es2016.intl"); +exports.es2016 = { + libs: [es2015_1.es2015, es2016_array_include_1.es2016_array_include, es2016_intl_1.es2016_intl], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d335f9c4e7ff7f20581567899a94f468983d674f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2017_arraybuffer: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.js new file mode 100644 index 0000000000000000000000000000000000000000..8f96439adff9cef9eac4fcc81e2a6a7333fbdaef --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.arraybuffer.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_arraybuffer = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_arraybuffer = { + libs: [], + variables: [['ArrayBufferConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..21e17901581373572e2a5cf1a0a73c3884e11637 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2017: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..41ed58a2836d67932a83df39d8431f275ff4c142 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2017_date: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.js new file mode 100644 index 0000000000000000000000000000000000000000..5e54f22fea574d3717d98e82e05a674849beae7d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.date.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_date = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_date = { + libs: [], + variables: [['DateConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..03bbade450b17a0a44c74ef7b7f655a334575723 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2017_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js new file mode 100644 index 0000000000000000000000000000000000000000..12a1568ef6d53f55e26d6343091e0465945ab095 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.full.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_full = void 0; +const dom_1 = require("./dom"); +const dom_iterable_1 = require("./dom.iterable"); +const es2017_1 = require("./es2017"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2017_full = { + libs: [es2017_1.es2017, dom_1.dom, webworker_importscripts_1.webworker_importscripts, scripthost_1.scripthost, dom_iterable_1.dom_iterable], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..862858cc51c854a9d06ec6e1bc2c07ee4127f0f8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2017_intl: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js new file mode 100644 index 0000000000000000000000000000000000000000..4b9ba6a7e031431a8de8604c116fb2c71cad1a09 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js new file mode 100644 index 0000000000000000000000000000000000000000..bef7d0c71e6bc36f27505735156daafe053f3d03 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.js @@ -0,0 +1,28 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017 = void 0; +const es2016_1 = require("./es2016"); +const es2017_arraybuffer_1 = require("./es2017.arraybuffer"); +const es2017_date_1 = require("./es2017.date"); +const es2017_intl_1 = require("./es2017.intl"); +const es2017_object_1 = require("./es2017.object"); +const es2017_sharedmemory_1 = require("./es2017.sharedmemory"); +const es2017_string_1 = require("./es2017.string"); +const es2017_typedarrays_1 = require("./es2017.typedarrays"); +exports.es2017 = { + libs: [ + es2016_1.es2016, + es2017_arraybuffer_1.es2017_arraybuffer, + es2017_date_1.es2017_date, + es2017_intl_1.es2017_intl, + es2017_object_1.es2017_object, + es2017_sharedmemory_1.es2017_sharedmemory, + es2017_string_1.es2017_string, + es2017_typedarrays_1.es2017_typedarrays, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0b7d7c6681fe0c75b0e3bb16bc1c78950754f657 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2017_object: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js new file mode 100644 index 0000000000000000000000000000000000000000..85c7b95b723b3039de904d54f2526fa543847f09 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.object.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_object = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_object = { + libs: [], + variables: [['ObjectConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8e6ad9b8b4e5a3966dfddcef4eb9f5e2a8e4f623 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2017_sharedmemory: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js new file mode 100644 index 0000000000000000000000000000000000000000..66d08440d8ea43c5936eee369b27a2e0ec8d7808 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.sharedmemory.js @@ -0,0 +1,19 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_sharedmemory = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es2017_sharedmemory = { + libs: [es2015_symbol_1.es2015_symbol, es2015_symbol_wellknown_1.es2015_symbol_wellknown], + variables: [ + ['SharedArrayBuffer', base_config_1.TYPE_VALUE], + ['SharedArrayBufferConstructor', base_config_1.TYPE], + ['ArrayBufferTypes', base_config_1.TYPE], + ['Atomics', base_config_1.TYPE_VALUE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..72cba8a84491957871052ce0c02c8698a0f70ffe --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2017_string: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js new file mode 100644 index 0000000000000000000000000000000000000000..30939851add96b7072c47332ac8f120bb8bdae0c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_string = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3c757aa0fe6a0be3e773073c607ad4fbbd35fb0e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2017_typedarrays: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js new file mode 100644 index 0000000000000000000000000000000000000000..986aed96f5e40d8629e7cb3fba6e7f250ed77c8b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2017.typedarrays.js @@ -0,0 +1,22 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2017_typedarrays = void 0; +const base_config_1 = require("./base-config"); +exports.es2017_typedarrays = { + libs: [], + variables: [ + ['Int8ArrayConstructor', base_config_1.TYPE], + ['Uint8ArrayConstructor', base_config_1.TYPE], + ['Uint8ClampedArrayConstructor', base_config_1.TYPE], + ['Int16ArrayConstructor', base_config_1.TYPE], + ['Uint16ArrayConstructor', base_config_1.TYPE], + ['Int32ArrayConstructor', base_config_1.TYPE], + ['Uint32ArrayConstructor', base_config_1.TYPE], + ['Float32ArrayConstructor', base_config_1.TYPE], + ['Float64ArrayConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..036ee0b8ba7eeca99be92d8ea085520679bdb3cf --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2018_asyncgenerator: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js new file mode 100644 index 0000000000000000000000000000000000000000..653f3733bee1bef6a8bf19b408e412c0dd0b063a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asyncgenerator.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_asyncgenerator = void 0; +const base_config_1 = require("./base-config"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +exports.es2018_asyncgenerator = { + libs: [es2018_asynciterable_1.es2018_asynciterable], + variables: [ + ['AsyncGenerator', base_config_1.TYPE], + ['AsyncGeneratorFunction', base_config_1.TYPE], + ['AsyncGeneratorFunctionConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0a90dd11438e59a6c86a0c613c62fc091655cc2f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2018_asynciterable: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js new file mode 100644 index 0000000000000000000000000000000000000000..028f65ca04e6002cc5deef64d007829ccee12d87 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.asynciterable.js @@ -0,0 +1,20 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_asynciterable = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2018_asynciterable = { + libs: [es2015_symbol_1.es2015_symbol, es2015_iterable_1.es2015_iterable], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['AsyncIterator', base_config_1.TYPE], + ['AsyncIterable', base_config_1.TYPE], + ['AsyncIterableIterator', base_config_1.TYPE], + ['AsyncIteratorObject', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..580776de9bb42a92c674a5064c5ba684bf00d81c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2018: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cfc1d231eb571ee9b9248a9569181520d612c4ae --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2018_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js new file mode 100644 index 0000000000000000000000000000000000000000..51466f554a245470a7d87dcf1a49ac6d8fdf0758 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2018_1 = require("./es2018"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2018_full = { + libs: [ + es2018_1.es2018, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7eaaa40484dba894bc4143bd4452214b42b5b5ad --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2018_intl: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js new file mode 100644 index 0000000000000000000000000000000000000000..f5a83a96d88ab7750f25650a3e443f65714ef3a5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2018_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js new file mode 100644 index 0000000000000000000000000000000000000000..d618693d716ede362bd05d70f09566a202eb9baa --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018 = void 0; +const es2017_1 = require("./es2017"); +const es2018_asyncgenerator_1 = require("./es2018.asyncgenerator"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +const es2018_intl_1 = require("./es2018.intl"); +const es2018_promise_1 = require("./es2018.promise"); +const es2018_regexp_1 = require("./es2018.regexp"); +exports.es2018 = { + libs: [ + es2017_1.es2017, + es2018_asynciterable_1.es2018_asynciterable, + es2018_asyncgenerator_1.es2018_asyncgenerator, + es2018_promise_1.es2018_promise, + es2018_regexp_1.es2018_regexp, + es2018_intl_1.es2018_intl, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..567d30f3fd43c6a986d1bbfa9cf931cdc583ee0f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2018_promise: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js new file mode 100644 index 0000000000000000000000000000000000000000..d4bafd7cadcf9dd6ea4cfc834b5eaf08b08509d7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.promise.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2018_promise = { + libs: [], + variables: [['Promise', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f487a97c3954d4cd7f771efca3a52a4940bb0aea --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2018_regexp: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js new file mode 100644 index 0000000000000000000000000000000000000000..3de3e33d8228ca84231a2e8a23668d9a0ed07906 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2018.regexp.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2018_regexp = void 0; +const base_config_1 = require("./base-config"); +exports.es2018_regexp = { + libs: [], + variables: [ + ['RegExpMatchArray', base_config_1.TYPE], + ['RegExpExecArray', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fbfce6d2ba7dbbe957c8d4df6a40ac11daae4f45 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2019_array: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js new file mode 100644 index 0000000000000000000000000000000000000000..8b314e608da2f6e55bdffb2546de195d6ca13dab --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.array.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_array = void 0; +const base_config_1 = require("./base-config"); +exports.es2019_array = { + libs: [], + variables: [ + ['FlatArray', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['Array', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4f35ee30e0cfd8fe40405389e53841217d4d8305 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2019: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..462cd76e38f23a50d8d362a96a32fc4e51062470 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2019_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js new file mode 100644 index 0000000000000000000000000000000000000000..e9d250301447eb27f172f94dd85d6ff2ea9ed617 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2019_1 = require("./es2019"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2019_full = { + libs: [ + es2019_1.es2019, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..24f7d74116dde3bc4946f1f9a0b5fc39a3e7026d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2019_intl: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.js new file mode 100644 index 0000000000000000000000000000000000000000..01c9469127910cff57aee0be69ca1dda9c9d9f7f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2019_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js new file mode 100644 index 0000000000000000000000000000000000000000..de5c6a2f8e2661c48d7839683855c2123a4fd3a9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019 = void 0; +const es2018_1 = require("./es2018"); +const es2019_array_1 = require("./es2019.array"); +const es2019_intl_1 = require("./es2019.intl"); +const es2019_object_1 = require("./es2019.object"); +const es2019_string_1 = require("./es2019.string"); +const es2019_symbol_1 = require("./es2019.symbol"); +exports.es2019 = { + libs: [ + es2018_1.es2018, + es2019_array_1.es2019_array, + es2019_object_1.es2019_object, + es2019_string_1.es2019_string, + es2019_symbol_1.es2019_symbol, + es2019_intl_1.es2019_intl, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..288250ee0592f7d2c96780fc32e88727843e5e2c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2019_object: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js new file mode 100644 index 0000000000000000000000000000000000000000..2d197bb81f8d4389caa62626a3d76c581c9ca50a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.object.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_object = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +exports.es2019_object = { + libs: [es2015_iterable_1.es2015_iterable], + variables: [['ObjectConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..687c3c8edea8d2fd8da29b0632811c3203438655 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2019_string: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js new file mode 100644 index 0000000000000000000000000000000000000000..b311a5b4eab9b81569e67ed63129e56a09faaa2b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_string = void 0; +const base_config_1 = require("./base-config"); +exports.es2019_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..282a57115c861b88e2c6e8cf850185c36cf49625 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2019_symbol: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js new file mode 100644 index 0000000000000000000000000000000000000000..af24022c596b67c6bd26cec7e0399e4397c10efc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2019.symbol.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2019_symbol = void 0; +const base_config_1 = require("./base-config"); +exports.es2019_symbol = { + libs: [], + variables: [['Symbol', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..78870ee991884fb19f6ad53efa87342d38cf5c9d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2020_bigint: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js new file mode 100644 index 0000000000000000000000000000000000000000..8956da3d7c4797e07dc79d5fa3d059b048554df3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.bigint.js @@ -0,0 +1,23 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_bigint = void 0; +const base_config_1 = require("./base-config"); +const es2020_intl_1 = require("./es2020.intl"); +exports.es2020_bigint = { + libs: [es2020_intl_1.es2020_intl], + variables: [ + ['BigIntToLocaleStringOptions', base_config_1.TYPE], + ['BigInt', base_config_1.TYPE_VALUE], + ['BigIntConstructor', base_config_1.TYPE], + ['BigInt64Array', base_config_1.TYPE_VALUE], + ['BigInt64ArrayConstructor', base_config_1.TYPE], + ['BigUint64Array', base_config_1.TYPE_VALUE], + ['BigUint64ArrayConstructor', base_config_1.TYPE], + ['DataView', base_config_1.TYPE], + ['Intl', base_config_1.TYPE_VALUE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7c0f38d0707fd8e41124e2451da1ba1d45fd71e8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2020: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95a0f06ff444601b363a36e49f8ea7249f6e27e6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2020_date: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.js new file mode 100644 index 0000000000000000000000000000000000000000..adcad452e3d85477b16813710583d498d91caf71 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.date.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_date = void 0; +const base_config_1 = require("./base-config"); +const es2020_intl_1 = require("./es2020.intl"); +exports.es2020_date = { + libs: [es2020_intl_1.es2020_intl], + variables: [['Date', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7edc00443b5d93acc78ed99dff6909ae825b34da --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2020_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js new file mode 100644 index 0000000000000000000000000000000000000000..200fedf53f1c72b80070940770a6019568f7381f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2020_1 = require("./es2020"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2020_full = { + libs: [ + es2020_1.es2020, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1114759da51d7e0946581d75441b3385dd70dba --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2020_intl: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js new file mode 100644 index 0000000000000000000000000000000000000000..36a0f0792a23076b806b2145f455513be0679ba3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.intl.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_intl = void 0; +const base_config_1 = require("./base-config"); +const es2018_intl_1 = require("./es2018.intl"); +exports.es2020_intl = { + libs: [es2018_intl_1.es2018_intl], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js new file mode 100644 index 0000000000000000000000000000000000000000..9997667118a2264b8fff08c5bc8529fbd6b968e5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.js @@ -0,0 +1,30 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020 = void 0; +const es2019_1 = require("./es2019"); +const es2020_bigint_1 = require("./es2020.bigint"); +const es2020_date_1 = require("./es2020.date"); +const es2020_intl_1 = require("./es2020.intl"); +const es2020_number_1 = require("./es2020.number"); +const es2020_promise_1 = require("./es2020.promise"); +const es2020_sharedmemory_1 = require("./es2020.sharedmemory"); +const es2020_string_1 = require("./es2020.string"); +const es2020_symbol_wellknown_1 = require("./es2020.symbol.wellknown"); +exports.es2020 = { + libs: [ + es2019_1.es2019, + es2020_bigint_1.es2020_bigint, + es2020_date_1.es2020_date, + es2020_number_1.es2020_number, + es2020_promise_1.es2020_promise, + es2020_sharedmemory_1.es2020_sharedmemory, + es2020_string_1.es2020_string, + es2020_symbol_wellknown_1.es2020_symbol_wellknown, + es2020_intl_1.es2020_intl, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e03d718f58a24f601f58df401db5e0d9461b1762 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2020_number: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.js new file mode 100644 index 0000000000000000000000000000000000000000..bafbf93532f50fe84fb5f4cc5545e013e4be79fc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.number.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_number = void 0; +const base_config_1 = require("./base-config"); +const es2020_intl_1 = require("./es2020.intl"); +exports.es2020_number = { + libs: [es2020_intl_1.es2020_intl], + variables: [['Number', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cc7b30f07fbfcffd7ce8657b27ea23966e328415 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2020_promise: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js new file mode 100644 index 0000000000000000000000000000000000000000..0640cef3b758cb7ab929f3cd28feeae63754a5ff --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.promise.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2020_promise = { + libs: [], + variables: [ + ['PromiseFulfilledResult', base_config_1.TYPE], + ['PromiseRejectedResult', base_config_1.TYPE], + ['PromiseSettledResult', base_config_1.TYPE], + ['PromiseConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bc7eaadc0afa2c3db5a80ff9136e8a553da07390 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2020_sharedmemory: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.js new file mode 100644 index 0000000000000000000000000000000000000000..d9455474baa8e4eabd9d77caa1647846e5f65648 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.sharedmemory.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_sharedmemory = void 0; +const base_config_1 = require("./base-config"); +const es2020_bigint_1 = require("./es2020.bigint"); +exports.es2020_sharedmemory = { + libs: [es2020_bigint_1.es2020_bigint], + variables: [['Atomics', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e3bea388f6403b094e8bf55931b9f4c06cf6371 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2020_string: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js new file mode 100644 index 0000000000000000000000000000000000000000..78390dae7dcd2d83bba02b129ed9b3916dc12d8b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.string.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_string = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2020_intl_1 = require("./es2020.intl"); +const es2020_symbol_wellknown_1 = require("./es2020.symbol.wellknown"); +exports.es2020_string = { + libs: [es2015_iterable_1.es2015_iterable, es2020_intl_1.es2020_intl, es2020_symbol_wellknown_1.es2020_symbol_wellknown], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a66beeebebd911d2114064f10fb50431025a8224 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2020_symbol_wellknown: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js new file mode 100644 index 0000000000000000000000000000000000000000..23374c4ce20aadabae268b1972fef07ff37255b2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2020.symbol.wellknown.js @@ -0,0 +1,18 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2020_symbol_wellknown = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2020_symbol_wellknown = { + libs: [es2015_iterable_1.es2015_iterable, es2015_symbol_1.es2015_symbol], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['RegExpStringIterator', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8b67729ddfd8228d1375e31a9883bef151dc192 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2021: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..713b4136a33caa37dc42bd7d844821fac74658f2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2021_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.js new file mode 100644 index 0000000000000000000000000000000000000000..09d9eadacbef55ef8e9306777385a4fad03a7f38 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2021_1 = require("./es2021"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2021_full = { + libs: [ + es2021_1.es2021, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2553ae4e8a40668197c6e74220c1f70d0731289b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2021_intl: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.js new file mode 100644 index 0000000000000000000000000000000000000000..e4f17846d56672efaaca32705e526938f075a6bd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2021_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.js new file mode 100644 index 0000000000000000000000000000000000000000..a62791f443af44d7f7bb4c5390acdf6883aad9ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021 = void 0; +const es2020_1 = require("./es2020"); +const es2021_intl_1 = require("./es2021.intl"); +const es2021_promise_1 = require("./es2021.promise"); +const es2021_string_1 = require("./es2021.string"); +const es2021_weakref_1 = require("./es2021.weakref"); +exports.es2021 = { + libs: [es2020_1.es2020, es2021_promise_1.es2021_promise, es2021_string_1.es2021_string, es2021_weakref_1.es2021_weakref, es2021_intl_1.es2021_intl], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..88f46e815b243ca0b247ce3ced3133fb061c32cb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2021_promise: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.js new file mode 100644 index 0000000000000000000000000000000000000000..515cebc25aea18b7cd1ee8bddcfd2f6809adfa48 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.promise.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2021_promise = { + libs: [], + variables: [ + ['AggregateError', base_config_1.TYPE_VALUE], + ['AggregateErrorConstructor', base_config_1.TYPE], + ['PromiseConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3210e0b4c7b3b017fb4db0ada10820b3aa3ae6f4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2021_string: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.js new file mode 100644 index 0000000000000000000000000000000000000000..54dd1318943e6f17619740f5b164a50fe8250be3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021_string = void 0; +const base_config_1 = require("./base-config"); +exports.es2021_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f47f474bcfdb5a8a0b9f7b8f4b0971403135267b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2021_weakref: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.js new file mode 100644 index 0000000000000000000000000000000000000000..5e85a24cf23aa08f45815db3290b945b0f9b98f2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2021.weakref.js @@ -0,0 +1,18 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2021_weakref = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es2021_weakref = { + libs: [es2015_symbol_wellknown_1.es2015_symbol_wellknown], + variables: [ + ['WeakRef', base_config_1.TYPE_VALUE], + ['WeakRefConstructor', base_config_1.TYPE], + ['FinalizationRegistry', base_config_1.TYPE_VALUE], + ['FinalizationRegistryConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2eb6e3bd9f3c93ab2672fb3076594c39680e8187 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2022_array: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.js new file mode 100644 index 0000000000000000000000000000000000000000..f66580d9d189e1c383d35655be8d507f288ff5ea --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.array.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_array = void 0; +const base_config_1 = require("./base-config"); +exports.es2022_array = { + libs: [], + variables: [ + ['Array', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ['BigInt64Array', base_config_1.TYPE], + ['BigUint64Array', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c770d78ab747b53dbc11d6e78db8b59daad17295 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2022: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..50bf35482d44e827bb5fe7e114d4abda94c7f4ac --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2022_error: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.js new file mode 100644 index 0000000000000000000000000000000000000000..a880a6e0148887406935792c83287577090a9fa6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.error.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_error = void 0; +const base_config_1 = require("./base-config"); +const es2021_promise_1 = require("./es2021.promise"); +exports.es2022_error = { + libs: [es2021_promise_1.es2021_promise], + variables: [ + ['ErrorOptions', base_config_1.TYPE], + ['Error', base_config_1.TYPE], + ['ErrorConstructor', base_config_1.TYPE], + ['EvalErrorConstructor', base_config_1.TYPE], + ['RangeErrorConstructor', base_config_1.TYPE], + ['ReferenceErrorConstructor', base_config_1.TYPE], + ['SyntaxErrorConstructor', base_config_1.TYPE], + ['TypeErrorConstructor', base_config_1.TYPE], + ['URIErrorConstructor', base_config_1.TYPE], + ['AggregateErrorConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..78b574f28171ccc95f576ed4f7f78a9274997938 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2022_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.js new file mode 100644 index 0000000000000000000000000000000000000000..378631b32a0b5635cbf8c370c1ab29f953b0d376 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2022_1 = require("./es2022"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2022_full = { + libs: [ + es2022_1.es2022, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fe6d8a6125eecfa3c6830421db084c135ad13d02 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2022_intl: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.js new file mode 100644 index 0000000000000000000000000000000000000000..afe167df535b81ec50cf023a3fe8354039bc100a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2022_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.js new file mode 100644 index 0000000000000000000000000000000000000000..382f73dac2925111dcadb33d7f251507fe2879e5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022 = void 0; +const es2021_1 = require("./es2021"); +const es2022_array_1 = require("./es2022.array"); +const es2022_error_1 = require("./es2022.error"); +const es2022_intl_1 = require("./es2022.intl"); +const es2022_object_1 = require("./es2022.object"); +const es2022_regexp_1 = require("./es2022.regexp"); +const es2022_string_1 = require("./es2022.string"); +exports.es2022 = { + libs: [ + es2021_1.es2021, + es2022_array_1.es2022_array, + es2022_error_1.es2022_error, + es2022_intl_1.es2022_intl, + es2022_object_1.es2022_object, + es2022_regexp_1.es2022_regexp, + es2022_string_1.es2022_string, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..24fb54e3bf3ef3df76252b86c46548843118114b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2022_object: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.js new file mode 100644 index 0000000000000000000000000000000000000000..81699acd79670b67521d6b5f98892480b741fc3a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.object.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_object = void 0; +const base_config_1 = require("./base-config"); +exports.es2022_object = { + libs: [], + variables: [['ObjectConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2d048e44cdf3ecd43abf7154ba14e6da5f6295ca --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2022_regexp: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.js new file mode 100644 index 0000000000000000000000000000000000000000..ab78510771019e74ea112a0deac8ae42342bca0c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.regexp.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_regexp = void 0; +const base_config_1 = require("./base-config"); +exports.es2022_regexp = { + libs: [], + variables: [ + ['RegExpMatchArray', base_config_1.TYPE], + ['RegExpExecArray', base_config_1.TYPE], + ['RegExpIndicesArray', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c1418a4a775b85fb7d514722acd0e596dbc15fb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2022_string: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.js new file mode 100644 index 0000000000000000000000000000000000000000..500dd5042210bf315e3cf8909b0f82f801396f4c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2022.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2022_string = void 0; +const base_config_1 = require("./base-config"); +exports.es2022_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..eb3f9ba7c25e3724fca52a25bdd7ef21c2cb53a9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2023_array: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.js new file mode 100644 index 0000000000000000000000000000000000000000..5b9a19bb4acbcd583b2c61e9b77f913d69adf563 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.array.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2023_array = void 0; +const base_config_1 = require("./base-config"); +exports.es2023_array = { + libs: [], + variables: [ + ['Array', base_config_1.TYPE], + ['ReadonlyArray', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE], + ['BigInt64Array', base_config_1.TYPE], + ['BigUint64Array', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..196d0da29eac4c25ec78418490a81ce894c87c01 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2023_collection: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.js new file mode 100644 index 0000000000000000000000000000000000000000..b6ef0b3ea801d1948a5e12d997ffc1256b679392 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.collection.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2023_collection = void 0; +const base_config_1 = require("./base-config"); +exports.es2023_collection = { + libs: [], + variables: [['WeakKeyTypes', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5fc38436237965fd15fb3b082848781689b3fba8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2023: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..05abdccfe4f66dea11bcb2bcda8300508d64ea24 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2023_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.js new file mode 100644 index 0000000000000000000000000000000000000000..88dbbe2433f40facaca56c29feabcee04f261e88 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2023_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2023_1 = require("./es2023"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2023_full = { + libs: [ + es2023_1.es2023, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2e1662286b23c4de86bdcf26903b2abaf4504cc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2023_intl: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.js new file mode 100644 index 0000000000000000000000000000000000000000..d67b56584042180beb01b42590d9fd18f9d23250 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.intl.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2023_intl = void 0; +const base_config_1 = require("./base-config"); +exports.es2023_intl = { + libs: [], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.js new file mode 100644 index 0000000000000000000000000000000000000000..7369e245ce8ed6798fc354644b1cafee157b6d95 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2023.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2023 = void 0; +const es2022_1 = require("./es2022"); +const es2023_array_1 = require("./es2023.array"); +const es2023_collection_1 = require("./es2023.collection"); +const es2023_intl_1 = require("./es2023.intl"); +exports.es2023 = { + libs: [es2022_1.es2022, es2023_array_1.es2023_array, es2023_collection_1.es2023_collection, es2023_intl_1.es2023_intl], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d5bf1c68c9a39a2bfb725f953197fb8116b6cadf --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2024_arraybuffer: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.js new file mode 100644 index 0000000000000000000000000000000000000000..c11b486059940ea3ce199acbb66655491b57bdae --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.arraybuffer.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_arraybuffer = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_arraybuffer = { + libs: [], + variables: [ + ['ArrayBuffer', base_config_1.TYPE], + ['ArrayBufferConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7d2195496c35135f5afa1c3d104100d6cc60d48d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2024_collection: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.js new file mode 100644 index 0000000000000000000000000000000000000000..e0c7b688d9e9bb6c73a7a5cddb49466ab8e372cc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.collection.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_collection = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_collection = { + libs: [], + variables: [['MapConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..01d254beacfc5ef70aabb5e3a78c1ccd13f4956c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2024: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..82ff6946257bf9c602c14116e906fbe8328e858c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2024_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.js new file mode 100644 index 0000000000000000000000000000000000000000..5f31eef69572c98d79f6a25446929d843fff0fa9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2024_1 = require("./es2024"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2024_full = { + libs: [ + es2024_1.es2024, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.js new file mode 100644 index 0000000000000000000000000000000000000000..fddb8773b6b64c1dce240b5302d3c51ddaa483b8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.js @@ -0,0 +1,28 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024 = void 0; +const es2023_1 = require("./es2023"); +const es2024_arraybuffer_1 = require("./es2024.arraybuffer"); +const es2024_collection_1 = require("./es2024.collection"); +const es2024_object_1 = require("./es2024.object"); +const es2024_promise_1 = require("./es2024.promise"); +const es2024_regexp_1 = require("./es2024.regexp"); +const es2024_sharedmemory_1 = require("./es2024.sharedmemory"); +const es2024_string_1 = require("./es2024.string"); +exports.es2024 = { + libs: [ + es2023_1.es2023, + es2024_arraybuffer_1.es2024_arraybuffer, + es2024_collection_1.es2024_collection, + es2024_object_1.es2024_object, + es2024_promise_1.es2024_promise, + es2024_regexp_1.es2024_regexp, + es2024_sharedmemory_1.es2024_sharedmemory, + es2024_string_1.es2024_string, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..77343ed2a255399de97fcd5cce8d1eda28dd363e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2024_object: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.js new file mode 100644 index 0000000000000000000000000000000000000000..e733f70f3aadb5e8eeb70d6ed039277e4d0e7ad3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.object.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_object = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_object = { + libs: [], + variables: [['ObjectConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e830329bb461cf837f214f1b8bfe43e9ce77323 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2024_promise: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.js new file mode 100644 index 0000000000000000000000000000000000000000..4501e65582c73c59318c6e84e6d46c0604d07d4d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.promise.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_promise = { + libs: [], + variables: [ + ['PromiseWithResolvers', base_config_1.TYPE], + ['PromiseConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..05b3a315a9a6463a01e61a23d84f2e8cdde1d62b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2024_regexp: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.js new file mode 100644 index 0000000000000000000000000000000000000000..a2da5adac83366eb6b9b08196ecc1916ed81dee3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.regexp.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_regexp = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_regexp = { + libs: [], + variables: [['RegExp', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5782f778748db80b8b2a1caa024730961014fcde --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2024_sharedmemory: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.js new file mode 100644 index 0000000000000000000000000000000000000000..2ed579bbe97820ea708cafb82ff459b74696bc95 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.sharedmemory.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_sharedmemory = void 0; +const base_config_1 = require("./base-config"); +const es2020_bigint_1 = require("./es2020.bigint"); +exports.es2024_sharedmemory = { + libs: [es2020_bigint_1.es2020_bigint], + variables: [ + ['Atomics', base_config_1.TYPE], + ['SharedArrayBuffer', base_config_1.TYPE], + ['SharedArrayBufferConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c5704c61209d94232664f975bfc4b8e014324d29 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2024_string: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.js new file mode 100644 index 0000000000000000000000000000000000000000..fcf002910397f9b3208b74fdfae735b6fed04b20 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2024.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2024_string = void 0; +const base_config_1 = require("./base-config"); +exports.es2024_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.collection.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.collection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bf72ee8adc9f2ef45019c5594b09ebd27e3dcca7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.collection.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2025_collection: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.collection.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.collection.js new file mode 100644 index 0000000000000000000000000000000000000000..da2fe3a3fc08b51ed247e9f19279a8760ad71e7a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.collection.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2025_collection = void 0; +const base_config_1 = require("./base-config"); +const es2024_collection_1 = require("./es2024.collection"); +exports.es2025_collection = { + libs: [es2024_collection_1.es2024_collection], + variables: [ + ['ReadonlySetLike', base_config_1.TYPE], + ['Set', base_config_1.TYPE], + ['ReadonlySet', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c97a80113b5413ebdfd86b1cf58be8b6857e923f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2025: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.float16.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.float16.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c824172b2c1c8bc75464416202599c6112d3cf82 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.float16.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2025_float16: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.float16.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.float16.js new file mode 100644 index 0000000000000000000000000000000000000000..a032929db9d0832decb5da66dc32c26d43a0fadd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.float16.js @@ -0,0 +1,19 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2025_float16 = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.es2025_float16 = { + libs: [es2015_symbol_1.es2015_symbol, es2015_iterable_1.es2015_iterable], + variables: [ + ['Float16Array', base_config_1.TYPE_VALUE], + ['Float16ArrayConstructor', base_config_1.TYPE], + ['Math', base_config_1.TYPE], + ['DataView', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a63d605a9684d5eba1692847a0443ba356eaad0e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2025_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.full.js new file mode 100644 index 0000000000000000000000000000000000000000..bc0093e4100e2539ba95ba3204b5f702685312b2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2025_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es2025_1 = require("./es2025"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.es2025_full = { + libs: [ + es2025_1.es2025, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.intl.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.intl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..84f062a0fb77ed38beb2d96f28cf4da1a48993df --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.intl.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2025_intl: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.intl.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.intl.js new file mode 100644 index 0000000000000000000000000000000000000000..d2d01d05f436421f32eea9908f5f4a81ee76c208 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.intl.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2025_intl = void 0; +const base_config_1 = require("./base-config"); +const es2018_intl_1 = require("./es2018.intl"); +exports.es2025_intl = { + libs: [es2018_intl_1.es2018_intl], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.iterator.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.iterator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b55de5eeed6101bc1f8071f60c63686b538a9106 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.iterator.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2025_iterator: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.iterator.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.iterator.js new file mode 100644 index 0000000000000000000000000000000000000000..a682f73da188caf24ca13fb5e3e1d08acc4b0ed9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.iterator.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2025_iterator = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +exports.es2025_iterator = { + libs: [es2015_iterable_1.es2015_iterable], + variables: [ + ['Iterator', base_config_1.TYPE_VALUE], + ['IteratorObjectConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.js new file mode 100644 index 0000000000000000000000000000000000000000..bac4774bcf071c3fd319dc3fcc475f95683a7b57 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2025 = void 0; +const es2024_1 = require("./es2024"); +const es2025_collection_1 = require("./es2025.collection"); +const es2025_float16_1 = require("./es2025.float16"); +const es2025_intl_1 = require("./es2025.intl"); +const es2025_iterator_1 = require("./es2025.iterator"); +const es2025_promise_1 = require("./es2025.promise"); +const es2025_regexp_1 = require("./es2025.regexp"); +exports.es2025 = { + libs: [ + es2024_1.es2024, + es2025_collection_1.es2025_collection, + es2025_float16_1.es2025_float16, + es2025_intl_1.es2025_intl, + es2025_iterator_1.es2025_iterator, + es2025_promise_1.es2025_promise, + es2025_regexp_1.es2025_regexp, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.promise.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.promise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9c0406a7d91121b4c25155775c911c8811e0e85c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.promise.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2025_promise: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.promise.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.promise.js new file mode 100644 index 0000000000000000000000000000000000000000..5f7d2461caf0d1b1ca8baa0065307b2724c006f2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.promise.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2025_promise = void 0; +const base_config_1 = require("./base-config"); +exports.es2025_promise = { + libs: [], + variables: [['PromiseConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.regexp.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.regexp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..606ed4773c1eb1ee5887b3ad17342fc9f8651f4f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.regexp.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es2025_regexp: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.regexp.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.regexp.js new file mode 100644 index 0000000000000000000000000000000000000000..1d9bcf3a47723fd6cfed8c5acb1c6a4764530c11 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es2025.regexp.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es2025_regexp = void 0; +const base_config_1 = require("./base-config"); +exports.es2025_regexp = { + libs: [], + variables: [['RegExpConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..68488e9f74843be965c8441d22b71b741e042b30 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es5: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js new file mode 100644 index 0000000000000000000000000000000000000000..69ffa453097e4c86b2fa51cd676ce5a1b0c84ae2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es5.js @@ -0,0 +1,118 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es5 = void 0; +const base_config_1 = require("./base-config"); +const decorators_1 = require("./decorators"); +const decorators_legacy_1 = require("./decorators.legacy"); +exports.es5 = { + libs: [decorators_1.decorators, decorators_legacy_1.decorators_legacy], + variables: [ + ['Symbol', base_config_1.TYPE], + ['PropertyKey', base_config_1.TYPE], + ['PropertyDescriptor', base_config_1.TYPE], + ['PropertyDescriptorMap', base_config_1.TYPE], + ['Object', base_config_1.TYPE_VALUE], + ['ObjectConstructor', base_config_1.TYPE], + ['Function', base_config_1.TYPE_VALUE], + ['FunctionConstructor', base_config_1.TYPE], + ['ThisParameterType', base_config_1.TYPE], + ['OmitThisParameter', base_config_1.TYPE], + ['CallableFunction', base_config_1.TYPE], + ['NewableFunction', base_config_1.TYPE], + ['IArguments', base_config_1.TYPE], + ['String', base_config_1.TYPE_VALUE], + ['StringConstructor', base_config_1.TYPE], + ['Boolean', base_config_1.TYPE_VALUE], + ['BooleanConstructor', base_config_1.TYPE], + ['Number', base_config_1.TYPE_VALUE], + ['NumberConstructor', base_config_1.TYPE], + ['TemplateStringsArray', base_config_1.TYPE], + ['ImportMeta', base_config_1.TYPE], + ['ImportCallOptions', base_config_1.TYPE], + ['ImportAssertions', base_config_1.TYPE], + ['ImportAttributes', base_config_1.TYPE], + ['Math', base_config_1.TYPE_VALUE], + ['Date', base_config_1.TYPE_VALUE], + ['DateConstructor', base_config_1.TYPE], + ['RegExpMatchArray', base_config_1.TYPE], + ['RegExpExecArray', base_config_1.TYPE], + ['RegExp', base_config_1.TYPE_VALUE], + ['RegExpConstructor', base_config_1.TYPE], + ['Error', base_config_1.TYPE_VALUE], + ['ErrorConstructor', base_config_1.TYPE], + ['EvalError', base_config_1.TYPE_VALUE], + ['EvalErrorConstructor', base_config_1.TYPE], + ['RangeError', base_config_1.TYPE_VALUE], + ['RangeErrorConstructor', base_config_1.TYPE], + ['ReferenceError', base_config_1.TYPE_VALUE], + ['ReferenceErrorConstructor', base_config_1.TYPE], + ['SyntaxError', base_config_1.TYPE_VALUE], + ['SyntaxErrorConstructor', base_config_1.TYPE], + ['TypeError', base_config_1.TYPE_VALUE], + ['TypeErrorConstructor', base_config_1.TYPE], + ['URIError', base_config_1.TYPE_VALUE], + ['URIErrorConstructor', base_config_1.TYPE], + ['JSON', base_config_1.TYPE_VALUE], + ['ReadonlyArray', base_config_1.TYPE], + ['ConcatArray', base_config_1.TYPE], + ['Array', base_config_1.TYPE_VALUE], + ['ArrayConstructor', base_config_1.TYPE], + ['TypedPropertyDescriptor', base_config_1.TYPE], + ['PromiseConstructorLike', base_config_1.TYPE], + ['PromiseLike', base_config_1.TYPE], + ['Promise', base_config_1.TYPE], + ['Awaited', base_config_1.TYPE], + ['ArrayLike', base_config_1.TYPE], + ['Partial', base_config_1.TYPE], + ['Required', base_config_1.TYPE], + ['Readonly', base_config_1.TYPE], + ['Pick', base_config_1.TYPE], + ['Record', base_config_1.TYPE], + ['Exclude', base_config_1.TYPE], + ['Extract', base_config_1.TYPE], + ['Omit', base_config_1.TYPE], + ['NonNullable', base_config_1.TYPE], + ['Parameters', base_config_1.TYPE], + ['ConstructorParameters', base_config_1.TYPE], + ['ReturnType', base_config_1.TYPE], + ['InstanceType', base_config_1.TYPE], + ['Uppercase', base_config_1.TYPE], + ['Lowercase', base_config_1.TYPE], + ['Capitalize', base_config_1.TYPE], + ['Uncapitalize', base_config_1.TYPE], + ['NoInfer', base_config_1.TYPE], + ['ThisType', base_config_1.TYPE], + ['WeakKeyTypes', base_config_1.TYPE], + ['WeakKey', base_config_1.TYPE], + ['ArrayBuffer', base_config_1.TYPE_VALUE], + ['ArrayBufferTypes', base_config_1.TYPE], + ['ArrayBufferLike', base_config_1.TYPE], + ['ArrayBufferConstructor', base_config_1.TYPE], + ['ArrayBufferView', base_config_1.TYPE], + ['DataView', base_config_1.TYPE_VALUE], + ['DataViewConstructor', base_config_1.TYPE], + ['Int8Array', base_config_1.TYPE_VALUE], + ['Int8ArrayConstructor', base_config_1.TYPE], + ['Uint8Array', base_config_1.TYPE_VALUE], + ['Uint8ArrayConstructor', base_config_1.TYPE], + ['Uint8ClampedArray', base_config_1.TYPE_VALUE], + ['Uint8ClampedArrayConstructor', base_config_1.TYPE], + ['Int16Array', base_config_1.TYPE_VALUE], + ['Int16ArrayConstructor', base_config_1.TYPE], + ['Uint16Array', base_config_1.TYPE_VALUE], + ['Uint16ArrayConstructor', base_config_1.TYPE], + ['Int32Array', base_config_1.TYPE_VALUE], + ['Int32ArrayConstructor', base_config_1.TYPE], + ['Uint32Array', base_config_1.TYPE_VALUE], + ['Uint32ArrayConstructor', base_config_1.TYPE], + ['Float32Array', base_config_1.TYPE_VALUE], + ['Float32ArrayConstructor', base_config_1.TYPE], + ['Float64Array', base_config_1.TYPE_VALUE], + ['Float64ArrayConstructor', base_config_1.TYPE], + ['Intl', base_config_1.TYPE_VALUE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..37f24fc230de0010220db9889053c6f045d020bb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es6: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js new file mode 100644 index 0000000000000000000000000000000000000000..1d5f05ec8c1a95c5c48d0a81ebb8b5280c03f579 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es6.js @@ -0,0 +1,32 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es6 = void 0; +const es5_1 = require("./es5"); +const es2015_collection_1 = require("./es2015.collection"); +const es2015_core_1 = require("./es2015.core"); +const es2015_generator_1 = require("./es2015.generator"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_promise_1 = require("./es2015.promise"); +const es2015_proxy_1 = require("./es2015.proxy"); +const es2015_reflect_1 = require("./es2015.reflect"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.es6 = { + libs: [ + es5_1.es5, + es2015_core_1.es2015_core, + es2015_collection_1.es2015_collection, + es2015_iterable_1.es2015_iterable, + es2015_generator_1.es2015_generator, + es2015_promise_1.es2015_promise, + es2015_proxy_1.es2015_proxy, + es2015_reflect_1.es2015_reflect, + es2015_symbol_1.es2015_symbol, + es2015_symbol_wellknown_1.es2015_symbol_wellknown, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..72234a8b7be35706392dcb2c58c9aa3b84cd6e19 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const es7: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js new file mode 100644 index 0000000000000000000000000000000000000000..7b23ee3aba94796d208a97207ae7fabb4a6867d3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/es7.js @@ -0,0 +1,14 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.es7 = void 0; +const es2015_1 = require("./es2015"); +const es2016_array_include_1 = require("./es2016.array.include"); +const es2016_intl_1 = require("./es2016.intl"); +exports.es7 = { + libs: [es2015_1.es2015, es2016_array_include_1.es2016_array_include, es2016_intl_1.es2016_intl], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..119ae20cee5d5791c740a1b139555aba67b48778 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_array: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js new file mode 100644 index 0000000000000000000000000000000000000000..d94bd46ad2d0d18d8956a303d288aa85a872a363 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.array.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_array = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_array = { + libs: [], + variables: [['ArrayConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8e5828e88a772dbd961574ca1bdbad276e12b4c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_asynciterable: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js new file mode 100644 index 0000000000000000000000000000000000000000..08501d916d0a8ca37e4193d1f227d5d4bc71ac8c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.asynciterable.js @@ -0,0 +1,20 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_asynciterable = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.esnext_asynciterable = { + libs: [es2015_symbol_1.es2015_symbol, es2015_iterable_1.es2015_iterable], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['AsyncIterator', base_config_1.TYPE], + ['AsyncIterable', base_config_1.TYPE], + ['AsyncIterableIterator', base_config_1.TYPE], + ['AsyncIteratorObject', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c9b6486052c7962f80942fc5980d422a5b146d24 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_bigint: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js new file mode 100644 index 0000000000000000000000000000000000000000..986f9af5a7b68b43cdc9d1fc9c52fa2247589bd3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.bigint.js @@ -0,0 +1,23 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_bigint = void 0; +const base_config_1 = require("./base-config"); +const es2020_intl_1 = require("./es2020.intl"); +exports.esnext_bigint = { + libs: [es2020_intl_1.es2020_intl], + variables: [ + ['BigIntToLocaleStringOptions', base_config_1.TYPE], + ['BigInt', base_config_1.TYPE_VALUE], + ['BigIntConstructor', base_config_1.TYPE], + ['BigInt64Array', base_config_1.TYPE_VALUE], + ['BigInt64ArrayConstructor', base_config_1.TYPE], + ['BigUint64Array', base_config_1.TYPE_VALUE], + ['BigUint64ArrayConstructor', base_config_1.TYPE], + ['DataView', base_config_1.TYPE], + ['Intl', base_config_1.TYPE_VALUE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ca9537cd4eb6290285533e8aae26234fed6e4f4c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_collection: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.js new file mode 100644 index 0000000000000000000000000000000000000000..bded0102835c4af7f7e56d50e7adf25bf2361f67 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.collection.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_collection = void 0; +const base_config_1 = require("./base-config"); +const es2025_collection_1 = require("./es2025.collection"); +exports.esnext_collection = { + libs: [es2025_collection_1.es2025_collection], + variables: [ + ['Map', base_config_1.TYPE], + ['WeakMap', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d3750649fc794796d9824486ebba9edaa87a179f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.date.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.date.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..da75b6decfb844c52c360e2f020f92be75630665 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.date.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_date: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.date.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.date.js new file mode 100644 index 0000000000000000000000000000000000000000..21e3875647168831044d0ed484e683735277db5f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.date.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_date = void 0; +const base_config_1 = require("./base-config"); +const esnext_temporal_1 = require("./esnext.temporal"); +exports.esnext_date = { + libs: [esnext_temporal_1.esnext_temporal], + variables: [['Date', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..af286f67ae05a3a478371a0ebad313c558135e9f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_decorators: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.js new file mode 100644 index 0000000000000000000000000000000000000000..4ab333804823e92ae4a90144c09db43ee838585d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.decorators.js @@ -0,0 +1,17 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_decorators = void 0; +const base_config_1 = require("./base-config"); +const decorators_1 = require("./decorators"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.esnext_decorators = { + libs: [es2015_symbol_1.es2015_symbol, decorators_1.decorators], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['Function', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..512c356a22dbef4e071434f4e7de960ba6215e18 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_disposable: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.js new file mode 100644 index 0000000000000000000000000000000000000000..476c4970edc8e87aab6a88d06fd579b4ee72369d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.disposable.js @@ -0,0 +1,27 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_disposable = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +exports.esnext_disposable = { + libs: [es2015_symbol_1.es2015_symbol, es2015_iterable_1.es2015_iterable, es2018_asynciterable_1.es2018_asynciterable], + variables: [ + ['SymbolConstructor', base_config_1.TYPE], + ['Disposable', base_config_1.TYPE], + ['AsyncDisposable', base_config_1.TYPE], + ['SuppressedError', base_config_1.TYPE_VALUE], + ['SuppressedErrorConstructor', base_config_1.TYPE], + ['DisposableStack', base_config_1.TYPE_VALUE], + ['DisposableStackConstructor', base_config_1.TYPE], + ['AsyncDisposableStack', base_config_1.TYPE_VALUE], + ['AsyncDisposableStackConstructor', base_config_1.TYPE], + ['IteratorObject', base_config_1.TYPE], + ['AsyncIteratorObject', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.error.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.error.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..34c4eb8c6b0be0be212e3449772b09dac0cd6503 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.error.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_error: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.error.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.error.js new file mode 100644 index 0000000000000000000000000000000000000000..c45767919256d378b598cbbebe267bbd96b40f89 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.error.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_error = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_error = { + libs: [], + variables: [['ErrorConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..98ab1722cc7703cb5e171baf8f614ccd4baba7d4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_float16: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.js new file mode 100644 index 0000000000000000000000000000000000000000..ca945414730245ddaf9fc3d6834df9d74951a80c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.float16.js @@ -0,0 +1,19 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_float16 = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_symbol_1 = require("./es2015.symbol"); +exports.esnext_float16 = { + libs: [es2015_symbol_1.es2015_symbol, es2015_iterable_1.es2015_iterable], + variables: [ + ['Float16Array', base_config_1.TYPE_VALUE], + ['Float16ArrayConstructor', base_config_1.TYPE], + ['Math', base_config_1.TYPE], + ['DataView', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c35f79e523ad7afce6a5fea755164338bc55a2c1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_full: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js new file mode 100644 index 0000000000000000000000000000000000000000..8650003119154ed4320c65fdb2ea7abfdb9e1114 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.full.js @@ -0,0 +1,24 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_full = void 0; +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const esnext_1 = require("./esnext"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.esnext_full = { + libs: [ + esnext_1.esnext, + dom_1.dom, + webworker_importscripts_1.webworker_importscripts, + scripthost_1.scripthost, + dom_iterable_1.dom_iterable, + dom_asynciterable_1.dom_asynciterable, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a0f08dedcfb6a59479db1bfea8aa7f2560dd69b9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_intl: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js new file mode 100644 index 0000000000000000000000000000000000000000..d63e94bcedbbff95e2d7dab6abb93e0905493856 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.intl.js @@ -0,0 +1,13 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_intl = void 0; +const base_config_1 = require("./base-config"); +const esnext_temporal_1 = require("./esnext.temporal"); +exports.esnext_intl = { + libs: [esnext_temporal_1.esnext_temporal], + variables: [['Intl', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2de7b6e203e7a48cdbefb5245fb820fed88e3bfe --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_iterator: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.js new file mode 100644 index 0000000000000000000000000000000000000000..b4d4f55337d84b12cfdc5f8108f130d9b576cf81 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.iterator.js @@ -0,0 +1,16 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_iterator = void 0; +const base_config_1 = require("./base-config"); +const es2015_iterable_1 = require("./es2015.iterable"); +exports.esnext_iterator = { + libs: [es2015_iterable_1.es2015_iterable], + variables: [ + ['Iterator', base_config_1.TYPE_VALUE], + ['IteratorObjectConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js new file mode 100644 index 0000000000000000000000000000000000000000..3fe520b2c6ae7853687355cb962e24fe571d8c31 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.js @@ -0,0 +1,34 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext = void 0; +const es2025_1 = require("./es2025"); +const esnext_array_1 = require("./esnext.array"); +const esnext_collection_1 = require("./esnext.collection"); +const esnext_date_1 = require("./esnext.date"); +const esnext_decorators_1 = require("./esnext.decorators"); +const esnext_disposable_1 = require("./esnext.disposable"); +const esnext_error_1 = require("./esnext.error"); +const esnext_intl_1 = require("./esnext.intl"); +const esnext_sharedmemory_1 = require("./esnext.sharedmemory"); +const esnext_temporal_1 = require("./esnext.temporal"); +const esnext_typedarrays_1 = require("./esnext.typedarrays"); +exports.esnext = { + libs: [ + es2025_1.es2025, + esnext_intl_1.esnext_intl, + esnext_collection_1.esnext_collection, + esnext_decorators_1.esnext_decorators, + esnext_disposable_1.esnext_disposable, + esnext_array_1.esnext_array, + esnext_error_1.esnext_error, + esnext_sharedmemory_1.esnext_sharedmemory, + esnext_typedarrays_1.esnext_typedarrays, + esnext_temporal_1.esnext_temporal, + esnext_date_1.esnext_date, + ], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..aedb644763377a8dd17330574d846856c6c9e516 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_object: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.js new file mode 100644 index 0000000000000000000000000000000000000000..4e222d90d3852710f3d0c00219d7389d30610dbc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.object.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_object = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_object = { + libs: [], + variables: [['ObjectConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..75a6b4b02e8aa355179e47c165a6e82c4b08cdc2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_promise: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js new file mode 100644 index 0000000000000000000000000000000000000000..1f325c97a19b504608cacff0e8f982651250a6e8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.promise.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_promise = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_promise = { + libs: [], + variables: [['PromiseConstructor', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7cf6fb34a8c81d4e2bf4c346f592e5482bb5863 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_regexp: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.js new file mode 100644 index 0000000000000000000000000000000000000000..53d0b17105c3874a6c4af8d01535d6744634c3a3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.regexp.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_regexp = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_regexp = { + libs: [], + variables: [['RegExp', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.sharedmemory.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.sharedmemory.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..524713304d0bcba210d2462b7ccef6f84f0310e7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.sharedmemory.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_sharedmemory: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.sharedmemory.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.sharedmemory.js new file mode 100644 index 0000000000000000000000000000000000000000..dc5a80c7a20fc082565b5475cc36ee93c302adcc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.sharedmemory.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_sharedmemory = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_sharedmemory = { + libs: [], + variables: [['Atomics', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a6261bd5b4613c6770af8892d3093555e99ec7c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_string: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js new file mode 100644 index 0000000000000000000000000000000000000000..1999ac13c3ae1316df09e642962d88c26839bd0c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.string.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_string = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_string = { + libs: [], + variables: [['String', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a2049ab2a6664e73e4b18e56657e45ca484174b4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_symbol: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js new file mode 100644 index 0000000000000000000000000000000000000000..a7935f5653cca39de7f78d4f9f0b7e2797588568 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.symbol.js @@ -0,0 +1,12 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_symbol = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_symbol = { + libs: [], + variables: [['Symbol', base_config_1.TYPE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.temporal.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.temporal.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8fd722fabdc4e35f6b83f8a4ab34f27a3538fd29 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.temporal.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_temporal: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.temporal.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.temporal.js new file mode 100644 index 0000000000000000000000000000000000000000..d941845a650b6534e3e32b50798249c7dc4bd984 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.temporal.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_temporal = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +const es2020_intl_1 = require("./es2020.intl"); +const es2025_intl_1 = require("./es2025.intl"); +exports.esnext_temporal = { + libs: [es2015_symbol_wellknown_1.es2015_symbol_wellknown, es2020_intl_1.es2020_intl, es2025_intl_1.es2025_intl], + variables: [['Temporal', base_config_1.TYPE_VALUE]], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.typedarrays.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.typedarrays.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2e3cb0652e9e4b60060d0d0fcc9b0034642b1bdd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.typedarrays.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_typedarrays: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.typedarrays.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.typedarrays.js new file mode 100644 index 0000000000000000000000000000000000000000..c1c91afd2ed14e55617c45e921e6da5adc5878ca --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.typedarrays.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_typedarrays = void 0; +const base_config_1 = require("./base-config"); +exports.esnext_typedarrays = { + libs: [], + variables: [ + ['Uint8Array', base_config_1.TYPE], + ['Uint8ArrayConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a11aaa1b078e7c5dffded71c849bcac8dbf26c6e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const esnext_weakref: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.js new file mode 100644 index 0000000000000000000000000000000000000000..f2f4a9eb762b0b8dc79de093c5c504def21240d5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/esnext.weakref.js @@ -0,0 +1,18 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.esnext_weakref = void 0; +const base_config_1 = require("./base-config"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +exports.esnext_weakref = { + libs: [es2015_symbol_wellknown_1.es2015_symbol_wellknown], + variables: [ + ['WeakRef', base_config_1.TYPE_VALUE], + ['WeakRefConstructor', base_config_1.TYPE], + ['FinalizationRegistry', base_config_1.TYPE_VALUE], + ['FinalizationRegistryConstructor', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f465ea26ba5706041551dd0debebaecf0b30fd2d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/index.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const lib: ReadonlyMap; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c54f90cd7555080970747c23bfb951459c140f91 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/index.js @@ -0,0 +1,247 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lib = void 0; +const decorators_1 = require("./decorators"); +const decorators_legacy_1 = require("./decorators.legacy"); +const dom_1 = require("./dom"); +const dom_asynciterable_1 = require("./dom.asynciterable"); +const dom_iterable_1 = require("./dom.iterable"); +const es5_1 = require("./es5"); +const es6_1 = require("./es6"); +const es7_1 = require("./es7"); +const es2015_1 = require("./es2015"); +const es2015_collection_1 = require("./es2015.collection"); +const es2015_core_1 = require("./es2015.core"); +const es2015_generator_1 = require("./es2015.generator"); +const es2015_iterable_1 = require("./es2015.iterable"); +const es2015_promise_1 = require("./es2015.promise"); +const es2015_proxy_1 = require("./es2015.proxy"); +const es2015_reflect_1 = require("./es2015.reflect"); +const es2015_symbol_1 = require("./es2015.symbol"); +const es2015_symbol_wellknown_1 = require("./es2015.symbol.wellknown"); +const es2016_1 = require("./es2016"); +const es2016_array_include_1 = require("./es2016.array.include"); +const es2016_full_1 = require("./es2016.full"); +const es2016_intl_1 = require("./es2016.intl"); +const es2017_1 = require("./es2017"); +const es2017_arraybuffer_1 = require("./es2017.arraybuffer"); +const es2017_date_1 = require("./es2017.date"); +const es2017_full_1 = require("./es2017.full"); +const es2017_intl_1 = require("./es2017.intl"); +const es2017_object_1 = require("./es2017.object"); +const es2017_sharedmemory_1 = require("./es2017.sharedmemory"); +const es2017_string_1 = require("./es2017.string"); +const es2017_typedarrays_1 = require("./es2017.typedarrays"); +const es2018_1 = require("./es2018"); +const es2018_asyncgenerator_1 = require("./es2018.asyncgenerator"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +const es2018_full_1 = require("./es2018.full"); +const es2018_intl_1 = require("./es2018.intl"); +const es2018_promise_1 = require("./es2018.promise"); +const es2018_regexp_1 = require("./es2018.regexp"); +const es2019_1 = require("./es2019"); +const es2019_array_1 = require("./es2019.array"); +const es2019_full_1 = require("./es2019.full"); +const es2019_intl_1 = require("./es2019.intl"); +const es2019_object_1 = require("./es2019.object"); +const es2019_string_1 = require("./es2019.string"); +const es2019_symbol_1 = require("./es2019.symbol"); +const es2020_1 = require("./es2020"); +const es2020_bigint_1 = require("./es2020.bigint"); +const es2020_date_1 = require("./es2020.date"); +const es2020_full_1 = require("./es2020.full"); +const es2020_intl_1 = require("./es2020.intl"); +const es2020_number_1 = require("./es2020.number"); +const es2020_promise_1 = require("./es2020.promise"); +const es2020_sharedmemory_1 = require("./es2020.sharedmemory"); +const es2020_string_1 = require("./es2020.string"); +const es2020_symbol_wellknown_1 = require("./es2020.symbol.wellknown"); +const es2021_1 = require("./es2021"); +const es2021_full_1 = require("./es2021.full"); +const es2021_intl_1 = require("./es2021.intl"); +const es2021_promise_1 = require("./es2021.promise"); +const es2021_string_1 = require("./es2021.string"); +const es2021_weakref_1 = require("./es2021.weakref"); +const es2022_1 = require("./es2022"); +const es2022_array_1 = require("./es2022.array"); +const es2022_error_1 = require("./es2022.error"); +const es2022_full_1 = require("./es2022.full"); +const es2022_intl_1 = require("./es2022.intl"); +const es2022_object_1 = require("./es2022.object"); +const es2022_regexp_1 = require("./es2022.regexp"); +const es2022_string_1 = require("./es2022.string"); +const es2023_1 = require("./es2023"); +const es2023_array_1 = require("./es2023.array"); +const es2023_collection_1 = require("./es2023.collection"); +const es2023_full_1 = require("./es2023.full"); +const es2023_intl_1 = require("./es2023.intl"); +const es2024_1 = require("./es2024"); +const es2024_arraybuffer_1 = require("./es2024.arraybuffer"); +const es2024_collection_1 = require("./es2024.collection"); +const es2024_full_1 = require("./es2024.full"); +const es2024_object_1 = require("./es2024.object"); +const es2024_promise_1 = require("./es2024.promise"); +const es2024_regexp_1 = require("./es2024.regexp"); +const es2024_sharedmemory_1 = require("./es2024.sharedmemory"); +const es2024_string_1 = require("./es2024.string"); +const es2025_1 = require("./es2025"); +const es2025_collection_1 = require("./es2025.collection"); +const es2025_float16_1 = require("./es2025.float16"); +const es2025_full_1 = require("./es2025.full"); +const es2025_intl_1 = require("./es2025.intl"); +const es2025_iterator_1 = require("./es2025.iterator"); +const es2025_promise_1 = require("./es2025.promise"); +const es2025_regexp_1 = require("./es2025.regexp"); +const esnext_1 = require("./esnext"); +const esnext_array_1 = require("./esnext.array"); +const esnext_asynciterable_1 = require("./esnext.asynciterable"); +const esnext_bigint_1 = require("./esnext.bigint"); +const esnext_collection_1 = require("./esnext.collection"); +const esnext_date_1 = require("./esnext.date"); +const esnext_decorators_1 = require("./esnext.decorators"); +const esnext_disposable_1 = require("./esnext.disposable"); +const esnext_error_1 = require("./esnext.error"); +const esnext_float16_1 = require("./esnext.float16"); +const esnext_full_1 = require("./esnext.full"); +const esnext_intl_1 = require("./esnext.intl"); +const esnext_iterator_1 = require("./esnext.iterator"); +const esnext_object_1 = require("./esnext.object"); +const esnext_promise_1 = require("./esnext.promise"); +const esnext_regexp_1 = require("./esnext.regexp"); +const esnext_sharedmemory_1 = require("./esnext.sharedmemory"); +const esnext_string_1 = require("./esnext.string"); +const esnext_symbol_1 = require("./esnext.symbol"); +const esnext_temporal_1 = require("./esnext.temporal"); +const esnext_typedarrays_1 = require("./esnext.typedarrays"); +const esnext_weakref_1 = require("./esnext.weakref"); +const lib_1 = require("./lib"); +const scripthost_1 = require("./scripthost"); +const webworker_1 = require("./webworker"); +const webworker_asynciterable_1 = require("./webworker.asynciterable"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +const webworker_iterable_1 = require("./webworker.iterable"); +exports.lib = new Map([ + ['es5', es5_1.es5], + ['es6', es6_1.es6], + ['es2015', es2015_1.es2015], + ['es7', es7_1.es7], + ['es2016', es2016_1.es2016], + ['es2017', es2017_1.es2017], + ['es2018', es2018_1.es2018], + ['es2019', es2019_1.es2019], + ['es2020', es2020_1.es2020], + ['es2021', es2021_1.es2021], + ['es2022', es2022_1.es2022], + ['es2023', es2023_1.es2023], + ['es2024', es2024_1.es2024], + ['es2025', es2025_1.es2025], + ['esnext', esnext_1.esnext], + ['dom', dom_1.dom], + ['dom.iterable', dom_iterable_1.dom_iterable], + ['dom.asynciterable', dom_asynciterable_1.dom_asynciterable], + ['webworker', webworker_1.webworker], + ['webworker.importscripts', webworker_importscripts_1.webworker_importscripts], + ['webworker.iterable', webworker_iterable_1.webworker_iterable], + ['webworker.asynciterable', webworker_asynciterable_1.webworker_asynciterable], + ['scripthost', scripthost_1.scripthost], + ['es2015.core', es2015_core_1.es2015_core], + ['es2015.collection', es2015_collection_1.es2015_collection], + ['es2015.generator', es2015_generator_1.es2015_generator], + ['es2015.iterable', es2015_iterable_1.es2015_iterable], + ['es2015.promise', es2015_promise_1.es2015_promise], + ['es2015.proxy', es2015_proxy_1.es2015_proxy], + ['es2015.reflect', es2015_reflect_1.es2015_reflect], + ['es2015.symbol', es2015_symbol_1.es2015_symbol], + ['es2015.symbol.wellknown', es2015_symbol_wellknown_1.es2015_symbol_wellknown], + ['es2016.array.include', es2016_array_include_1.es2016_array_include], + ['es2016.intl', es2016_intl_1.es2016_intl], + ['es2017.arraybuffer', es2017_arraybuffer_1.es2017_arraybuffer], + ['es2017.date', es2017_date_1.es2017_date], + ['es2017.object', es2017_object_1.es2017_object], + ['es2017.sharedmemory', es2017_sharedmemory_1.es2017_sharedmemory], + ['es2017.string', es2017_string_1.es2017_string], + ['es2017.intl', es2017_intl_1.es2017_intl], + ['es2017.typedarrays', es2017_typedarrays_1.es2017_typedarrays], + ['es2018.asyncgenerator', es2018_asyncgenerator_1.es2018_asyncgenerator], + ['es2018.asynciterable', es2018_asynciterable_1.es2018_asynciterable], + ['es2018.intl', es2018_intl_1.es2018_intl], + ['es2018.promise', es2018_promise_1.es2018_promise], + ['es2018.regexp', es2018_regexp_1.es2018_regexp], + ['es2019.array', es2019_array_1.es2019_array], + ['es2019.object', es2019_object_1.es2019_object], + ['es2019.string', es2019_string_1.es2019_string], + ['es2019.symbol', es2019_symbol_1.es2019_symbol], + ['es2019.intl', es2019_intl_1.es2019_intl], + ['es2020.bigint', es2020_bigint_1.es2020_bigint], + ['es2020.date', es2020_date_1.es2020_date], + ['es2020.promise', es2020_promise_1.es2020_promise], + ['es2020.sharedmemory', es2020_sharedmemory_1.es2020_sharedmemory], + ['es2020.string', es2020_string_1.es2020_string], + ['es2020.symbol.wellknown', es2020_symbol_wellknown_1.es2020_symbol_wellknown], + ['es2020.intl', es2020_intl_1.es2020_intl], + ['es2020.number', es2020_number_1.es2020_number], + ['es2021.promise', es2021_promise_1.es2021_promise], + ['es2021.string', es2021_string_1.es2021_string], + ['es2021.weakref', es2021_weakref_1.es2021_weakref], + ['es2021.intl', es2021_intl_1.es2021_intl], + ['es2022.array', es2022_array_1.es2022_array], + ['es2022.error', es2022_error_1.es2022_error], + ['es2022.intl', es2022_intl_1.es2022_intl], + ['es2022.object', es2022_object_1.es2022_object], + ['es2022.string', es2022_string_1.es2022_string], + ['es2022.regexp', es2022_regexp_1.es2022_regexp], + ['es2023.array', es2023_array_1.es2023_array], + ['es2023.collection', es2023_collection_1.es2023_collection], + ['es2023.intl', es2023_intl_1.es2023_intl], + ['es2024.arraybuffer', es2024_arraybuffer_1.es2024_arraybuffer], + ['es2024.collection', es2024_collection_1.es2024_collection], + ['es2024.object', es2024_object_1.es2024_object], + ['es2024.promise', es2024_promise_1.es2024_promise], + ['es2024.regexp', es2024_regexp_1.es2024_regexp], + ['es2024.sharedmemory', es2024_sharedmemory_1.es2024_sharedmemory], + ['es2024.string', es2024_string_1.es2024_string], + ['es2025.collection', es2025_collection_1.es2025_collection], + ['es2025.float16', es2025_float16_1.es2025_float16], + ['es2025.intl', es2025_intl_1.es2025_intl], + ['es2025.iterator', es2025_iterator_1.es2025_iterator], + ['es2025.promise', es2025_promise_1.es2025_promise], + ['es2025.regexp', es2025_regexp_1.es2025_regexp], + ['esnext.asynciterable', esnext_asynciterable_1.esnext_asynciterable], + ['esnext.symbol', esnext_symbol_1.esnext_symbol], + ['esnext.bigint', esnext_bigint_1.esnext_bigint], + ['esnext.weakref', esnext_weakref_1.esnext_weakref], + ['esnext.object', esnext_object_1.esnext_object], + ['esnext.regexp', esnext_regexp_1.esnext_regexp], + ['esnext.string', esnext_string_1.esnext_string], + ['esnext.float16', esnext_float16_1.esnext_float16], + ['esnext.iterator', esnext_iterator_1.esnext_iterator], + ['esnext.promise', esnext_promise_1.esnext_promise], + ['esnext.array', esnext_array_1.esnext_array], + ['esnext.collection', esnext_collection_1.esnext_collection], + ['esnext.date', esnext_date_1.esnext_date], + ['esnext.decorators', esnext_decorators_1.esnext_decorators], + ['esnext.disposable', esnext_disposable_1.esnext_disposable], + ['esnext.error', esnext_error_1.esnext_error], + ['esnext.intl', esnext_intl_1.esnext_intl], + ['esnext.sharedmemory', esnext_sharedmemory_1.esnext_sharedmemory], + ['esnext.temporal', esnext_temporal_1.esnext_temporal], + ['esnext.typedarrays', esnext_typedarrays_1.esnext_typedarrays], + ['decorators', decorators_1.decorators], + ['decorators.legacy', decorators_legacy_1.decorators_legacy], + ['es2016.full', es2016_full_1.es2016_full], + ['es2017.full', es2017_full_1.es2017_full], + ['es2018.full', es2018_full_1.es2018_full], + ['es2019.full', es2019_full_1.es2019_full], + ['es2020.full', es2020_full_1.es2020_full], + ['es2021.full', es2021_full_1.es2021_full], + ['es2022.full', es2022_full_1.es2022_full], + ['es2023.full', es2023_full_1.es2023_full], + ['es2024.full', es2024_full_1.es2024_full], + ['es2025.full', es2025_full_1.es2025_full], + ['esnext.full', esnext_full_1.esnext_full], + ['lib', lib_1.lib], +]); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ce5234c0b5d23073115dc72fed1cfda24e7b7396 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const lib: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js new file mode 100644 index 0000000000000000000000000000000000000000..0866092d863303005af32f5f78207e467c411435 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/lib.js @@ -0,0 +1,15 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lib = void 0; +const dom_1 = require("./dom"); +const es5_1 = require("./es5"); +const scripthost_1 = require("./scripthost"); +const webworker_importscripts_1 = require("./webworker.importscripts"); +exports.lib = { + libs: [es5_1.es5, dom_1.dom, webworker_importscripts_1.webworker_importscripts, scripthost_1.scripthost], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4fd2a3a4375d1837b3033991d5b9206a583f9e2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const scripthost: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js new file mode 100644 index 0000000000000000000000000000000000000000..4560751160878dffa20b7634117c5808011cf917 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/scripthost.js @@ -0,0 +1,26 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.scripthost = void 0; +const base_config_1 = require("./base-config"); +exports.scripthost = { + libs: [], + variables: [ + ['ActiveXObject', base_config_1.TYPE_VALUE], + ['ITextWriter', base_config_1.TYPE], + ['TextStreamBase', base_config_1.TYPE], + ['TextStreamWriter', base_config_1.TYPE], + ['TextStreamReader', base_config_1.TYPE], + ['SafeArray', base_config_1.TYPE_VALUE], + ['Enumerator', base_config_1.TYPE_VALUE], + ['EnumeratorConstructor', base_config_1.TYPE], + ['VBArray', base_config_1.TYPE_VALUE], + ['VBArrayConstructor', base_config_1.TYPE], + ['VarDate', base_config_1.TYPE_VALUE], + ['DateConstructor', base_config_1.TYPE], + ['Date', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..211e556b65b026b700190af74f11ab478c651ec7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const webworker_asynciterable: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.js new file mode 100644 index 0000000000000000000000000000000000000000..60ff871924893c2daaf36394129be120d79af95b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.asynciterable.js @@ -0,0 +1,11 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webworker_asynciterable = void 0; +exports.webworker_asynciterable = { + libs: [], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b5f8a7934ee373dc741455a97bba3cd9aeabcc68 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const webworker: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e3450e400036a3844027ae91ff82ad90d7b1f431 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const webworker_importscripts: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js new file mode 100644 index 0000000000000000000000000000000000000000..b2d350c3c28064585d6d650542ff47c5f7f523ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.importscripts.js @@ -0,0 +1,11 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webworker_importscripts = void 0; +exports.webworker_importscripts = { + libs: [], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..87973487d0653c93dcef7516c0d37040616ae55c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.d.ts @@ -0,0 +1,2 @@ +import type { LibDefinition } from '../variable'; +export declare const webworker_iterable: LibDefinition; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js new file mode 100644 index 0000000000000000000000000000000000000000..102909ab0cbffe7c03535238df7affdd7fc34fd9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.iterable.js @@ -0,0 +1,11 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webworker_iterable = void 0; +exports.webworker_iterable = { + libs: [], + variables: [], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js new file mode 100644 index 0000000000000000000000000000000000000000..84e3f3d4c6ffcf54ff42a47ad45bf01baa81e181 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/lib/webworker.js @@ -0,0 +1,842 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); +exports.webworker = void 0; +const base_config_1 = require("./base-config"); +const es2015_1 = require("./es2015"); +const es2018_asynciterable_1 = require("./es2018.asynciterable"); +exports.webworker = { + libs: [es2015_1.es2015, es2018_asynciterable_1.es2018_asynciterable], + variables: [ + ['AacEncoderConfig', base_config_1.TYPE], + ['AddEventListenerOptions', base_config_1.TYPE], + ['AesCbcParams', base_config_1.TYPE], + ['AesCtrParams', base_config_1.TYPE], + ['AesDerivedKeyParams', base_config_1.TYPE], + ['AesGcmParams', base_config_1.TYPE], + ['AesKeyAlgorithm', base_config_1.TYPE], + ['AesKeyGenParams', base_config_1.TYPE], + ['Algorithm', base_config_1.TYPE], + ['AudioConfiguration', base_config_1.TYPE], + ['AudioDataCopyToOptions', base_config_1.TYPE], + ['AudioDataInit', base_config_1.TYPE], + ['AudioDecoderConfig', base_config_1.TYPE], + ['AudioDecoderInit', base_config_1.TYPE], + ['AudioDecoderSupport', base_config_1.TYPE], + ['AudioEncoderConfig', base_config_1.TYPE], + ['AudioEncoderInit', base_config_1.TYPE], + ['AudioEncoderSupport', base_config_1.TYPE], + ['AvcEncoderConfig', base_config_1.TYPE], + ['BlobPropertyBag', base_config_1.TYPE], + ['CSSMatrixComponentOptions', base_config_1.TYPE], + ['CSSNumericType', base_config_1.TYPE], + ['CacheQueryOptions', base_config_1.TYPE], + ['ClientQueryOptions', base_config_1.TYPE], + ['CloseEventInit', base_config_1.TYPE], + ['CookieInit', base_config_1.TYPE], + ['CookieListItem', base_config_1.TYPE], + ['CookieStoreDeleteOptions', base_config_1.TYPE], + ['CookieStoreGetOptions', base_config_1.TYPE], + ['CryptoKeyPair', base_config_1.TYPE], + ['CustomEventInit', base_config_1.TYPE], + ['DOMMatrix2DInit', base_config_1.TYPE], + ['DOMMatrixInit', base_config_1.TYPE], + ['DOMPointInit', base_config_1.TYPE], + ['DOMQuadInit', base_config_1.TYPE], + ['DOMRectInit', base_config_1.TYPE], + ['EcKeyGenParams', base_config_1.TYPE], + ['EcKeyImportParams', base_config_1.TYPE], + ['EcdhKeyDeriveParams', base_config_1.TYPE], + ['EcdsaParams', base_config_1.TYPE], + ['EncodedAudioChunkInit', base_config_1.TYPE], + ['EncodedAudioChunkMetadata', base_config_1.TYPE], + ['EncodedVideoChunkInit', base_config_1.TYPE], + ['EncodedVideoChunkMetadata', base_config_1.TYPE], + ['ErrorEventInit', base_config_1.TYPE], + ['EventInit', base_config_1.TYPE], + ['EventListenerOptions', base_config_1.TYPE], + ['EventSourceInit', base_config_1.TYPE], + ['ExtendableCookieChangeEventInit', base_config_1.TYPE], + ['ExtendableEventInit', base_config_1.TYPE], + ['ExtendableMessageEventInit', base_config_1.TYPE], + ['FetchEventInit', base_config_1.TYPE], + ['FilePropertyBag', base_config_1.TYPE], + ['FileSystemCreateWritableOptions', base_config_1.TYPE], + ['FileSystemGetDirectoryOptions', base_config_1.TYPE], + ['FileSystemGetFileOptions', base_config_1.TYPE], + ['FileSystemReadWriteOptions', base_config_1.TYPE], + ['FileSystemRemoveOptions', base_config_1.TYPE], + ['FontFaceDescriptors', base_config_1.TYPE], + ['FontFaceSetLoadEventInit', base_config_1.TYPE], + ['GPUBindGroupDescriptor', base_config_1.TYPE], + ['GPUBindGroupEntry', base_config_1.TYPE], + ['GPUBindGroupLayoutDescriptor', base_config_1.TYPE], + ['GPUBindGroupLayoutEntry', base_config_1.TYPE], + ['GPUBlendComponent', base_config_1.TYPE], + ['GPUBlendState', base_config_1.TYPE], + ['GPUBufferBinding', base_config_1.TYPE], + ['GPUBufferBindingLayout', base_config_1.TYPE], + ['GPUBufferDescriptor', base_config_1.TYPE], + ['GPUCanvasConfiguration', base_config_1.TYPE], + ['GPUCanvasToneMapping', base_config_1.TYPE], + ['GPUColorDict', base_config_1.TYPE], + ['GPUColorTargetState', base_config_1.TYPE], + ['GPUCommandBufferDescriptor', base_config_1.TYPE], + ['GPUCommandEncoderDescriptor', base_config_1.TYPE], + ['GPUComputePassDescriptor', base_config_1.TYPE], + ['GPUComputePassTimestampWrites', base_config_1.TYPE], + ['GPUComputePipelineDescriptor', base_config_1.TYPE], + ['GPUCopyExternalImageDestInfo', base_config_1.TYPE], + ['GPUCopyExternalImageSourceInfo', base_config_1.TYPE], + ['GPUDepthStencilState', base_config_1.TYPE], + ['GPUDeviceDescriptor', base_config_1.TYPE], + ['GPUExtent3DDict', base_config_1.TYPE], + ['GPUExternalTextureBindingLayout', base_config_1.TYPE], + ['GPUExternalTextureDescriptor', base_config_1.TYPE], + ['GPUFragmentState', base_config_1.TYPE], + ['GPUMultisampleState', base_config_1.TYPE], + ['GPUObjectDescriptorBase', base_config_1.TYPE], + ['GPUOrigin2DDict', base_config_1.TYPE], + ['GPUOrigin3DDict', base_config_1.TYPE], + ['GPUPipelineDescriptorBase', base_config_1.TYPE], + ['GPUPipelineErrorInit', base_config_1.TYPE], + ['GPUPipelineLayoutDescriptor', base_config_1.TYPE], + ['GPUPrimitiveState', base_config_1.TYPE], + ['GPUProgrammableStage', base_config_1.TYPE], + ['GPUQuerySetDescriptor', base_config_1.TYPE], + ['GPUQueueDescriptor', base_config_1.TYPE], + ['GPURenderBundleDescriptor', base_config_1.TYPE], + ['GPURenderBundleEncoderDescriptor', base_config_1.TYPE], + ['GPURenderPassColorAttachment', base_config_1.TYPE], + ['GPURenderPassDepthStencilAttachment', base_config_1.TYPE], + ['GPURenderPassDescriptor', base_config_1.TYPE], + ['GPURenderPassLayout', base_config_1.TYPE], + ['GPURenderPassTimestampWrites', base_config_1.TYPE], + ['GPURenderPipelineDescriptor', base_config_1.TYPE], + ['GPURequestAdapterOptions', base_config_1.TYPE], + ['GPUSamplerBindingLayout', base_config_1.TYPE], + ['GPUSamplerDescriptor', base_config_1.TYPE], + ['GPUShaderModuleDescriptor', base_config_1.TYPE], + ['GPUStencilFaceState', base_config_1.TYPE], + ['GPUStorageTextureBindingLayout', base_config_1.TYPE], + ['GPUTexelCopyBufferInfo', base_config_1.TYPE], + ['GPUTexelCopyBufferLayout', base_config_1.TYPE], + ['GPUTexelCopyTextureInfo', base_config_1.TYPE], + ['GPUTextureBindingLayout', base_config_1.TYPE], + ['GPUTextureDescriptor', base_config_1.TYPE], + ['GPUTextureViewDescriptor', base_config_1.TYPE], + ['GPUUncapturedErrorEventInit', base_config_1.TYPE], + ['GPUVertexAttribute', base_config_1.TYPE], + ['GPUVertexBufferLayout', base_config_1.TYPE], + ['GPUVertexState', base_config_1.TYPE], + ['GetNotificationOptions', base_config_1.TYPE], + ['HkdfParams', base_config_1.TYPE], + ['HmacImportParams', base_config_1.TYPE], + ['HmacKeyGenParams', base_config_1.TYPE], + ['IDBDatabaseInfo', base_config_1.TYPE], + ['IDBIndexParameters', base_config_1.TYPE], + ['IDBObjectStoreParameters', base_config_1.TYPE], + ['IDBTransactionOptions', base_config_1.TYPE], + ['IDBVersionChangeEventInit', base_config_1.TYPE], + ['ImageBitmapOptions', base_config_1.TYPE], + ['ImageBitmapRenderingContextSettings', base_config_1.TYPE], + ['ImageDataSettings', base_config_1.TYPE], + ['ImageDecodeOptions', base_config_1.TYPE], + ['ImageDecodeResult', base_config_1.TYPE], + ['ImageDecoderInit', base_config_1.TYPE], + ['ImageEncodeOptions', base_config_1.TYPE], + ['JsonWebKey', base_config_1.TYPE], + ['KeyAlgorithm', base_config_1.TYPE], + ['KeySystemTrackConfiguration', base_config_1.TYPE], + ['LockInfo', base_config_1.TYPE], + ['LockManagerSnapshot', base_config_1.TYPE], + ['LockOptions', base_config_1.TYPE], + ['MediaCapabilitiesDecodingInfo', base_config_1.TYPE], + ['MediaCapabilitiesEncodingInfo', base_config_1.TYPE], + ['MediaCapabilitiesInfo', base_config_1.TYPE], + ['MediaCapabilitiesKeySystemConfiguration', base_config_1.TYPE], + ['MediaConfiguration', base_config_1.TYPE], + ['MediaDecodingConfiguration', base_config_1.TYPE], + ['MediaEncodingConfiguration', base_config_1.TYPE], + ['MediaStreamTrackProcessorInit', base_config_1.TYPE], + ['MessageEventInit', base_config_1.TYPE], + ['MultiCacheQueryOptions', base_config_1.TYPE], + ['NavigationPreloadState', base_config_1.TYPE], + ['NotificationEventInit', base_config_1.TYPE], + ['NotificationOptions', base_config_1.TYPE], + ['OpusEncoderConfig', base_config_1.TYPE], + ['Pbkdf2Params', base_config_1.TYPE], + ['PerformanceMarkOptions', base_config_1.TYPE], + ['PerformanceMeasureOptions', base_config_1.TYPE], + ['PerformanceObserverInit', base_config_1.TYPE], + ['PermissionDescriptor', base_config_1.TYPE], + ['PlaneLayout', base_config_1.TYPE], + ['ProgressEventInit', base_config_1.TYPE], + ['PromiseRejectionEventInit', base_config_1.TYPE], + ['PushEventInit', base_config_1.TYPE], + ['PushSubscriptionChangeEventInit', base_config_1.TYPE], + ['PushSubscriptionJSON', base_config_1.TYPE], + ['PushSubscriptionOptionsInit', base_config_1.TYPE], + ['QueuingStrategy', base_config_1.TYPE], + ['QueuingStrategyInit', base_config_1.TYPE], + ['RTCEncodedAudioFrameMetadata', base_config_1.TYPE], + ['RTCEncodedFrameMetadata', base_config_1.TYPE], + ['RTCEncodedVideoFrameMetadata', base_config_1.TYPE], + ['ReadableStreamBYOBReaderReadOptions', base_config_1.TYPE], + ['ReadableStreamGetReaderOptions', base_config_1.TYPE], + ['ReadableStreamIteratorOptions', base_config_1.TYPE], + ['ReadableStreamReadDoneResult', base_config_1.TYPE], + ['ReadableStreamReadValueResult', base_config_1.TYPE], + ['ReadableWritablePair', base_config_1.TYPE], + ['RegistrationOptions', base_config_1.TYPE], + ['Report', base_config_1.TYPE], + ['ReportBody', base_config_1.TYPE], + ['ReportingObserverOptions', base_config_1.TYPE], + ['RequestInit', base_config_1.TYPE], + ['ResponseInit', base_config_1.TYPE], + ['RsaHashedImportParams', base_config_1.TYPE], + ['RsaHashedKeyGenParams', base_config_1.TYPE], + ['RsaKeyGenParams', base_config_1.TYPE], + ['RsaOaepParams', base_config_1.TYPE], + ['RsaOtherPrimesInfo', base_config_1.TYPE], + ['RsaPssParams', base_config_1.TYPE], + ['SchedulerPostTaskOptions', base_config_1.TYPE], + ['SecurityPolicyViolationEventInit', base_config_1.TYPE], + ['StorageEstimate', base_config_1.TYPE], + ['StreamPipeOptions', base_config_1.TYPE], + ['StructuredSerializeOptions', base_config_1.TYPE], + ['SvcOutputMetadata', base_config_1.TYPE], + ['TaskControllerInit', base_config_1.TYPE], + ['TaskPriorityChangeEventInit', base_config_1.TYPE], + ['TaskSignalAnyInit', base_config_1.TYPE], + ['TextDecodeOptions', base_config_1.TYPE], + ['TextDecoderOptions', base_config_1.TYPE], + ['TextEncoderEncodeIntoResult', base_config_1.TYPE], + ['Transformer', base_config_1.TYPE], + ['URLPatternComponentResult', base_config_1.TYPE], + ['URLPatternInit', base_config_1.TYPE], + ['URLPatternOptions', base_config_1.TYPE], + ['URLPatternResult', base_config_1.TYPE], + ['UnderlyingByteSource', base_config_1.TYPE], + ['UnderlyingDefaultSource', base_config_1.TYPE], + ['UnderlyingSink', base_config_1.TYPE], + ['UnderlyingSource', base_config_1.TYPE], + ['VideoColorSpaceInit', base_config_1.TYPE], + ['VideoConfiguration', base_config_1.TYPE], + ['VideoDecoderConfig', base_config_1.TYPE], + ['VideoDecoderInit', base_config_1.TYPE], + ['VideoDecoderSupport', base_config_1.TYPE], + ['VideoEncoderConfig', base_config_1.TYPE], + ['VideoEncoderEncodeOptions', base_config_1.TYPE], + ['VideoEncoderEncodeOptionsForAvc', base_config_1.TYPE], + ['VideoEncoderInit', base_config_1.TYPE], + ['VideoEncoderSupport', base_config_1.TYPE], + ['VideoFrameBufferInit', base_config_1.TYPE], + ['VideoFrameCopyToOptions', base_config_1.TYPE], + ['VideoFrameInit', base_config_1.TYPE], + ['WebGLContextAttributes', base_config_1.TYPE], + ['WebGLContextEventInit', base_config_1.TYPE], + ['WebTransportCloseInfo', base_config_1.TYPE], + ['WebTransportErrorOptions', base_config_1.TYPE], + ['WebTransportHash', base_config_1.TYPE], + ['WebTransportOptions', base_config_1.TYPE], + ['WebTransportSendOptions', base_config_1.TYPE], + ['WebTransportSendStreamOptions', base_config_1.TYPE], + ['WorkerOptions', base_config_1.TYPE], + ['WriteParams', base_config_1.TYPE], + ['ANGLE_instanced_arrays', base_config_1.TYPE], + ['AbortController', base_config_1.TYPE_VALUE], + ['AbortSignalEventMap', base_config_1.TYPE], + ['AbortSignal', base_config_1.TYPE_VALUE], + ['AbstractWorkerEventMap', base_config_1.TYPE], + ['AbstractWorker', base_config_1.TYPE], + ['AnimationFrameProvider', base_config_1.TYPE], + ['AudioData', base_config_1.TYPE_VALUE], + ['AudioDecoderEventMap', base_config_1.TYPE], + ['AudioDecoder', base_config_1.TYPE_VALUE], + ['AudioEncoderEventMap', base_config_1.TYPE], + ['AudioEncoder', base_config_1.TYPE_VALUE], + ['Blob', base_config_1.TYPE_VALUE], + ['Body', base_config_1.TYPE], + ['BroadcastChannelEventMap', base_config_1.TYPE], + ['BroadcastChannel', base_config_1.TYPE_VALUE], + ['ByteLengthQueuingStrategy', base_config_1.TYPE_VALUE], + ['CSSImageValue', base_config_1.TYPE_VALUE], + ['CSSKeywordValue', base_config_1.TYPE_VALUE], + ['CSSMathClamp', base_config_1.TYPE_VALUE], + ['CSSMathInvert', base_config_1.TYPE_VALUE], + ['CSSMathMax', base_config_1.TYPE_VALUE], + ['CSSMathMin', base_config_1.TYPE_VALUE], + ['CSSMathNegate', base_config_1.TYPE_VALUE], + ['CSSMathProduct', base_config_1.TYPE_VALUE], + ['CSSMathSum', base_config_1.TYPE_VALUE], + ['CSSMathValue', base_config_1.TYPE_VALUE], + ['CSSMatrixComponent', base_config_1.TYPE_VALUE], + ['CSSNumericArray', base_config_1.TYPE_VALUE], + ['CSSNumericValue', base_config_1.TYPE_VALUE], + ['CSSPerspective', base_config_1.TYPE_VALUE], + ['CSSRotate', base_config_1.TYPE_VALUE], + ['CSSScale', base_config_1.TYPE_VALUE], + ['CSSSkew', base_config_1.TYPE_VALUE], + ['CSSSkewX', base_config_1.TYPE_VALUE], + ['CSSSkewY', base_config_1.TYPE_VALUE], + ['CSSStyleValue', base_config_1.TYPE_VALUE], + ['CSSTransformComponent', base_config_1.TYPE_VALUE], + ['CSSTransformValue', base_config_1.TYPE_VALUE], + ['CSSTranslate', base_config_1.TYPE_VALUE], + ['CSSUnitValue', base_config_1.TYPE_VALUE], + ['CSSUnparsedValue', base_config_1.TYPE_VALUE], + ['CSSVariableReferenceValue', base_config_1.TYPE_VALUE], + ['Cache', base_config_1.TYPE_VALUE], + ['CacheStorage', base_config_1.TYPE_VALUE], + ['CanvasCompositing', base_config_1.TYPE], + ['CanvasDrawImage', base_config_1.TYPE], + ['CanvasDrawPath', base_config_1.TYPE], + ['CanvasFillStrokeStyles', base_config_1.TYPE], + ['CanvasFilters', base_config_1.TYPE], + ['CanvasGradient', base_config_1.TYPE_VALUE], + ['CanvasImageData', base_config_1.TYPE], + ['CanvasImageSmoothing', base_config_1.TYPE], + ['CanvasPath', base_config_1.TYPE], + ['CanvasPathDrawingStyles', base_config_1.TYPE], + ['CanvasPattern', base_config_1.TYPE_VALUE], + ['CanvasRect', base_config_1.TYPE], + ['CanvasShadowStyles', base_config_1.TYPE], + ['CanvasState', base_config_1.TYPE], + ['CanvasText', base_config_1.TYPE], + ['CanvasTextDrawingStyles', base_config_1.TYPE], + ['CanvasTransform', base_config_1.TYPE], + ['Client', base_config_1.TYPE_VALUE], + ['Clients', base_config_1.TYPE_VALUE], + ['CloseEvent', base_config_1.TYPE_VALUE], + ['CompressionStream', base_config_1.TYPE_VALUE], + ['CookieStore', base_config_1.TYPE_VALUE], + ['CookieStoreManager', base_config_1.TYPE_VALUE], + ['CountQueuingStrategy', base_config_1.TYPE_VALUE], + ['Crypto', base_config_1.TYPE_VALUE], + ['CryptoKey', base_config_1.TYPE_VALUE], + ['CustomEvent', base_config_1.TYPE_VALUE], + ['DOMException', base_config_1.TYPE_VALUE], + ['DOMMatrix', base_config_1.TYPE_VALUE], + ['DOMMatrixReadOnly', base_config_1.TYPE_VALUE], + ['DOMPoint', base_config_1.TYPE_VALUE], + ['DOMPointReadOnly', base_config_1.TYPE_VALUE], + ['DOMQuad', base_config_1.TYPE_VALUE], + ['DOMRect', base_config_1.TYPE_VALUE], + ['DOMRectReadOnly', base_config_1.TYPE_VALUE], + ['DOMStringList', base_config_1.TYPE_VALUE], + ['DecompressionStream', base_config_1.TYPE_VALUE], + ['DedicatedWorkerGlobalScopeEventMap', base_config_1.TYPE], + ['DedicatedWorkerGlobalScope', base_config_1.TYPE_VALUE], + ['EXT_blend_minmax', base_config_1.TYPE], + ['EXT_color_buffer_float', base_config_1.TYPE], + ['EXT_color_buffer_half_float', base_config_1.TYPE], + ['EXT_float_blend', base_config_1.TYPE], + ['EXT_frag_depth', base_config_1.TYPE], + ['EXT_sRGB', base_config_1.TYPE], + ['EXT_shader_texture_lod', base_config_1.TYPE], + ['EXT_texture_compression_bptc', base_config_1.TYPE], + ['EXT_texture_compression_rgtc', base_config_1.TYPE], + ['EXT_texture_filter_anisotropic', base_config_1.TYPE], + ['EXT_texture_norm16', base_config_1.TYPE], + ['EncodedAudioChunk', base_config_1.TYPE_VALUE], + ['EncodedVideoChunk', base_config_1.TYPE_VALUE], + ['ErrorEvent', base_config_1.TYPE_VALUE], + ['Event', base_config_1.TYPE_VALUE], + ['EventListener', base_config_1.TYPE], + ['EventListenerObject', base_config_1.TYPE], + ['EventSourceEventMap', base_config_1.TYPE], + ['EventSource', base_config_1.TYPE_VALUE], + ['EventTarget', base_config_1.TYPE_VALUE], + ['ExtendableCookieChangeEvent', base_config_1.TYPE_VALUE], + ['ExtendableEvent', base_config_1.TYPE_VALUE], + ['ExtendableMessageEvent', base_config_1.TYPE_VALUE], + ['FetchEvent', base_config_1.TYPE_VALUE], + ['File', base_config_1.TYPE_VALUE], + ['FileList', base_config_1.TYPE_VALUE], + ['FileReaderEventMap', base_config_1.TYPE], + ['FileReader', base_config_1.TYPE_VALUE], + ['FileReaderSync', base_config_1.TYPE_VALUE], + ['FileSystemDirectoryHandle', base_config_1.TYPE_VALUE], + ['FileSystemFileHandle', base_config_1.TYPE_VALUE], + ['FileSystemHandle', base_config_1.TYPE_VALUE], + ['FileSystemSyncAccessHandle', base_config_1.TYPE_VALUE], + ['FileSystemWritableFileStream', base_config_1.TYPE_VALUE], + ['FontFace', base_config_1.TYPE_VALUE], + ['FontFaceSetEventMap', base_config_1.TYPE], + ['FontFaceSet', base_config_1.TYPE_VALUE], + ['FontFaceSetLoadEvent', base_config_1.TYPE_VALUE], + ['FontFaceSource', base_config_1.TYPE], + ['FormData', base_config_1.TYPE_VALUE], + ['GPU', base_config_1.TYPE_VALUE], + ['GPUAdapter', base_config_1.TYPE_VALUE], + ['GPUAdapterInfo', base_config_1.TYPE_VALUE], + ['GPUBindGroup', base_config_1.TYPE_VALUE], + ['GPUBindGroupLayout', base_config_1.TYPE_VALUE], + ['GPUBindingCommandsMixin', base_config_1.TYPE], + ['GPUBuffer', base_config_1.TYPE_VALUE], + ['GPUCanvasContext', base_config_1.TYPE_VALUE], + ['GPUCommandBuffer', base_config_1.TYPE_VALUE], + ['GPUCommandEncoder', base_config_1.TYPE_VALUE], + ['GPUCompilationInfo', base_config_1.TYPE_VALUE], + ['GPUCompilationMessage', base_config_1.TYPE_VALUE], + ['GPUComputePassEncoder', base_config_1.TYPE_VALUE], + ['GPUComputePipeline', base_config_1.TYPE_VALUE], + ['GPUDebugCommandsMixin', base_config_1.TYPE], + ['GPUDeviceEventMap', base_config_1.TYPE], + ['GPUDevice', base_config_1.TYPE_VALUE], + ['GPUDeviceLostInfo', base_config_1.TYPE_VALUE], + ['GPUError', base_config_1.TYPE_VALUE], + ['GPUExternalTexture', base_config_1.TYPE_VALUE], + ['GPUInternalError', base_config_1.TYPE_VALUE], + ['GPUObjectBase', base_config_1.TYPE], + ['GPUOutOfMemoryError', base_config_1.TYPE_VALUE], + ['GPUPipelineBase', base_config_1.TYPE], + ['GPUPipelineError', base_config_1.TYPE_VALUE], + ['GPUPipelineLayout', base_config_1.TYPE_VALUE], + ['GPUQuerySet', base_config_1.TYPE_VALUE], + ['GPUQueue', base_config_1.TYPE_VALUE], + ['GPURenderBundle', base_config_1.TYPE_VALUE], + ['GPURenderBundleEncoder', base_config_1.TYPE_VALUE], + ['GPURenderCommandsMixin', base_config_1.TYPE], + ['GPURenderPassEncoder', base_config_1.TYPE_VALUE], + ['GPURenderPipeline', base_config_1.TYPE_VALUE], + ['GPUSampler', base_config_1.TYPE_VALUE], + ['GPUShaderModule', base_config_1.TYPE_VALUE], + ['GPUSupportedFeatures', base_config_1.TYPE_VALUE], + ['GPUSupportedLimits', base_config_1.TYPE_VALUE], + ['GPUTexture', base_config_1.TYPE_VALUE], + ['GPUTextureView', base_config_1.TYPE_VALUE], + ['GPUUncapturedErrorEvent', base_config_1.TYPE_VALUE], + ['GPUValidationError', base_config_1.TYPE_VALUE], + ['GenericTransformStream', base_config_1.TYPE], + ['Headers', base_config_1.TYPE_VALUE], + ['IDBCursor', base_config_1.TYPE_VALUE], + ['IDBCursorWithValue', base_config_1.TYPE_VALUE], + ['IDBDatabaseEventMap', base_config_1.TYPE], + ['IDBDatabase', base_config_1.TYPE_VALUE], + ['IDBFactory', base_config_1.TYPE_VALUE], + ['IDBIndex', base_config_1.TYPE_VALUE], + ['IDBKeyRange', base_config_1.TYPE_VALUE], + ['IDBObjectStore', base_config_1.TYPE_VALUE], + ['IDBOpenDBRequestEventMap', base_config_1.TYPE], + ['IDBOpenDBRequest', base_config_1.TYPE_VALUE], + ['IDBRequestEventMap', base_config_1.TYPE], + ['IDBRequest', base_config_1.TYPE_VALUE], + ['IDBTransactionEventMap', base_config_1.TYPE], + ['IDBTransaction', base_config_1.TYPE_VALUE], + ['IDBVersionChangeEvent', base_config_1.TYPE_VALUE], + ['ImageBitmap', base_config_1.TYPE_VALUE], + ['ImageBitmapRenderingContext', base_config_1.TYPE_VALUE], + ['ImageData', base_config_1.TYPE_VALUE], + ['ImageDecoder', base_config_1.TYPE_VALUE], + ['ImageTrack', base_config_1.TYPE_VALUE], + ['ImageTrackList', base_config_1.TYPE_VALUE], + ['ImportMeta', base_config_1.TYPE], + ['KHR_parallel_shader_compile', base_config_1.TYPE], + ['Lock', base_config_1.TYPE_VALUE], + ['LockManager', base_config_1.TYPE_VALUE], + ['MediaCapabilities', base_config_1.TYPE_VALUE], + ['MediaSourceHandle', base_config_1.TYPE_VALUE], + ['MediaStreamTrackProcessor', base_config_1.TYPE_VALUE], + ['MessageChannel', base_config_1.TYPE_VALUE], + ['MessageEvent', base_config_1.TYPE_VALUE], + ['MessageEventTargetEventMap', base_config_1.TYPE], + ['MessageEventTarget', base_config_1.TYPE], + ['MessagePortEventMap', base_config_1.TYPE], + ['MessagePort', base_config_1.TYPE_VALUE], + ['NavigationPreloadManager', base_config_1.TYPE_VALUE], + ['NavigatorBadge', base_config_1.TYPE], + ['NavigatorConcurrentHardware', base_config_1.TYPE], + ['NavigatorGPU', base_config_1.TYPE], + ['NavigatorID', base_config_1.TYPE], + ['NavigatorLanguage', base_config_1.TYPE], + ['NavigatorLocks', base_config_1.TYPE], + ['NavigatorOnLine', base_config_1.TYPE], + ['NavigatorStorage', base_config_1.TYPE], + ['NotificationEventMap', base_config_1.TYPE], + ['Notification', base_config_1.TYPE_VALUE], + ['NotificationEvent', base_config_1.TYPE_VALUE], + ['OES_draw_buffers_indexed', base_config_1.TYPE], + ['OES_element_index_uint', base_config_1.TYPE], + ['OES_fbo_render_mipmap', base_config_1.TYPE], + ['OES_standard_derivatives', base_config_1.TYPE], + ['OES_texture_float', base_config_1.TYPE], + ['OES_texture_float_linear', base_config_1.TYPE], + ['OES_texture_half_float', base_config_1.TYPE], + ['OES_texture_half_float_linear', base_config_1.TYPE], + ['OES_vertex_array_object', base_config_1.TYPE], + ['OVR_multiview2', base_config_1.TYPE], + ['OffscreenCanvasEventMap', base_config_1.TYPE], + ['OffscreenCanvas', base_config_1.TYPE_VALUE], + ['OffscreenCanvasRenderingContext2D', base_config_1.TYPE_VALUE], + ['Path2D', base_config_1.TYPE_VALUE], + ['PerformanceEventMap', base_config_1.TYPE], + ['Performance', base_config_1.TYPE_VALUE], + ['PerformanceEntry', base_config_1.TYPE_VALUE], + ['PerformanceMark', base_config_1.TYPE_VALUE], + ['PerformanceMeasure', base_config_1.TYPE_VALUE], + ['PerformanceObserver', base_config_1.TYPE_VALUE], + ['PerformanceObserverEntryList', base_config_1.TYPE_VALUE], + ['PerformanceResourceTiming', base_config_1.TYPE_VALUE], + ['PerformanceServerTiming', base_config_1.TYPE_VALUE], + ['PermissionStatusEventMap', base_config_1.TYPE], + ['PermissionStatus', base_config_1.TYPE_VALUE], + ['Permissions', base_config_1.TYPE_VALUE], + ['ProgressEvent', base_config_1.TYPE_VALUE], + ['PromiseRejectionEvent', base_config_1.TYPE_VALUE], + ['PushEvent', base_config_1.TYPE_VALUE], + ['PushManager', base_config_1.TYPE_VALUE], + ['PushManagerAttribute', base_config_1.TYPE], + ['PushMessageData', base_config_1.TYPE_VALUE], + ['PushSubscription', base_config_1.TYPE_VALUE], + ['PushSubscriptionChangeEvent', base_config_1.TYPE_VALUE], + ['PushSubscriptionOptions', base_config_1.TYPE_VALUE], + ['RTCDataChannelEventMap', base_config_1.TYPE], + ['RTCDataChannel', base_config_1.TYPE_VALUE], + ['RTCEncodedAudioFrame', base_config_1.TYPE_VALUE], + ['RTCEncodedVideoFrame', base_config_1.TYPE_VALUE], + ['RTCRtpScriptTransformer', base_config_1.TYPE_VALUE], + ['RTCTransformEvent', base_config_1.TYPE_VALUE], + ['ReadableByteStreamController', base_config_1.TYPE_VALUE], + ['ReadableStream', base_config_1.TYPE_VALUE], + ['ReadableStreamBYOBReader', base_config_1.TYPE_VALUE], + ['ReadableStreamBYOBRequest', base_config_1.TYPE_VALUE], + ['ReadableStreamDefaultController', base_config_1.TYPE_VALUE], + ['ReadableStreamDefaultReader', base_config_1.TYPE_VALUE], + ['ReadableStreamGenericReader', base_config_1.TYPE], + ['ReportingObserver', base_config_1.TYPE_VALUE], + ['Request', base_config_1.TYPE_VALUE], + ['Response', base_config_1.TYPE_VALUE], + ['Scheduler', base_config_1.TYPE_VALUE], + ['SecurityPolicyViolationEvent', base_config_1.TYPE_VALUE], + ['ServiceWorkerEventMap', base_config_1.TYPE], + ['ServiceWorker', base_config_1.TYPE_VALUE], + ['ServiceWorkerContainerEventMap', base_config_1.TYPE], + ['ServiceWorkerContainer', base_config_1.TYPE_VALUE], + ['ServiceWorkerGlobalScopeEventMap', base_config_1.TYPE], + ['ServiceWorkerGlobalScope', base_config_1.TYPE_VALUE], + ['ServiceWorkerRegistrationEventMap', base_config_1.TYPE], + ['ServiceWorkerRegistration', base_config_1.TYPE_VALUE], + ['SharedWorkerGlobalScopeEventMap', base_config_1.TYPE], + ['SharedWorkerGlobalScope', base_config_1.TYPE_VALUE], + ['StorageManager', base_config_1.TYPE_VALUE], + ['StylePropertyMapReadOnly', base_config_1.TYPE_VALUE], + ['SubtleCrypto', base_config_1.TYPE_VALUE], + ['TaskController', base_config_1.TYPE_VALUE], + ['TaskPriorityChangeEvent', base_config_1.TYPE_VALUE], + ['TaskSignalEventMap', base_config_1.TYPE], + ['TaskSignal', base_config_1.TYPE_VALUE], + ['TextDecoder', base_config_1.TYPE_VALUE], + ['TextDecoderCommon', base_config_1.TYPE], + ['TextDecoderStream', base_config_1.TYPE_VALUE], + ['TextEncoder', base_config_1.TYPE_VALUE], + ['TextEncoderCommon', base_config_1.TYPE], + ['TextEncoderStream', base_config_1.TYPE_VALUE], + ['TextMetrics', base_config_1.TYPE_VALUE], + ['TransformStream', base_config_1.TYPE_VALUE], + ['TransformStreamDefaultController', base_config_1.TYPE_VALUE], + ['URL', base_config_1.TYPE_VALUE], + ['URLPattern', base_config_1.TYPE_VALUE], + ['URLSearchParams', base_config_1.TYPE_VALUE], + ['VideoColorSpace', base_config_1.TYPE_VALUE], + ['VideoDecoderEventMap', base_config_1.TYPE], + ['VideoDecoder', base_config_1.TYPE_VALUE], + ['VideoEncoderEventMap', base_config_1.TYPE], + ['VideoEncoder', base_config_1.TYPE_VALUE], + ['VideoFrame', base_config_1.TYPE_VALUE], + ['WEBGL_color_buffer_float', base_config_1.TYPE], + ['WEBGL_compressed_texture_astc', base_config_1.TYPE], + ['WEBGL_compressed_texture_etc', base_config_1.TYPE], + ['WEBGL_compressed_texture_etc1', base_config_1.TYPE], + ['WEBGL_compressed_texture_pvrtc', base_config_1.TYPE], + ['WEBGL_compressed_texture_s3tc', base_config_1.TYPE], + ['WEBGL_compressed_texture_s3tc_srgb', base_config_1.TYPE], + ['WEBGL_debug_renderer_info', base_config_1.TYPE], + ['WEBGL_debug_shaders', base_config_1.TYPE], + ['WEBGL_depth_texture', base_config_1.TYPE], + ['WEBGL_draw_buffers', base_config_1.TYPE], + ['WEBGL_lose_context', base_config_1.TYPE], + ['WEBGL_multi_draw', base_config_1.TYPE], + ['WGSLLanguageFeatures', base_config_1.TYPE_VALUE], + ['WebGL2RenderingContext', base_config_1.TYPE_VALUE], + ['WebGL2RenderingContextBase', base_config_1.TYPE], + ['WebGL2RenderingContextOverloads', base_config_1.TYPE], + ['WebGLActiveInfo', base_config_1.TYPE_VALUE], + ['WebGLBuffer', base_config_1.TYPE_VALUE], + ['WebGLContextEvent', base_config_1.TYPE_VALUE], + ['WebGLFramebuffer', base_config_1.TYPE_VALUE], + ['WebGLProgram', base_config_1.TYPE_VALUE], + ['WebGLQuery', base_config_1.TYPE_VALUE], + ['WebGLRenderbuffer', base_config_1.TYPE_VALUE], + ['WebGLRenderingContext', base_config_1.TYPE_VALUE], + ['WebGLRenderingContextBase', base_config_1.TYPE], + ['WebGLRenderingContextOverloads', base_config_1.TYPE], + ['WebGLSampler', base_config_1.TYPE_VALUE], + ['WebGLShader', base_config_1.TYPE_VALUE], + ['WebGLShaderPrecisionFormat', base_config_1.TYPE_VALUE], + ['WebGLSync', base_config_1.TYPE_VALUE], + ['WebGLTexture', base_config_1.TYPE_VALUE], + ['WebGLTransformFeedback', base_config_1.TYPE_VALUE], + ['WebGLUniformLocation', base_config_1.TYPE_VALUE], + ['WebGLVertexArrayObject', base_config_1.TYPE_VALUE], + ['WebGLVertexArrayObjectOES', base_config_1.TYPE], + ['WebSocketEventMap', base_config_1.TYPE], + ['WebSocket', base_config_1.TYPE_VALUE], + ['WebTransport', base_config_1.TYPE_VALUE], + ['WebTransportBidirectionalStream', base_config_1.TYPE_VALUE], + ['WebTransportDatagramDuplexStream', base_config_1.TYPE_VALUE], + ['WebTransportError', base_config_1.TYPE_VALUE], + ['WindowClient', base_config_1.TYPE_VALUE], + ['WindowOrWorkerGlobalScope', base_config_1.TYPE], + ['WorkerEventMap', base_config_1.TYPE], + ['Worker', base_config_1.TYPE_VALUE], + ['WorkerGlobalScopeEventMap', base_config_1.TYPE], + ['WorkerGlobalScope', base_config_1.TYPE_VALUE], + ['WorkerLocation', base_config_1.TYPE_VALUE], + ['WorkerNavigator', base_config_1.TYPE_VALUE], + ['WritableStream', base_config_1.TYPE_VALUE], + ['WritableStreamDefaultController', base_config_1.TYPE_VALUE], + ['WritableStreamDefaultWriter', base_config_1.TYPE_VALUE], + ['XMLHttpRequestEventMap', base_config_1.TYPE], + ['XMLHttpRequest', base_config_1.TYPE_VALUE], + ['XMLHttpRequestEventTargetEventMap', base_config_1.TYPE], + ['XMLHttpRequestEventTarget', base_config_1.TYPE_VALUE], + ['XMLHttpRequestUpload', base_config_1.TYPE_VALUE], + ['WebAssembly', base_config_1.TYPE_VALUE], + ['Console', base_config_1.TYPE], + ['AudioDataOutputCallback', base_config_1.TYPE], + ['EncodedAudioChunkOutputCallback', base_config_1.TYPE], + ['EncodedVideoChunkOutputCallback', base_config_1.TYPE], + ['FrameRequestCallback', base_config_1.TYPE], + ['LockGrantedCallback', base_config_1.TYPE], + ['OnErrorEventHandlerNonNull', base_config_1.TYPE], + ['PerformanceObserverCallback', base_config_1.TYPE], + ['QueuingStrategySize', base_config_1.TYPE], + ['ReportingObserverCallback', base_config_1.TYPE], + ['SchedulerPostTaskCallback', base_config_1.TYPE], + ['TransformerFlushCallback', base_config_1.TYPE], + ['TransformerStartCallback', base_config_1.TYPE], + ['TransformerTransformCallback', base_config_1.TYPE], + ['UnderlyingSinkAbortCallback', base_config_1.TYPE], + ['UnderlyingSinkCloseCallback', base_config_1.TYPE], + ['UnderlyingSinkStartCallback', base_config_1.TYPE], + ['UnderlyingSinkWriteCallback', base_config_1.TYPE], + ['UnderlyingSourceCancelCallback', base_config_1.TYPE], + ['UnderlyingSourcePullCallback', base_config_1.TYPE], + ['UnderlyingSourceStartCallback', base_config_1.TYPE], + ['VideoFrameOutputCallback', base_config_1.TYPE], + ['VoidFunction', base_config_1.TYPE], + ['WebCodecsErrorCallback', base_config_1.TYPE], + ['AlgorithmIdentifier', base_config_1.TYPE], + ['AllowSharedBufferSource', base_config_1.TYPE], + ['BigInteger', base_config_1.TYPE], + ['BlobPart', base_config_1.TYPE], + ['BodyInit', base_config_1.TYPE], + ['BufferSource', base_config_1.TYPE], + ['CSSKeywordish', base_config_1.TYPE], + ['CSSNumberish', base_config_1.TYPE], + ['CSSPerspectiveValue', base_config_1.TYPE], + ['CSSUnparsedSegment', base_config_1.TYPE], + ['CanvasImageSource', base_config_1.TYPE], + ['CookieList', base_config_1.TYPE], + ['DOMHighResTimeStamp', base_config_1.TYPE], + ['EpochTimeStamp', base_config_1.TYPE], + ['EventListenerOrEventListenerObject', base_config_1.TYPE], + ['FileSystemWriteChunkType', base_config_1.TYPE], + ['Float32List', base_config_1.TYPE], + ['FormDataEntryValue', base_config_1.TYPE], + ['GLbitfield', base_config_1.TYPE], + ['GLboolean', base_config_1.TYPE], + ['GLclampf', base_config_1.TYPE], + ['GLenum', base_config_1.TYPE], + ['GLfloat', base_config_1.TYPE], + ['GLint', base_config_1.TYPE], + ['GLint64', base_config_1.TYPE], + ['GLintptr', base_config_1.TYPE], + ['GLsizei', base_config_1.TYPE], + ['GLsizeiptr', base_config_1.TYPE], + ['GLuint', base_config_1.TYPE], + ['GLuint64', base_config_1.TYPE], + ['GPUBindingResource', base_config_1.TYPE], + ['GPUBufferDynamicOffset', base_config_1.TYPE], + ['GPUBufferUsageFlags', base_config_1.TYPE], + ['GPUColor', base_config_1.TYPE], + ['GPUColorWriteFlags', base_config_1.TYPE], + ['GPUCopyExternalImageSource', base_config_1.TYPE], + ['GPUDepthBias', base_config_1.TYPE], + ['GPUExtent3D', base_config_1.TYPE], + ['GPUFlagsConstant', base_config_1.TYPE], + ['GPUIndex32', base_config_1.TYPE], + ['GPUIntegerCoordinate', base_config_1.TYPE], + ['GPUIntegerCoordinateOut', base_config_1.TYPE], + ['GPUMapModeFlags', base_config_1.TYPE], + ['GPUOrigin2D', base_config_1.TYPE], + ['GPUOrigin3D', base_config_1.TYPE], + ['GPUPipelineConstantValue', base_config_1.TYPE], + ['GPUSampleMask', base_config_1.TYPE], + ['GPUShaderStageFlags', base_config_1.TYPE], + ['GPUSignedOffset32', base_config_1.TYPE], + ['GPUSize32', base_config_1.TYPE], + ['GPUSize32Out', base_config_1.TYPE], + ['GPUSize64', base_config_1.TYPE], + ['GPUSize64Out', base_config_1.TYPE], + ['GPUStencilValue', base_config_1.TYPE], + ['GPUTextureUsageFlags', base_config_1.TYPE], + ['HashAlgorithmIdentifier', base_config_1.TYPE], + ['HeadersInit', base_config_1.TYPE], + ['IDBValidKey', base_config_1.TYPE], + ['ImageBitmapSource', base_config_1.TYPE], + ['ImageBufferSource', base_config_1.TYPE], + ['ImageDataArray', base_config_1.TYPE], + ['Int32List', base_config_1.TYPE], + ['MessageEventSource', base_config_1.TYPE], + ['NamedCurve', base_config_1.TYPE], + ['OffscreenRenderingContext', base_config_1.TYPE], + ['OnErrorEventHandler', base_config_1.TYPE], + ['PerformanceEntryList', base_config_1.TYPE], + ['PushMessageDataInit', base_config_1.TYPE], + ['ReadableStreamController', base_config_1.TYPE], + ['ReadableStreamReadResult', base_config_1.TYPE], + ['ReadableStreamReader', base_config_1.TYPE], + ['ReportList', base_config_1.TYPE], + ['RequestInfo', base_config_1.TYPE], + ['TexImageSource', base_config_1.TYPE], + ['TimerHandler', base_config_1.TYPE], + ['Transferable', base_config_1.TYPE], + ['URLPatternInput', base_config_1.TYPE], + ['Uint32List', base_config_1.TYPE], + ['XMLHttpRequestBodyInit', base_config_1.TYPE], + ['AacBitstreamFormat', base_config_1.TYPE], + ['AlphaOption', base_config_1.TYPE], + ['AudioSampleFormat', base_config_1.TYPE], + ['AvcBitstreamFormat', base_config_1.TYPE], + ['BinaryType', base_config_1.TYPE], + ['BitrateMode', base_config_1.TYPE], + ['CSSMathOperator', base_config_1.TYPE], + ['CSSNumericBaseType', base_config_1.TYPE], + ['CanvasDirection', base_config_1.TYPE], + ['CanvasFillRule', base_config_1.TYPE], + ['CanvasFontKerning', base_config_1.TYPE], + ['CanvasFontStretch', base_config_1.TYPE], + ['CanvasFontVariantCaps', base_config_1.TYPE], + ['CanvasLineCap', base_config_1.TYPE], + ['CanvasLineJoin', base_config_1.TYPE], + ['CanvasTextAlign', base_config_1.TYPE], + ['CanvasTextBaseline', base_config_1.TYPE], + ['CanvasTextRendering', base_config_1.TYPE], + ['ClientTypes', base_config_1.TYPE], + ['CodecState', base_config_1.TYPE], + ['ColorGamut', base_config_1.TYPE], + ['ColorSpaceConversion', base_config_1.TYPE], + ['CompressionFormat', base_config_1.TYPE], + ['CookieSameSite', base_config_1.TYPE], + ['DocumentVisibilityState', base_config_1.TYPE], + ['EncodedAudioChunkType', base_config_1.TYPE], + ['EncodedVideoChunkType', base_config_1.TYPE], + ['EndingType', base_config_1.TYPE], + ['FileSystemHandleKind', base_config_1.TYPE], + ['FontDisplay', base_config_1.TYPE], + ['FontFaceLoadStatus', base_config_1.TYPE], + ['FontFaceSetLoadStatus', base_config_1.TYPE], + ['FrameType', base_config_1.TYPE], + ['GPUAddressMode', base_config_1.TYPE], + ['GPUAutoLayoutMode', base_config_1.TYPE], + ['GPUBlendFactor', base_config_1.TYPE], + ['GPUBlendOperation', base_config_1.TYPE], + ['GPUBufferBindingType', base_config_1.TYPE], + ['GPUBufferMapState', base_config_1.TYPE], + ['GPUCanvasAlphaMode', base_config_1.TYPE], + ['GPUCanvasToneMappingMode', base_config_1.TYPE], + ['GPUCompareFunction', base_config_1.TYPE], + ['GPUCompilationMessageType', base_config_1.TYPE], + ['GPUCullMode', base_config_1.TYPE], + ['GPUDeviceLostReason', base_config_1.TYPE], + ['GPUErrorFilter', base_config_1.TYPE], + ['GPUFeatureName', base_config_1.TYPE], + ['GPUFilterMode', base_config_1.TYPE], + ['GPUFrontFace', base_config_1.TYPE], + ['GPUIndexFormat', base_config_1.TYPE], + ['GPULoadOp', base_config_1.TYPE], + ['GPUMipmapFilterMode', base_config_1.TYPE], + ['GPUPipelineErrorReason', base_config_1.TYPE], + ['GPUPowerPreference', base_config_1.TYPE], + ['GPUPrimitiveTopology', base_config_1.TYPE], + ['GPUQueryType', base_config_1.TYPE], + ['GPUSamplerBindingType', base_config_1.TYPE], + ['GPUStencilOperation', base_config_1.TYPE], + ['GPUStorageTextureAccess', base_config_1.TYPE], + ['GPUStoreOp', base_config_1.TYPE], + ['GPUTextureAspect', base_config_1.TYPE], + ['GPUTextureDimension', base_config_1.TYPE], + ['GPUTextureFormat', base_config_1.TYPE], + ['GPUTextureSampleType', base_config_1.TYPE], + ['GPUTextureViewDimension', base_config_1.TYPE], + ['GPUVertexFormat', base_config_1.TYPE], + ['GPUVertexStepMode', base_config_1.TYPE], + ['GlobalCompositeOperation', base_config_1.TYPE], + ['HardwareAcceleration', base_config_1.TYPE], + ['HdrMetadataType', base_config_1.TYPE], + ['IDBCursorDirection', base_config_1.TYPE], + ['IDBRequestReadyState', base_config_1.TYPE], + ['IDBTransactionDurability', base_config_1.TYPE], + ['IDBTransactionMode', base_config_1.TYPE], + ['ImageDataPixelFormat', base_config_1.TYPE], + ['ImageOrientation', base_config_1.TYPE], + ['ImageSmoothingQuality', base_config_1.TYPE], + ['KeyFormat', base_config_1.TYPE], + ['KeyType', base_config_1.TYPE], + ['KeyUsage', base_config_1.TYPE], + ['LatencyMode', base_config_1.TYPE], + ['LockMode', base_config_1.TYPE], + ['MediaDecodingType', base_config_1.TYPE], + ['MediaEncodingType', base_config_1.TYPE], + ['MediaKeysRequirement', base_config_1.TYPE], + ['NotificationDirection', base_config_1.TYPE], + ['NotificationPermission', base_config_1.TYPE], + ['OffscreenRenderingContextId', base_config_1.TYPE], + ['OpusBitstreamFormat', base_config_1.TYPE], + ['PermissionName', base_config_1.TYPE], + ['PermissionState', base_config_1.TYPE], + ['PredefinedColorSpace', base_config_1.TYPE], + ['PremultiplyAlpha', base_config_1.TYPE], + ['PushEncryptionKeyName', base_config_1.TYPE], + ['RTCDataChannelState', base_config_1.TYPE], + ['ReadableStreamReaderMode', base_config_1.TYPE], + ['ReadableStreamType', base_config_1.TYPE], + ['ReferrerPolicy', base_config_1.TYPE], + ['RequestCache', base_config_1.TYPE], + ['RequestCredentials', base_config_1.TYPE], + ['RequestDestination', base_config_1.TYPE], + ['RequestMode', base_config_1.TYPE], + ['RequestPriority', base_config_1.TYPE], + ['RequestRedirect', base_config_1.TYPE], + ['ResizeQuality', base_config_1.TYPE], + ['ResponseType', base_config_1.TYPE], + ['SecurityPolicyViolationEventDisposition', base_config_1.TYPE], + ['ServiceWorkerState', base_config_1.TYPE], + ['ServiceWorkerUpdateViaCache', base_config_1.TYPE], + ['TaskPriority', base_config_1.TYPE], + ['TransferFunction', base_config_1.TYPE], + ['VideoColorPrimaries', base_config_1.TYPE], + ['VideoEncoderBitrateMode', base_config_1.TYPE], + ['VideoMatrixCoefficients', base_config_1.TYPE], + ['VideoPixelFormat', base_config_1.TYPE], + ['VideoTransferCharacteristics', base_config_1.TYPE], + ['WebGLPowerPreference', base_config_1.TYPE], + ['WebTransportCongestionControl', base_config_1.TYPE], + ['WebTransportErrorSource', base_config_1.TYPE], + ['WorkerType', base_config_1.TYPE], + ['WriteCommandType', base_config_1.TYPE], + ['XMLHttpRequestResponseType', base_config_1.TYPE], + ['FormDataIterator', base_config_1.TYPE], + ['HeadersIterator', base_config_1.TYPE], + ['StylePropertyMapReadOnlyIterator', base_config_1.TYPE], + ['URLSearchParamsIterator', base_config_1.TYPE], + ['FileSystemDirectoryHandleAsyncIterator', base_config_1.TYPE], + ['ReadableStreamAsyncIterator', base_config_1.TYPE], + ], +}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c04014da8398022e87867c3b4aa2e1282e62542f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.d.ts @@ -0,0 +1,27 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { Referencer } from './Referencer'; +import { Visitor } from './Visitor'; +export declare class ClassVisitor extends Visitor { + #private; + constructor(referencer: Referencer); + static visit(referencer: Referencer, node: TSESTree.ClassDeclaration | TSESTree.ClassExpression): void; + visit(node: TSESTree.Node | null | undefined): void; + protected visitClass(node: TSESTree.ClassDeclaration | TSESTree.ClassExpression): void; + protected visitFunctionParameterTypeAnnotation(node: TSESTree.Parameter): void; + protected visitMethod(node: TSESTree.MethodDefinition): void; + protected visitMethodFunction(node: TSESTree.FunctionExpression): void; + protected visitPropertyBase(node: TSESTree.AccessorProperty | TSESTree.PropertyDefinition | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractMethodDefinition | TSESTree.TSAbstractPropertyDefinition): void; + protected visitPropertyDefinition(node: TSESTree.AccessorProperty | TSESTree.PropertyDefinition | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractPropertyDefinition): void; + protected visitType(node: TSESTree.Node | null | undefined): void; + protected AccessorProperty(node: TSESTree.AccessorProperty): void; + protected ClassBody(node: TSESTree.ClassBody): void; + protected Identifier(node: TSESTree.Identifier): void; + protected MethodDefinition(node: TSESTree.MethodDefinition): void; + protected PrivateIdentifier(): void; + protected PropertyDefinition(node: TSESTree.PropertyDefinition): void; + protected StaticBlock(node: TSESTree.StaticBlock): void; + protected TSAbstractAccessorProperty(node: TSESTree.TSAbstractAccessorProperty): void; + protected TSAbstractMethodDefinition(node: TSESTree.TSAbstractMethodDefinition): void; + protected TSAbstractPropertyDefinition(node: TSESTree.TSAbstractPropertyDefinition): void; + protected TSIndexSignature(node: TSESTree.TSIndexSignature): void; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js new file mode 100644 index 0000000000000000000000000000000000000000..ce22658763af2cc18e8ef6de1616879492004f35 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ClassVisitor.js @@ -0,0 +1,178 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const definition_1 = require("../definition"); +const TypeVisitor_1 = require("./TypeVisitor"); +const Visitor_1 = require("./Visitor"); +class ClassVisitor extends Visitor_1.Visitor { + #referencer; + constructor(referencer) { + super(referencer); + this.#referencer = referencer; + } + static visit(referencer, node) { + const classVisitor = new ClassVisitor(referencer); + classVisitor.visitClass(node); + } + visit(node) { + // make sure we only handle the nodes we are designed to handle + if (node && node.type in this) { + super.visit(node); + } + else { + this.#referencer.visit(node); + } + } + /////////////////// + // Visit helpers // + /////////////////// + visitClass(node) { + if (node.type === types_1.AST_NODE_TYPES.ClassDeclaration && node.id) { + this.#referencer + .currentScope() + .defineIdentifier(node.id, new definition_1.ClassNameDefinition(node.id, node)); + } + node.decorators.forEach(d => this.#referencer.visit(d)); + this.#referencer.scopeManager.nestClassScope(node); + if (node.id) { + // define the class name again inside the new scope + // references to the class should not resolve directly to the parent class + this.#referencer + .currentScope() + .defineIdentifier(node.id, new definition_1.ClassNameDefinition(node.id, node)); + } + this.#referencer.visit(node.superClass); + // visit the type param declarations + this.visitType(node.typeParameters); + // then the usages + this.visitType(node.superTypeArguments); + node.implements.forEach(imp => this.visitType(imp)); + this.visit(node.body); + this.#referencer.close(node); + } + visitFunctionParameterTypeAnnotation(node) { + switch (node.type) { + case types_1.AST_NODE_TYPES.AssignmentPattern: + this.visitType(node.left.typeAnnotation); + break; + case types_1.AST_NODE_TYPES.TSParameterProperty: + this.visitFunctionParameterTypeAnnotation(node.parameter); + break; + default: + this.visitType(node.typeAnnotation); + } + } + visitMethod(node) { + if (node.computed) { + this.#referencer.visit(node.key); + } + if (node.value.type === types_1.AST_NODE_TYPES.FunctionExpression) { + this.visitMethodFunction(node.value); + } + else { + this.#referencer.visit(node.value); + } + node.decorators.forEach(d => this.#referencer.visit(d)); + } + visitMethodFunction(node) { + if (node.id) { + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + this.#referencer.scopeManager.nestFunctionExpressionNameScope(node); + } + node.params.forEach(param => { + param.decorators.forEach(d => this.visit(d)); + }); + // Consider this function is in the MethodDefinition. + this.#referencer.scopeManager.nestFunctionScope(node, true); + // Process parameter declarations. + for (const param of node.params) { + this.visitPattern(param, (pattern, info) => { + this.#referencer + .currentScope() + .defineIdentifier(pattern, new definition_1.ParameterDefinition(pattern, node, info.rest)); + this.#referencer.referencingDefaultValue(pattern, info.assignments, null, true); + }, { processRightHandNodes: true }); + this.visitFunctionParameterTypeAnnotation(param); + } + this.visitType(node.returnType); + this.visitType(node.typeParameters); + this.#referencer.visitChildren(node.body); + this.#referencer.close(node); + } + visitPropertyBase(node) { + if (node.computed) { + this.#referencer.visit(node.key); + } + if (node.value) { + if (node.type === types_1.AST_NODE_TYPES.PropertyDefinition || + node.type === types_1.AST_NODE_TYPES.AccessorProperty) { + this.#referencer.scopeManager.nestClassFieldInitializerScope(node.value); + } + this.#referencer.visit(node.value); + if (node.type === types_1.AST_NODE_TYPES.PropertyDefinition || + node.type === types_1.AST_NODE_TYPES.AccessorProperty) { + this.#referencer.close(node.value); + } + } + node.decorators.forEach(d => this.#referencer.visit(d)); + } + visitPropertyDefinition(node) { + this.visitPropertyBase(node); + /** + * class A { + * @meta // <--- check this + * foo: Type; + * } + */ + this.visitType(node.typeAnnotation); + } + visitType(node) { + if (!node) { + return; + } + TypeVisitor_1.TypeVisitor.visit(this.#referencer, node); + } + ///////////////////// + // Visit selectors // + ///////////////////// + AccessorProperty(node) { + this.visitPropertyDefinition(node); + } + ClassBody(node) { + // this is here on purpose so that this visitor explicitly declares visitors + // for all nodes it cares about (see the instance visit method above) + this.visitChildren(node); + } + Identifier(node) { + this.#referencer.visit(node); + } + MethodDefinition(node) { + this.visitMethod(node); + } + PrivateIdentifier() { + // intentionally skip + } + PropertyDefinition(node) { + this.visitPropertyDefinition(node); + } + StaticBlock(node) { + this.#referencer.scopeManager.nestClassStaticBlockScope(node); + node.body.forEach(b => this.visit(b)); + this.#referencer.close(node); + } + TSAbstractAccessorProperty(node) { + this.visitPropertyDefinition(node); + } + TSAbstractMethodDefinition(node) { + this.visitPropertyBase(node); + } + TSAbstractPropertyDefinition(node) { + this.visitPropertyDefinition(node); + } + TSIndexSignature(node) { + this.visitType(node); + } +} +exports.ClassVisitor = ClassVisitor; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65f4ba61060e252efe88b3993dfbe0bba2dcf0fa --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.d.ts @@ -0,0 +1,13 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { Referencer } from './Referencer'; +import { Visitor } from './Visitor'; +export type ExportNode = TSESTree.ExportAllDeclaration | TSESTree.ExportDefaultDeclaration | TSESTree.ExportNamedDeclaration; +export declare class ExportVisitor extends Visitor { + #private; + constructor(node: ExportNode, referencer: Referencer); + static visit(referencer: Referencer, node: ExportNode): void; + protected ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void; + protected ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void; + protected ExportSpecifier(node: TSESTree.ExportSpecifier): void; + protected Identifier(node: TSESTree.Identifier): void; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js new file mode 100644 index 0000000000000000000000000000000000000000..3e089e6bdf43ac09f1552fba6667464759a71382 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ExportVisitor.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExportVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const Visitor_1 = require("./Visitor"); +class ExportVisitor extends Visitor_1.Visitor { + #exportNode; + #referencer; + constructor(node, referencer) { + super(referencer); + this.#exportNode = node; + this.#referencer = referencer; + } + static visit(referencer, node) { + const exportReferencer = new ExportVisitor(node, referencer); + exportReferencer.visit(node); + } + ExportDefaultDeclaration(node) { + if (node.declaration.type === types_1.AST_NODE_TYPES.Identifier) { + // export default A; + // this could be a type or a variable + this.visit(node.declaration); + } + else { + // export const a = 1; + // export something(); + // etc + // these not included in the scope of this visitor as they are all guaranteed to be values or declare variables + } + } + ExportNamedDeclaration(node) { + if (node.source) { + // export ... from 'foo'; + // these are external identifiers so there shouldn't be references or defs + return; + } + if (!node.declaration) { + // export { x }; + this.visitChildren(node); + } + else { + // export const x = 1; + // this is not included in the scope of this visitor as it creates a variable + } + } + ExportSpecifier(node) { + if (node.exportKind === 'type' && + node.local.type === types_1.AST_NODE_TYPES.Identifier) { + // export { type T }; + // type exports can only reference types + // + // we can't let this fall through to the Identifier selector because the exportKind is on this node + // and we don't have access to the `.parent` during scope analysis + this.#referencer.currentScope().referenceType(node.local); + } + else { + this.visit(node.local); + } + } + Identifier(node) { + if (this.#exportNode.exportKind === 'type') { + // export type { T }; + // type exports can only reference types + this.#referencer.currentScope().referenceType(node); + } + else { + this.#referencer.currentScope().referenceDualValueType(node); + } + } +} +exports.ExportVisitor = ExportVisitor; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a21b9dd7c9c9f3ff2638bed57e57be2eb7ab0b2a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.d.ts @@ -0,0 +1,12 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { Referencer } from './Referencer'; +import { Visitor } from './Visitor'; +export declare class ImportVisitor extends Visitor { + #private; + constructor(declaration: TSESTree.ImportDeclaration, referencer: Referencer); + static visit(referencer: Referencer, declaration: TSESTree.ImportDeclaration): void; + protected ImportDefaultSpecifier(node: TSESTree.ImportDefaultSpecifier): void; + protected ImportNamespaceSpecifier(node: TSESTree.ImportNamespaceSpecifier): void; + protected ImportSpecifier(node: TSESTree.ImportSpecifier): void; + protected visitImport(id: TSESTree.Identifier, specifier: TSESTree.ImportDefaultSpecifier | TSESTree.ImportNamespaceSpecifier | TSESTree.ImportSpecifier): void; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js new file mode 100644 index 0000000000000000000000000000000000000000..67a00f367b8967991203e855e0b53692f64d98a0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/ImportVisitor.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImportVisitor = void 0; +const definition_1 = require("../definition"); +const Visitor_1 = require("./Visitor"); +class ImportVisitor extends Visitor_1.Visitor { + #declaration; + #referencer; + constructor(declaration, referencer) { + super(referencer); + this.#declaration = declaration; + this.#referencer = referencer; + } + static visit(referencer, declaration) { + const importReferencer = new ImportVisitor(declaration, referencer); + importReferencer.visit(declaration); + } + ImportDefaultSpecifier(node) { + const local = node.local; + this.visitImport(local, node); + } + ImportNamespaceSpecifier(node) { + const local = node.local; + this.visitImport(local, node); + } + ImportSpecifier(node) { + const local = node.local; + this.visitImport(local, node); + } + visitImport(id, specifier) { + this.#referencer + .currentScope() + .defineIdentifier(id, new definition_1.ImportBindingDefinition(id, specifier, this.#declaration)); + } +} +exports.ImportVisitor = ImportVisitor; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16d1ade30ab9b236f749b1e36c90d474176b8b81 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.d.ts @@ -0,0 +1,27 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { VisitorOptions } from './VisitorBase'; +import { VisitorBase } from './VisitorBase'; +export type PatternVisitorCallback = (pattern: TSESTree.Identifier, info: { + assignments: (TSESTree.AssignmentExpression | TSESTree.AssignmentPattern)[]; + rest: boolean; + topLevel: boolean; +}) => void; +export type PatternVisitorOptions = VisitorOptions; +export declare class PatternVisitor extends VisitorBase { + #private; + readonly rightHandNodes: TSESTree.Node[]; + constructor(options: PatternVisitorOptions, rootPattern: TSESTree.Node, callback: PatternVisitorCallback); + static isPattern(node: TSESTree.Node): node is TSESTree.ArrayPattern | TSESTree.AssignmentPattern | TSESTree.Identifier | TSESTree.ObjectPattern | TSESTree.RestElement | TSESTree.SpreadElement; + protected ArrayExpression(node: TSESTree.ArrayExpression): void; + protected ArrayPattern(pattern: TSESTree.ArrayPattern): void; + protected AssignmentExpression(node: TSESTree.AssignmentExpression): void; + protected AssignmentPattern(pattern: TSESTree.AssignmentPattern): void; + protected CallExpression(node: TSESTree.CallExpression): void; + protected Decorator(): void; + protected Identifier(pattern: TSESTree.Identifier): void; + protected MemberExpression(node: TSESTree.MemberExpression): void; + protected Property(property: TSESTree.Property): void; + protected RestElement(pattern: TSESTree.RestElement): void; + protected SpreadElement(node: TSESTree.SpreadElement): void; + protected TSTypeAnnotation(): void; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js new file mode 100644 index 0000000000000000000000000000000000000000..c7cab64989b7e2fbbc5a23d638cc4a11c9b03597 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/PatternVisitor.js @@ -0,0 +1,94 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PatternVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const VisitorBase_1 = require("./VisitorBase"); +class PatternVisitor extends VisitorBase_1.VisitorBase { + #assignments = []; + #callback; + #restElements = []; + #rootPattern; + rightHandNodes = []; + constructor(options, rootPattern, callback) { + super(options); + this.#rootPattern = rootPattern; + this.#callback = callback; + } + static isPattern(node) { + const nodeType = node.type; + return (nodeType === types_1.AST_NODE_TYPES.Identifier || + nodeType === types_1.AST_NODE_TYPES.ObjectPattern || + nodeType === types_1.AST_NODE_TYPES.ArrayPattern || + nodeType === types_1.AST_NODE_TYPES.SpreadElement || + nodeType === types_1.AST_NODE_TYPES.RestElement || + nodeType === types_1.AST_NODE_TYPES.AssignmentPattern); + } + ArrayExpression(node) { + node.elements.forEach(this.visit, this); + } + ArrayPattern(pattern) { + for (const element of pattern.elements) { + this.visit(element); + } + } + AssignmentExpression(node) { + this.#assignments.push(node); + this.visit(node.left); + this.rightHandNodes.push(node.right); + this.#assignments.pop(); + } + AssignmentPattern(pattern) { + this.#assignments.push(pattern); + this.visit(pattern.left); + this.rightHandNodes.push(pattern.right); + this.#assignments.pop(); + } + CallExpression(node) { + // arguments are right hand nodes. + node.arguments.forEach(a => { + this.rightHandNodes.push(a); + }); + this.visit(node.callee); + } + Decorator() { + // don't visit any decorators when exploring a pattern + } + Identifier(pattern) { + const lastRestElement = this.#restElements.at(-1); + this.#callback(pattern, { + assignments: this.#assignments, + rest: lastRestElement?.argument === pattern, + topLevel: pattern === this.#rootPattern, + }); + } + MemberExpression(node) { + // Computed property's key is a right hand node. + if (node.computed) { + this.rightHandNodes.push(node.property); + } + // the object is only read, write to its property. + this.rightHandNodes.push(node.object); + } + Property(property) { + // Computed property's key is a right hand node. + if (property.computed) { + this.rightHandNodes.push(property.key); + } + // If it's shorthand, its key is same as its value. + // If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern). + // If it's not shorthand, the name of new variable is its value's. + this.visit(property.value); + } + RestElement(pattern) { + this.#restElements.push(pattern); + this.visit(pattern.argument); + this.#restElements.pop(); + } + SpreadElement(node) { + this.visit(node.argument); + } + TSTypeAnnotation() { + // we don't want to visit types + } +} +exports.PatternVisitor = PatternVisitor; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6ffe00d990f90f895e0498e3c55a42363c917e5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.d.ts @@ -0,0 +1,87 @@ +import type { NodeWithParent, TSESTree } from '@typescript-eslint/types'; +import type { Scope } from '../scope'; +import type { Variable } from '../variable'; +export declare enum ReferenceFlag { + Read = 1, + Write = 2, + ReadWrite = 3 +} +export interface ReferenceImplicitGlobal { + node: NodeWithParent; + pattern: TSESTree.BindingName; + ref?: Reference; +} +export declare enum ReferenceTypeFlag { + Value = 1, + Type = 2 +} +/** + * A Reference represents a single occurrence of an identifier in code. + */ +export declare class Reference { + #private; + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + readonly $id: number; + /** + * Reference to the enclosing Scope. + * @public + */ + readonly from: Scope; + /** + * Identifier syntax node. + * @public + */ + readonly identifier: TSESTree.Identifier | TSESTree.JSXIdentifier; + /** + * `true` if this writing reference is a variable initializer or a default value. + * @public + */ + readonly init?: boolean; + readonly maybeImplicitGlobal?: ReferenceImplicitGlobal | null; + /** + * The {@link Variable} object that this reference refers to. If such variable was not defined, this is `null`. + * @public + */ + resolved: Variable | null; + /** + * If reference is writeable, this is the node being written to it. + * @public + */ + readonly writeExpr?: TSESTree.Node | null; + constructor(identifier: TSESTree.Identifier | TSESTree.JSXIdentifier, scope: Scope, flag: ReferenceFlag, writeExpr?: TSESTree.Node | null, maybeImplicitGlobal?: ReferenceImplicitGlobal | null, init?: boolean, referenceType?: ReferenceTypeFlag); + /** + * True if this reference can reference types + */ + get isTypeReference(): boolean; + /** + * True if this reference can reference values + */ + get isValueReference(): boolean; + /** + * Whether the reference is writeable. + * @public + */ + isWrite(): boolean; + /** + * Whether the reference is readable. + * @public + */ + isRead(): boolean; + /** + * Whether the reference is read-only. + * @public + */ + isReadOnly(): boolean; + /** + * Whether the reference is write-only. + * @public + */ + isWriteOnly(): boolean; + /** + * Whether the reference is read-write. + * @public + */ + isReadWrite(): boolean; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js new file mode 100644 index 0000000000000000000000000000000000000000..49ceac7f7ec69c57e88fa67f59acf29ec0d1ac67 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Reference.js @@ -0,0 +1,119 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Reference = exports.ReferenceTypeFlag = exports.ReferenceFlag = void 0; +const ID_1 = require("../ID"); +var ReferenceFlag; +(function (ReferenceFlag) { + ReferenceFlag[ReferenceFlag["Read"] = 1] = "Read"; + ReferenceFlag[ReferenceFlag["Write"] = 2] = "Write"; + ReferenceFlag[ReferenceFlag["ReadWrite"] = 3] = "ReadWrite"; +})(ReferenceFlag || (exports.ReferenceFlag = ReferenceFlag = {})); +const generator = (0, ID_1.createIdGenerator)(); +var ReferenceTypeFlag; +(function (ReferenceTypeFlag) { + ReferenceTypeFlag[ReferenceTypeFlag["Value"] = 1] = "Value"; + ReferenceTypeFlag[ReferenceTypeFlag["Type"] = 2] = "Type"; +})(ReferenceTypeFlag || (exports.ReferenceTypeFlag = ReferenceTypeFlag = {})); +/** + * A Reference represents a single occurrence of an identifier in code. + */ +class Reference { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + $id = generator(); + /** + * The read-write mode of the reference. + */ + #flag; + /** + * Reference to the enclosing Scope. + * @public + */ + from; + /** + * Identifier syntax node. + * @public + */ + identifier; + /** + * `true` if this writing reference is a variable initializer or a default value. + * @public + */ + init; + maybeImplicitGlobal; + /** + * The {@link Variable} object that this reference refers to. If such variable was not defined, this is `null`. + * @public + */ + resolved; + /** + * If reference is writeable, this is the node being written to it. + * @public + */ + writeExpr; + /** + * In some cases, a reference may be a type, value or both a type and value reference. + */ + #referenceType; + constructor(identifier, scope, flag, writeExpr, maybeImplicitGlobal, init, referenceType = ReferenceTypeFlag.Value) { + this.identifier = identifier; + this.from = scope; + this.resolved = null; + this.#flag = flag; + if (this.isWrite()) { + this.writeExpr = writeExpr; + this.init = init; + } + this.maybeImplicitGlobal = maybeImplicitGlobal; + this.#referenceType = referenceType; + } + /** + * True if this reference can reference types + */ + get isTypeReference() { + return (this.#referenceType & ReferenceTypeFlag.Type) !== 0; + } + /** + * True if this reference can reference values + */ + get isValueReference() { + return (this.#referenceType & ReferenceTypeFlag.Value) !== 0; + } + /** + * Whether the reference is writeable. + * @public + */ + isWrite() { + return !!(this.#flag & ReferenceFlag.Write); + } + /** + * Whether the reference is readable. + * @public + */ + isRead() { + return !!(this.#flag & ReferenceFlag.Read); + } + /** + * Whether the reference is read-only. + * @public + */ + isReadOnly() { + return this.#flag === ReferenceFlag.Read; + } + /** + * Whether the reference is write-only. + * @public + */ + isWriteOnly() { + return this.#flag === ReferenceFlag.Write; + } + /** + * Whether the reference is read-write. + * @public + */ + isReadWrite() { + return this.#flag === ReferenceFlag.ReadWrite; + } +} +exports.Reference = Reference; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b212f867213841aa8346f54db8d58f99b727de41 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.d.ts @@ -0,0 +1,91 @@ +import type { Lib, TSESTree } from '@typescript-eslint/types'; +import type { Scope } from '../scope'; +import type { ScopeManager } from '../ScopeManager'; +import type { ReferenceImplicitGlobal } from './Reference'; +import type { VisitorOptions } from './Visitor'; +import { Visitor } from './Visitor'; +export interface ReferencerOptions extends VisitorOptions { + jsxFragmentName: string | null; + jsxPragma: string | null; + lib: Lib[]; +} +export declare class Referencer extends Visitor { + #private; + readonly scopeManager: ScopeManager; + constructor(options: ReferencerOptions, scopeManager: ScopeManager); + private populateGlobalsFromLib; + /** + * Resolves lib names into a deduplicated set of LibDefinitions, + * including all transitive dependencies. + */ + private resolveLibDefinitions; + close(node: TSESTree.Node): void; + currentScope(): Scope; + currentScope(throwOnNull: true): Scope | null; + referencingDefaultValue(pattern: TSESTree.Identifier, assignments: (TSESTree.AssignmentExpression | TSESTree.AssignmentPattern)[], maybeImplicitGlobal: ReferenceImplicitGlobal | null, init: boolean): void; + /** + * Searches for a variable named "name" in the upper scopes and adds a pseudo-reference from itself to itself + */ + private referenceInSomeUpperScope; + private referenceJsxFragment; + private referenceJsxPragma; + protected visitClass(node: TSESTree.ClassDeclaration | TSESTree.ClassExpression): void; + protected visitForIn(node: TSESTree.ForInStatement | TSESTree.ForOfStatement): void; + protected visitFunction(node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.TSDeclareFunction | TSESTree.TSEmptyBodyFunctionExpression): void; + protected visitFunctionParameterTypeAnnotation(node: TSESTree.Parameter): void; + protected visitJSXElement(node: TSESTree.JSXClosingElement | TSESTree.JSXOpeningElement): void; + protected visitProperty(node: TSESTree.Property): void; + protected visitType(node: TSESTree.Node | null | undefined): void; + protected visitTypeAssertion(node: TSESTree.TSAsExpression | TSESTree.TSSatisfiesExpression | TSESTree.TSTypeAssertion): void; + protected ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; + protected AssignmentExpression(node: TSESTree.AssignmentExpression): void; + protected BlockStatement(node: TSESTree.BlockStatement): void; + protected BreakStatement(): void; + protected CallExpression(node: TSESTree.CallExpression): void; + protected CatchClause(node: TSESTree.CatchClause): void; + protected ClassDeclaration(node: TSESTree.ClassDeclaration): void; + protected ClassExpression(node: TSESTree.ClassExpression): void; + protected ContinueStatement(): void; + protected ExportAllDeclaration(): void; + protected ExportDefaultDeclaration(node: TSESTree.ExportDefaultDeclaration): void; + protected ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void; + protected ForInStatement(node: TSESTree.ForInStatement): void; + protected ForOfStatement(node: TSESTree.ForOfStatement): void; + protected ForStatement(node: TSESTree.ForStatement): void; + protected FunctionDeclaration(node: TSESTree.FunctionDeclaration): void; + protected FunctionExpression(node: TSESTree.FunctionExpression): void; + protected Identifier(node: TSESTree.Identifier): void; + protected ImportAttribute(): void; + protected ImportDeclaration(node: TSESTree.ImportDeclaration): void; + protected JSXAttribute(node: TSESTree.JSXAttribute): void; + protected JSXClosingElement(node: TSESTree.JSXClosingElement): void; + protected JSXFragment(node: TSESTree.JSXFragment): void; + protected JSXIdentifier(node: TSESTree.JSXIdentifier): void; + protected JSXMemberExpression(node: TSESTree.JSXMemberExpression): void; + protected JSXOpeningElement(node: TSESTree.JSXOpeningElement): void; + protected LabeledStatement(node: TSESTree.LabeledStatement): void; + protected MemberExpression(node: TSESTree.MemberExpression): void; + protected MetaProperty(): void; + protected NewExpression(node: TSESTree.NewExpression): void; + protected PrivateIdentifier(): void; + protected Program(node: TSESTree.Program): void; + protected Property(node: TSESTree.Property): void; + protected SwitchStatement(node: TSESTree.SwitchStatement): void; + protected TaggedTemplateExpression(node: TSESTree.TaggedTemplateExpression): void; + protected TSAsExpression(node: TSESTree.TSAsExpression): void; + protected TSDeclareFunction(node: TSESTree.TSDeclareFunction): void; + protected TSEmptyBodyFunctionExpression(node: TSESTree.TSEmptyBodyFunctionExpression): void; + protected TSEnumDeclaration(node: TSESTree.TSEnumDeclaration): void; + protected TSExportAssignment(node: TSESTree.TSExportAssignment): void; + protected TSImportEqualsDeclaration(node: TSESTree.TSImportEqualsDeclaration): void; + protected TSInstantiationExpression(node: TSESTree.TSInstantiationExpression): void; + protected TSInterfaceDeclaration(node: TSESTree.TSInterfaceDeclaration): void; + protected TSModuleDeclaration(node: TSESTree.TSModuleDeclaration): void; + protected TSSatisfiesExpression(node: TSESTree.TSSatisfiesExpression): void; + protected TSTypeAliasDeclaration(node: TSESTree.TSTypeAliasDeclaration): void; + protected TSTypeAssertion(node: TSESTree.TSTypeAssertion): void; + protected UpdateExpression(node: TSESTree.UpdateExpression): void; + protected VariableDeclaration(node: TSESTree.VariableDeclaration): void; + protected WithStatement(node: TSESTree.WithStatement): void; + private visitExpressionTarget; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js new file mode 100644 index 0000000000000000000000000000000000000000..441413ce4c1650f94fff5321fdd8c282f9756092 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Referencer.js @@ -0,0 +1,558 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Referencer = void 0; +const types_1 = require("@typescript-eslint/types"); +const assert_1 = require("../assert"); +const definition_1 = require("../definition"); +const lib_1 = require("../lib"); +const ClassVisitor_1 = require("./ClassVisitor"); +const ExportVisitor_1 = require("./ExportVisitor"); +const ImportVisitor_1 = require("./ImportVisitor"); +const PatternVisitor_1 = require("./PatternVisitor"); +const Reference_1 = require("./Reference"); +const TypeVisitor_1 = require("./TypeVisitor"); +const Visitor_1 = require("./Visitor"); +// Referencing variables and creating bindings. +class Referencer extends Visitor_1.Visitor { + #hasReferencedJsxFactory = false; + #hasReferencedJsxFragmentFactory = false; + #jsxFragmentName; + #jsxPragma; + #lib; + scopeManager; + constructor(options, scopeManager) { + super(options); + this.scopeManager = scopeManager; + this.#jsxPragma = options.jsxPragma; + this.#jsxFragmentName = options.jsxFragmentName; + this.#lib = options.lib; + } + populateGlobalsFromLib(globalScope) { + const libs = this.resolveLibDefinitions(); + for (const lib of libs) { + for (const [name, variable] of lib.variables) { + globalScope.defineImplicitVariable(name, variable); + } + } + // Special implicit global for const assertions (`{} as const`, `{}`) + globalScope.defineImplicitVariable('const', { + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + }); + } + /** + * Resolves lib names into a deduplicated set of LibDefinitions, + * including all transitive dependencies. + */ + resolveLibDefinitions() { + const resolvedLibs = new Set(); + // Resolve the top-level lib names into LibDefinition objects + for (const lib of this.#lib) { + const definition = lib_1.lib.get(lib); + if (!definition) { + throw new Error(`Invalid value for lib provided: ${lib}`); + } + resolvedLibs.add(definition); + } + // Expand transitive lib dependencies. + // New entries added to the Set during iteration will be visited exactly once. + for (const lib of resolvedLibs) { + for (const dependency of lib.libs) { + resolvedLibs.add(dependency); + } + } + return resolvedLibs; + } + close(node) { + while (this.currentScope(true) && node === this.currentScope().block) { + this.scopeManager.currentScope = this.currentScope().close(this.scopeManager); + } + } + currentScope(dontThrowOnNull) { + if (!dontThrowOnNull) { + (0, assert_1.assert)(this.scopeManager.currentScope, 'Expected currentScope to exist. This usually happens when analyze() is called with an incomplete AST node instead of a complete Program node.'); + } + return this.scopeManager.currentScope; + } + referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) { + assignments.forEach(assignment => { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, assignment.right, maybeImplicitGlobal, init); + }); + } + /** + * Searches for a variable named "name" in the upper scopes and adds a pseudo-reference from itself to itself + */ + referenceInSomeUpperScope(name) { + let scope = this.scopeManager.currentScope; + while (scope) { + const variable = scope.set.get(name); + if (!variable) { + scope = scope.upper; + continue; + } + scope.referenceValue(variable.identifiers[0]); + return true; + } + return false; + } + referenceJsxFragment() { + if (this.#jsxFragmentName == null || + this.#hasReferencedJsxFragmentFactory) { + return; + } + this.#hasReferencedJsxFragmentFactory = this.referenceInSomeUpperScope(this.#jsxFragmentName); + } + referenceJsxPragma() { + if (this.#jsxPragma == null || this.#hasReferencedJsxFactory) { + return; + } + this.#hasReferencedJsxFactory = this.referenceInSomeUpperScope(this.#jsxPragma); + } + /////////////////// + // Visit helpers // + /////////////////// + visitClass(node) { + ClassVisitor_1.ClassVisitor.visit(this, node); + } + visitForIn(node) { + if (node.left.type === types_1.AST_NODE_TYPES.VariableDeclaration && + node.left.kind !== 'var') { + this.scopeManager.nestForScope(node); + } + if (node.left.type === types_1.AST_NODE_TYPES.VariableDeclaration) { + this.visit(node.left); + this.visitPattern(node.left.declarations[0].id, pattern => { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, node.right, null, true); + }); + } + else { + this.visitPattern(node.left, (pattern, info) => { + const maybeImplicitGlobal = !this.currentScope().isStrict + ? { + node, + pattern, + } + : null; + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, node.right, maybeImplicitGlobal, false); + }, { processRightHandNodes: true }); + } + this.visit(node.right); + this.visit(node.body); + this.close(node); + } + visitFunction(node) { + // FunctionDeclaration name is defined in upper scope + // NOTE: Not referring variableScope. It is intended. + // Since + // in ES5, FunctionDeclaration should be in FunctionBody. + // in ES6, FunctionDeclaration should be block scoped. + if (node.type === types_1.AST_NODE_TYPES.FunctionExpression) { + if (node.id) { + // FunctionExpression with name creates its special scope; + // FunctionExpressionNameScope. + this.scopeManager.nestFunctionExpressionNameScope(node); + } + } + else if (node.id) { + // id is defined in upper scope + this.currentScope().defineIdentifier(node.id, new definition_1.FunctionNameDefinition(node.id, node)); + } + // Consider this function is in the MethodDefinition. + this.scopeManager.nestFunctionScope(node, false); + // Process parameter declarations. + for (const param of node.params) { + this.visitPattern(param, (pattern, info) => { + this.currentScope().defineIdentifier(pattern, new definition_1.ParameterDefinition(pattern, node, info.rest)); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }, { processRightHandNodes: true }); + this.visitFunctionParameterTypeAnnotation(param); + param.decorators.forEach(d => this.visit(d)); + } + this.visitType(node.returnType); + this.visitType(node.typeParameters); + // In TypeScript there are a number of function-like constructs which have no body, + // so check it exists before traversing + if (node.body) { + // Skip BlockStatement to prevent creating BlockStatement scope. + if (node.body.type === types_1.AST_NODE_TYPES.BlockStatement) { + this.visitChildren(node.body); + } + else { + this.visit(node.body); + } + } + this.close(node); + } + visitFunctionParameterTypeAnnotation(node) { + switch (node.type) { + case types_1.AST_NODE_TYPES.AssignmentPattern: + this.visitType(node.left.typeAnnotation); + break; + case types_1.AST_NODE_TYPES.TSParameterProperty: + this.visitFunctionParameterTypeAnnotation(node.parameter); + break; + default: + this.visitType(node.typeAnnotation); + break; + } + } + visitJSXElement(node) { + if (node.name.type === types_1.AST_NODE_TYPES.JSXIdentifier) { + if (node.name.name[0].toUpperCase() === node.name.name[0] || + node.name.name === 'this') { + // lower cased component names are always treated as "intrinsic" names, and are converted to a string, + // not a variable by JSX transforms: + //
=> React.createElement("div", null) + // the only case we want to visit a lower-cased component has its name as "this", + this.visit(node.name); + } + } + else { + this.visit(node.name); + } + } + visitProperty(node) { + if (node.computed) { + this.visit(node.key); + } + this.visit(node.value); + } + visitType(node) { + if (!node) { + return; + } + TypeVisitor_1.TypeVisitor.visit(this, node); + } + visitTypeAssertion(node) { + this.visit(node.expression); + this.visitType(node.typeAnnotation); + } + ///////////////////// + // Visit selectors // + ///////////////////// + ArrowFunctionExpression(node) { + this.visitFunction(node); + } + AssignmentExpression(node) { + const left = this.visitExpressionTarget(node.left); + if (PatternVisitor_1.PatternVisitor.isPattern(left)) { + if (node.operator === '=') { + this.visitPattern(left, (pattern, info) => { + const maybeImplicitGlobal = !this.currentScope().isStrict + ? { + node, + pattern, + } + : null; + this.referencingDefaultValue(pattern, info.assignments, maybeImplicitGlobal, false); + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, node.right, maybeImplicitGlobal, false); + }, { processRightHandNodes: true }); + } + else if (left.type === types_1.AST_NODE_TYPES.Identifier) { + this.currentScope().referenceValue(left, Reference_1.ReferenceFlag.ReadWrite, node.right); + } + } + else { + this.visit(left); + } + this.visit(node.right); + } + BlockStatement(node) { + this.scopeManager.nestBlockScope(node); + this.visitChildren(node); + this.close(node); + } + BreakStatement() { + // don't reference the break statement's label + } + CallExpression(node) { + this.visitChildren(node, ['typeArguments']); + this.visitType(node.typeArguments); + } + CatchClause(node) { + this.scopeManager.nestCatchScope(node); + if (node.param) { + this.visitPattern(node.param, (pattern, info) => { + this.currentScope().defineIdentifier(pattern, new definition_1.CatchClauseDefinition(pattern, node)); + this.referencingDefaultValue(pattern, info.assignments, null, true); + }, { processRightHandNodes: true }); + } + this.visit(node.body); + this.close(node); + } + ClassDeclaration(node) { + this.visitClass(node); + } + ClassExpression(node) { + this.visitClass(node); + } + ContinueStatement() { + // don't reference the continue statement's label + } + ExportAllDeclaration() { + // this defines no local variables + } + ExportDefaultDeclaration(node) { + if (node.declaration.type === types_1.AST_NODE_TYPES.Identifier) { + ExportVisitor_1.ExportVisitor.visit(this, node); + } + else { + this.visit(node.declaration); + } + } + ExportNamedDeclaration(node) { + if (node.declaration) { + this.visit(node.declaration); + } + else { + ExportVisitor_1.ExportVisitor.visit(this, node); + } + } + ForInStatement(node) { + this.visitForIn(node); + } + ForOfStatement(node) { + this.visitForIn(node); + } + ForStatement(node) { + // Create ForStatement declaration. + // NOTE: In ES6, ForStatement dynamically generates per iteration environment. However, this is + // a static analyzer, we only generate one scope for ForStatement. + if (node.init?.type === types_1.AST_NODE_TYPES.VariableDeclaration && + node.init.kind !== 'var') { + this.scopeManager.nestForScope(node); + } + this.visitChildren(node); + this.close(node); + } + FunctionDeclaration(node) { + this.visitFunction(node); + } + FunctionExpression(node) { + this.visitFunction(node); + } + Identifier(node) { + this.currentScope().referenceValue(node); + this.visitType(node.typeAnnotation); + } + ImportAttribute() { + // import assertions are module metadata and thus have no variables to reference + } + ImportDeclaration(node) { + (0, assert_1.assert)(this.scopeManager.isModule(), 'ImportDeclaration should appear when the mode is ES6 and in the module context.'); + ImportVisitor_1.ImportVisitor.visit(this, node); + } + JSXAttribute(node) { + this.visit(node.value); + } + JSXClosingElement(node) { + this.visitJSXElement(node); + } + JSXFragment(node) { + this.referenceJsxPragma(); + this.referenceJsxFragment(); + this.visitChildren(node); + } + JSXIdentifier(node) { + this.currentScope().referenceValue(node); + } + JSXMemberExpression(node) { + if (node.object.type !== types_1.AST_NODE_TYPES.JSXIdentifier || + node.object.name !== 'this') { + this.visit(node.object); + } + // we don't ever reference the property as it's always going to be a property on the thing + } + JSXOpeningElement(node) { + this.referenceJsxPragma(); + this.visitJSXElement(node); + this.visitType(node.typeArguments); + for (const attr of node.attributes) { + this.visit(attr); + } + } + LabeledStatement(node) { + this.visit(node.body); + } + MemberExpression(node) { + this.visit(node.object); + if (node.computed) { + this.visit(node.property); + } + } + MetaProperty() { + // meta properties all builtin globals + } + NewExpression(node) { + this.visitChildren(node, ['typeArguments']); + this.visitType(node.typeArguments); + } + PrivateIdentifier() { + // private identifiers are members on classes and thus have no variables to reference + } + Program(node) { + const globalScope = this.scopeManager.nestGlobalScope(node); + this.populateGlobalsFromLib(globalScope); + if (this.scopeManager.isGlobalReturn()) { + // Force strictness of GlobalScope to false when using node.js scope. + this.currentScope().isStrict = false; + this.scopeManager.nestFunctionScope(node, false); + } + if (this.scopeManager.isModule()) { + this.scopeManager.nestModuleScope(node); + } + if (this.scopeManager.isImpliedStrict()) { + this.currentScope().isStrict = true; + } + this.visitChildren(node); + this.close(node); + } + Property(node) { + this.visitProperty(node); + } + SwitchStatement(node) { + this.visit(node.discriminant); + this.scopeManager.nestSwitchScope(node); + for (const switchCase of node.cases) { + this.visit(switchCase); + } + this.close(node); + } + TaggedTemplateExpression(node) { + this.visit(node.tag); + this.visit(node.quasi); + this.visitType(node.typeArguments); + } + TSAsExpression(node) { + this.visitTypeAssertion(node); + } + TSDeclareFunction(node) { + this.visitFunction(node); + } + TSEmptyBodyFunctionExpression(node) { + this.visitFunction(node); + } + TSEnumDeclaration(node) { + this.currentScope().defineIdentifier(node.id, new definition_1.TSEnumNameDefinition(node.id, node)); + // enum members can be referenced within the enum body + this.scopeManager.nestTSEnumScope(node); + for (const member of node.body.members) { + // TS resolves literal named members to be actual names + // enum Foo { + // 'a' = 1, + // b = a, // this references the 'a' member + // } + if (member.id.type === types_1.AST_NODE_TYPES.Literal && + typeof member.id.value === 'string') { + const name = member.id; + this.currentScope().defineLiteralIdentifier(name, new definition_1.TSEnumMemberDefinition(name, member)); + } + else if (member.id.type === types_1.AST_NODE_TYPES.Identifier) { + this.currentScope().defineIdentifier(member.id, new definition_1.TSEnumMemberDefinition(member.id, member)); + } + this.visit(member.initializer); + } + this.close(node); + } + TSExportAssignment(node) { + if (node.expression.type === types_1.AST_NODE_TYPES.Identifier) { + // this is a special case - you can `export = T` where `T` is a type OR a + // value however `T[U]` is illegal when `T` is a type and `T.U` is illegal + // when `T.U` is a type + // i.e. if the expression is JUST an Identifier - it could be either ref + // kind; otherwise the standard rules apply + this.currentScope().referenceDualValueType(node.expression); + } + else { + this.visit(node.expression); + } + } + TSImportEqualsDeclaration(node) { + this.currentScope().defineIdentifier(node.id, new definition_1.ImportBindingDefinition(node.id, node, node)); + if (node.moduleReference.type === types_1.AST_NODE_TYPES.TSQualifiedName) { + let moduleIdentifier = node.moduleReference.left; + while (moduleIdentifier.type === types_1.AST_NODE_TYPES.TSQualifiedName) { + moduleIdentifier = moduleIdentifier.left; + } + this.visit(moduleIdentifier); + } + else { + this.visit(node.moduleReference); + } + } + TSInstantiationExpression(node) { + this.visitChildren(node, ['typeArguments']); + this.visitType(node.typeArguments); + } + TSInterfaceDeclaration(node) { + this.visitType(node); + } + TSModuleDeclaration(node) { + if (node.id.type === types_1.AST_NODE_TYPES.Identifier && node.kind !== 'global') { + this.currentScope().defineIdentifier(node.id, new definition_1.TSModuleNameDefinition(node.id, node)); + } + this.scopeManager.nestTSModuleScope(node); + this.visit(node.body); + this.close(node); + } + TSSatisfiesExpression(node) { + this.visitTypeAssertion(node); + } + TSTypeAliasDeclaration(node) { + this.visitType(node); + } + TSTypeAssertion(node) { + this.visitTypeAssertion(node); + } + UpdateExpression(node) { + const argument = this.visitExpressionTarget(node.argument); + if (PatternVisitor_1.PatternVisitor.isPattern(argument)) { + this.visitPattern(argument, pattern => { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.ReadWrite, null); + }); + } + else { + this.visitChildren(node); + } + } + VariableDeclaration(node) { + const variableTargetScope = node.kind === 'var' + ? this.currentScope().variableScope + : this.currentScope(); + for (const decl of node.declarations) { + const init = decl.init; + this.visitPattern(decl.id, (pattern, info) => { + variableTargetScope.defineIdentifier(pattern, new definition_1.VariableDefinition(pattern, decl, node)); + this.referencingDefaultValue(pattern, info.assignments, null, true); + if (init) { + this.currentScope().referenceValue(pattern, Reference_1.ReferenceFlag.Write, init, null, true); + } + }, { processRightHandNodes: true }); + this.visit(decl.init); + this.visitType(decl.id.typeAnnotation); + } + } + WithStatement(node) { + this.visit(node.object); + // Then nest scope for WithStatement. + this.scopeManager.nestWithScope(node); + this.visit(node.body); + this.close(node); + } + visitExpressionTarget(left) { + switch (left.type) { + case types_1.AST_NODE_TYPES.TSAsExpression: + case types_1.AST_NODE_TYPES.TSTypeAssertion: + // explicitly visit the type annotation + this.visitType(left.typeAnnotation); + // intentional fallthrough + case types_1.AST_NODE_TYPES.TSNonNullExpression: + // unwrap the expression + left = left.expression; + } + return left; + } +} +exports.Referencer = Referencer; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d79623bd28d0573bb1affed06584e06c7e288a12 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.d.ts @@ -0,0 +1,31 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { Referencer } from './Referencer'; +import { Visitor } from './Visitor'; +export declare class TypeVisitor extends Visitor { + #private; + constructor(referencer: Referencer); + static visit(referencer: Referencer, node: TSESTree.Node): void; + protected visitFunctionType(node: TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSFunctionType | TSESTree.TSMethodSignature): void; + protected visitPropertyKey(node: TSESTree.TSMethodSignature | TSESTree.TSPropertySignature): void; + protected Identifier(node: TSESTree.Identifier): void; + protected MemberExpression(node: TSESTree.MemberExpression): void; + protected TSCallSignatureDeclaration(node: TSESTree.TSCallSignatureDeclaration): void; + protected TSConditionalType(node: TSESTree.TSConditionalType): void; + protected TSConstructorType(node: TSESTree.TSConstructorType): void; + protected TSConstructSignatureDeclaration(node: TSESTree.TSConstructSignatureDeclaration): void; + protected TSFunctionType(node: TSESTree.TSFunctionType): void; + protected TSImportType(node: TSESTree.TSImportType): void; + protected TSIndexSignature(node: TSESTree.TSIndexSignature): void; + protected TSInferType(node: TSESTree.TSInferType): void; + protected TSInterfaceDeclaration(node: TSESTree.TSInterfaceDeclaration): void; + protected TSMappedType(node: TSESTree.TSMappedType): void; + protected TSMethodSignature(node: TSESTree.TSMethodSignature): void; + protected TSNamedTupleMember(node: TSESTree.TSNamedTupleMember): void; + protected TSPropertySignature(node: TSESTree.TSPropertySignature): void; + protected TSQualifiedName(node: TSESTree.TSQualifiedName): void; + protected TSTypeAliasDeclaration(node: TSESTree.TSTypeAliasDeclaration): void; + protected TSTypeParameter(node: TSESTree.TSTypeParameter): void; + protected TSTypePredicate(node: TSESTree.TSTypePredicate): void; + protected TSTypeAnnotation(node: TSESTree.TSTypeAnnotation): void; + protected TSTypeQuery(node: TSESTree.TSTypeQuery): void; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js new file mode 100644 index 0000000000000000000000000000000000000000..2509a4a93807a5face59521585bdff6b52c09c17 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/TypeVisitor.js @@ -0,0 +1,221 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeVisitor = void 0; +const types_1 = require("@typescript-eslint/types"); +const definition_1 = require("../definition"); +const scope_1 = require("../scope"); +const Visitor_1 = require("./Visitor"); +class TypeVisitor extends Visitor_1.Visitor { + #referencer; + constructor(referencer) { + super(referencer); + this.#referencer = referencer; + } + static visit(referencer, node) { + const typeReferencer = new TypeVisitor(referencer); + typeReferencer.visit(node); + } + /////////////////// + // Visit helpers // + /////////////////// + visitFunctionType(node) { + // arguments and type parameters can only be referenced from within the function + this.#referencer.scopeManager.nestFunctionTypeScope(node); + this.visit(node.typeParameters); + for (const param of node.params) { + let didVisitAnnotation = false; + this.visitPattern(param, (pattern, info) => { + // a parameter name creates a value type variable which can be referenced later via typeof arg + this.#referencer + .currentScope() + .defineIdentifier(pattern, new definition_1.ParameterDefinition(pattern, node, info.rest)); + if (pattern.typeAnnotation) { + this.visit(pattern.typeAnnotation); + didVisitAnnotation = true; + } + }); + // there are a few special cases where the type annotation is owned by the parameter, not the pattern + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!didVisitAnnotation && 'typeAnnotation' in param) { + this.visit(param.typeAnnotation); + } + } + this.visit(node.returnType); + this.#referencer.close(node); + } + visitPropertyKey(node) { + if (!node.computed) { + return; + } + // computed members are treated as value references, and TS expects they have a literal type + this.#referencer.visit(node.key); + } + ///////////////////// + // Visit selectors // + ///////////////////// + Identifier(node) { + this.#referencer.currentScope().referenceType(node); + } + MemberExpression(node) { + this.visit(node.object); + // don't visit the property + } + TSCallSignatureDeclaration(node) { + this.visitFunctionType(node); + } + TSConditionalType(node) { + // conditional types can define inferred type parameters + // which are only accessible from inside the conditional parameter + this.#referencer.scopeManager.nestConditionalTypeScope(node); + // type parameters inferred in the condition clause are not accessible within the false branch + this.visitChildren(node, ['falseType']); + this.#referencer.close(node); + this.visit(node.falseType); + } + TSConstructorType(node) { + this.visitFunctionType(node); + } + TSConstructSignatureDeclaration(node) { + this.visitFunctionType(node); + } + TSFunctionType(node) { + this.visitFunctionType(node); + } + TSImportType(node) { + // the TS parser allows any type to be the parameter, but it's a syntax error - so we can ignore it + this.visit(node.typeArguments); + // the qualifier is just part of a standard EntityName, so it should not be visited + } + TSIndexSignature(node) { + for (const param of node.parameters) { + if (param.type === types_1.AST_NODE_TYPES.Identifier) { + this.visit(param.typeAnnotation); + } + } + this.visit(node.typeAnnotation); + } + TSInferType(node) { + const typeParameter = node.typeParameter; + let scope = this.#referencer.currentScope(); + /* + In cases where there is a sub-type scope created within a conditional type, then the generic should be defined in the + conditional type's scope, not the child type scope. + If we define it within the child type's scope then it won't be able to be referenced outside the child type + */ + if (scope.type === scope_1.ScopeType.functionType || + scope.type === scope_1.ScopeType.mappedType) { + // search up the scope tree to figure out if we're in a nested type scope + let currentScope = scope.upper; + while (currentScope) { + if (currentScope.type === scope_1.ScopeType.functionType || + currentScope.type === scope_1.ScopeType.mappedType) { + // ensure valid type parents only + currentScope = currentScope.upper; + continue; + } + if (currentScope.type === scope_1.ScopeType.conditionalType) { + scope = currentScope; + break; + } + break; + } + } + scope.defineIdentifier(typeParameter.name, new definition_1.TypeDefinition(typeParameter.name, typeParameter)); + this.visit(typeParameter.constraint); + } + TSInterfaceDeclaration(node) { + this.#referencer + .currentScope() + .defineIdentifier(node.id, new definition_1.TypeDefinition(node.id, node)); + if (node.typeParameters) { + // type parameters cannot be referenced from outside their current scope + this.#referencer.scopeManager.nestTypeScope(node); + this.visit(node.typeParameters); + } + node.extends.forEach(this.visit, this); + this.visit(node.body); + if (node.typeParameters) { + this.#referencer.close(node); + } + } + TSMappedType(node) { + // mapped types key can only be referenced within their return value + this.#referencer.scopeManager.nestMappedTypeScope(node); + this.#referencer + .currentScope() + .defineIdentifier(node.key, new definition_1.TypeDefinition(node.key, node)); + this.visit(node.constraint); + this.visit(node.nameType); + this.visit(node.typeAnnotation); + this.#referencer.close(node); + } + TSMethodSignature(node) { + this.visitPropertyKey(node); + this.visitFunctionType(node); + } + TSNamedTupleMember(node) { + this.visit(node.elementType); + // we don't visit the label as the label only exists for the purposes of documentation + } + TSPropertySignature(node) { + this.visitPropertyKey(node); + this.visit(node.typeAnnotation); + } + TSQualifiedName(node) { + this.visit(node.left); + // we don't visit the right as it a name on the thing, not a name to reference + } + TSTypeAliasDeclaration(node) { + this.#referencer + .currentScope() + .defineIdentifier(node.id, new definition_1.TypeDefinition(node.id, node)); + if (node.typeParameters) { + // type parameters cannot be referenced from outside their current scope + this.#referencer.scopeManager.nestTypeScope(node); + this.visit(node.typeParameters); + } + this.visit(node.typeAnnotation); + if (node.typeParameters) { + this.#referencer.close(node); + } + } + TSTypeParameter(node) { + this.#referencer + .currentScope() + .defineIdentifier(node.name, new definition_1.TypeDefinition(node.name, node)); + this.visit(node.constraint); + this.visit(node.default); + } + TSTypePredicate(node) { + if (node.parameterName.type !== types_1.AST_NODE_TYPES.TSThisType) { + this.#referencer.currentScope().referenceValue(node.parameterName); + } + this.visit(node.typeAnnotation); + } + // a type query `typeof foo` is a special case that references a _non-type_ variable, + TSTypeAnnotation(node) { + // check + this.visitChildren(node); + } + TSTypeQuery(node) { + let entityName; + if (node.exprName.type === types_1.AST_NODE_TYPES.TSQualifiedName) { + let iter = node.exprName; + while (iter.left.type === types_1.AST_NODE_TYPES.TSQualifiedName) { + iter = iter.left; + } + entityName = iter.left; + } + else { + entityName = node.exprName; + if (node.exprName.type === types_1.AST_NODE_TYPES.TSImportType) { + this.visit(node.exprName); + } + } + if (entityName.type === types_1.AST_NODE_TYPES.Identifier) { + this.#referencer.currentScope().referenceValue(entityName); + } + this.visit(node.typeArguments); + } +} +exports.TypeVisitor = TypeVisitor; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..677709dc4d9dcf698ca4d843d31c89951730a828 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.d.ts @@ -0,0 +1,13 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { PatternVisitorCallback, PatternVisitorOptions } from './PatternVisitor'; +import type { VisitorOptions } from './VisitorBase'; +import { VisitorBase } from './VisitorBase'; +interface VisitPatternOptions extends PatternVisitorOptions { + processRightHandNodes?: boolean; +} +export declare class Visitor extends VisitorBase { + #private; + constructor(optionsOrVisitor: Visitor | VisitorOptions); + protected visitPattern(node: TSESTree.Node, callback: PatternVisitorCallback, options?: VisitPatternOptions): void; +} +export { VisitorBase, type VisitorOptions } from './VisitorBase'; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js new file mode 100644 index 0000000000000000000000000000000000000000..9752defa103ef62f94280ab0ec7b298f335f0d11 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/Visitor.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VisitorBase = exports.Visitor = void 0; +const PatternVisitor_1 = require("./PatternVisitor"); +const VisitorBase_1 = require("./VisitorBase"); +class Visitor extends VisitorBase_1.VisitorBase { + #options; + constructor(optionsOrVisitor) { + super(optionsOrVisitor instanceof Visitor + ? optionsOrVisitor.#options + : optionsOrVisitor); + this.#options = + optionsOrVisitor instanceof Visitor + ? optionsOrVisitor.#options + : optionsOrVisitor; + } + visitPattern(node, callback, options = { processRightHandNodes: false }) { + // Call the callback at left hand identifier nodes, and Collect right hand nodes. + const visitor = new PatternVisitor_1.PatternVisitor(this.#options, node, callback); + visitor.visit(node); + // Process the right hand nodes recursively. + if (options.processRightHandNodes) { + visitor.rightHandNodes.forEach(this.visit, this); + } + } +} +exports.Visitor = Visitor; +var VisitorBase_2 = require("./VisitorBase"); +Object.defineProperty(exports, "VisitorBase", { enumerable: true, get: function () { return VisitorBase_2.VisitorBase; } }); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1be51f450c1162081cac682d420708b3b4c42291 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.d.ts @@ -0,0 +1,21 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { VisitorKeys } from '@typescript-eslint/visitor-keys'; +export interface VisitorOptions { + childVisitorKeys?: VisitorKeys | null; + visitChildrenEvenIfSelectorExists?: boolean; +} +export declare abstract class VisitorBase { + #private; + constructor(options: VisitorOptions); + /** + * Default method for visiting children. + * @param node the node whose children should be visited + * @param excludeArr a list of keys to not visit + */ + visitChildren(node: T | null | undefined, excludeArr?: (keyof T)[]): void; + /** + * Dispatching node. + */ + visit(node: TSESTree.Node | null | undefined): void; +} +export type { VisitorKeys } from '@typescript-eslint/visitor-keys'; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js new file mode 100644 index 0000000000000000000000000000000000000000..b7725653b4a706c11d784b90c6eca60050476977 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/VisitorBase.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VisitorBase = void 0; +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +function isObject(obj) { + return typeof obj === 'object' && obj != null; +} +function isNode(node) { + return isObject(node) && typeof node.type === 'string'; +} +class VisitorBase { + #childVisitorKeys; + #visitChildrenEvenIfSelectorExists; + constructor(options) { + this.#childVisitorKeys = options.childVisitorKeys ?? visitor_keys_1.visitorKeys; + this.#visitChildrenEvenIfSelectorExists = + options.visitChildrenEvenIfSelectorExists ?? false; + } + /** + * Default method for visiting children. + * @param node the node whose children should be visited + * @param excludeArr a list of keys to not visit + */ + visitChildren(node, excludeArr = []) { + if (node?.type == null) { + return; + } + const exclude = new Set([...excludeArr, 'parent']); + const children = this.#childVisitorKeys[node.type] ?? Object.keys(node); + for (const key of children) { + if (exclude.has(key)) { + continue; + } + const child = node[key]; + if (!child) { + continue; + } + if (Array.isArray(child)) { + for (const subChild of child) { + if (isNode(subChild)) { + this.visit(subChild); + } + } + } + else if (isNode(child)) { + this.visit(child); + } + } + } + /** + * Dispatching node. + */ + visit(node) { + if (node?.type == null) { + return; + } + const visitor = this[node.type]; + if (visitor) { + visitor.call(this, node); + if (!this.#visitChildrenEvenIfSelectorExists) { + return; + } + } + this.visitChildren(node); + } +} +exports.VisitorBase = VisitorBase; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6dca338bb85c28de4b0da8f7fa5d47b6485ff75a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.d.ts @@ -0,0 +1 @@ +export { Referencer, type ReferencerOptions } from './Referencer'; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0f94d64e777d04a03fb0d400564a49e0ac51dacd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/referencer/index.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Referencer = void 0; +var Referencer_1 = require("./Referencer"); +Object.defineProperty(exports, "Referencer", { enumerable: true, get: function () { return Referencer_1.Referencer; } }); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..017cbf8fb7869c8b5c003c399b9f858cca16c895 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class BlockScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: BlockScope['upper'], block: BlockScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js new file mode 100644 index 0000000000000000000000000000000000000000..9ead61150f43b4b0cea3b75b25ff3c8808d16600 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/BlockScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BlockScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class BlockScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.block, upperScope, block, false); + } +} +exports.BlockScope = BlockScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fb65835d49949d031d9825406f52ce8c66e886e6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class CatchScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: CatchScope['upper'], block: CatchScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js new file mode 100644 index 0000000000000000000000000000000000000000..613ffb9b82fcce3f940dd4999b64862cdeb08c0a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/CatchScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CatchScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class CatchScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.catch, upperScope, block, false); + } +} +exports.CatchScope = CatchScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bbf7258e4652b6865148408e1971de14eb894cac --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class ClassFieldInitializerScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: ClassFieldInitializerScope['upper'], block: ClassFieldInitializerScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.js new file mode 100644 index 0000000000000000000000000000000000000000..c469374347e9ca9ac33130a10d101da4099094d7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassFieldInitializerScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassFieldInitializerScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ClassFieldInitializerScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.classFieldInitializer, upperScope, block, false); + } +} +exports.ClassFieldInitializerScope = ClassFieldInitializerScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..48ae5921cd3366509f2274f28d4f6d25e01f331d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class ClassScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: ClassScope['upper'], block: ClassScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js new file mode 100644 index 0000000000000000000000000000000000000000..187c9732c07ea90284de03bfe567a6b74be46911 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ClassScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.class, upperScope, block, false); + } +} +exports.ClassScope = ClassScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..be7a95a1f9c0c35848d3072ab6374d09c661d4e9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class ClassStaticBlockScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: ClassStaticBlockScope['upper'], block: ClassStaticBlockScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.js new file mode 100644 index 0000000000000000000000000000000000000000..77d700ec1b7c34c24b7fa9db20d8e19feeb39819 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ClassStaticBlockScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ClassStaticBlockScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ClassStaticBlockScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.classStaticBlock, upperScope, block, false); + } +} +exports.ClassStaticBlockScope = ClassStaticBlockScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b7aacd59b69c9fdff5432821fc9182dd027bf88a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class ConditionalTypeScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: ConditionalTypeScope['upper'], block: ConditionalTypeScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js new file mode 100644 index 0000000000000000000000000000000000000000..e1d7e5f16efc16ea020de70f878220e945f6bbae --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ConditionalTypeScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConditionalTypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ConditionalTypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.conditionalType, upperScope, block, false); + } +} +exports.ConditionalTypeScope = ConditionalTypeScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9ca1491512cb88527e88d64dbacaaa6c6f54acf6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class ForScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: ForScope['upper'], block: ForScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js new file mode 100644 index 0000000000000000000000000000000000000000..dc3d7d551ab969970f98e7400390300734fc9601 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ForScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ForScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ForScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.for, upperScope, block, false); + } +} +exports.ForScope = ForScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..720da5e1d1177221733ecab18bb1492519a69950 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.d.ts @@ -0,0 +1,9 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class FunctionExpressionNameScope extends ScopeBase { + readonly functionExpressionScope: true; + constructor(scopeManager: ScopeManager, upperScope: FunctionExpressionNameScope['upper'], block: FunctionExpressionNameScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js new file mode 100644 index 0000000000000000000000000000000000000000..3afd1bd65b0ce605dedc1007b910a8976eecfde1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionExpressionNameScope.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionExpressionNameScope = void 0; +const definition_1 = require("../definition"); +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class FunctionExpressionNameScope extends ScopeBase_1.ScopeBase { + functionExpressionScope; + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.functionExpressionName, upperScope, block, false); + if (block.id) { + this.defineIdentifier(block.id, new definition_1.FunctionNameDefinition(block.id, block)); + } + this.functionExpressionScope = true; + } +} +exports.FunctionExpressionNameScope = FunctionExpressionNameScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bc248841a0bbd3b4a8b6991eefc968d772801251 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.d.ts @@ -0,0 +1,11 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { Reference } from '../referencer/Reference'; +import type { ScopeManager } from '../ScopeManager'; +import type { Variable } from '../variable'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class FunctionScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: FunctionScope['upper'], block: FunctionScope['block'], isMethodDefinition: boolean); + protected isValidResolution(ref: Reference, variable: Variable): boolean; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js new file mode 100644 index 0000000000000000000000000000000000000000..f5eb4d90f48e71fa147b0ca31194313beb4c8a12 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionScope.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionScope = void 0; +const types_1 = require("@typescript-eslint/types"); +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class FunctionScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block, isMethodDefinition) { + super(scopeManager, ScopeType_1.ScopeType.function, upperScope, block, isMethodDefinition); + // section 9.2.13, FunctionDeclarationInstantiation. + // NOTE Arrow functions never have an arguments objects. + if (this.block.type !== types_1.AST_NODE_TYPES.ArrowFunctionExpression) { + this.defineVariable('arguments', this.set, this.variables, null, null); + } + } + // References in default parameters isn't resolved to variables which are in their function body. + // const x = 1 + // function f(a = x) { // This `x` is resolved to the `x` in the outer scope. + // const x = 2 + // console.log(a) + // } + isValidResolution(ref, variable) { + // If `options.globalReturn` is true, `this.block` becomes a Program node. + if (this.block.type === types_1.AST_NODE_TYPES.Program) { + return true; + } + const bodyStart = this.block.body?.range[0] ?? -1; + // It's invalid resolution in the following case: + return !((variable.scope === this && + ref.identifier.range[0] < bodyStart && // the reference is in the parameter part. + variable.defs.every(d => d.name.range[0] >= bodyStart)) // the variable is in the body. + ); + } +} +exports.FunctionScope = FunctionScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..92792902b449aa815add0b3775ac719a7fcf354e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class FunctionTypeScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: FunctionTypeScope['upper'], block: FunctionTypeScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js new file mode 100644 index 0000000000000000000000000000000000000000..9b3e5bf367021c8f20bc3b69a23fddbcf7ef315e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/FunctionTypeScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FunctionTypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class FunctionTypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.functionType, upperScope, block, false); + } +} +exports.FunctionTypeScope = FunctionTypeScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8c3baeba28357a2550b72254762a6041c2879d2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.d.ts @@ -0,0 +1,17 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { ImplicitLibVariableOptions } from '../variable'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class GlobalScope extends ScopeBase { + private readonly implicit; + constructor(scopeManager: ScopeManager, block: GlobalScope['block']); + addVariables(names: string[]): void; + close(scopeManager: ScopeManager): Scope | null; + defineImplicitVariable(name: string, options: ImplicitLibVariableOptions): void; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js new file mode 100644 index 0000000000000000000000000000000000000000..04643e2c7f7fea937b225f0918b10046012823ff --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/GlobalScope.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GlobalScope = void 0; +const types_1 = require("@typescript-eslint/types"); +const assert_1 = require("../assert"); +const ImplicitGlobalVariableDefinition_1 = require("../definition/ImplicitGlobalVariableDefinition"); +const variable_1 = require("../variable"); +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class GlobalScope extends ScopeBase_1.ScopeBase { + // note this is accessed in used in the legacy eslint-scope tests, so it can't be true private + implicit; + constructor(scopeManager, block) { + super(scopeManager, ScopeType_1.ScopeType.global, null, block, false); + this.implicit = { + leftToBeResolved: [], + set: new Map(), + variables: [], + }; + } + addVariables(names) { + for (const name of names) { + this.defineVariable(name, this.set, this.variables, null, null); + this.implicit.set.delete(name); + } + const nameSet = new Set(names); + for (const reference of this.through) { + if (nameSet.has(reference.identifier.name)) { + const variable = this.set.get(reference.identifier.name); + (0, assert_1.assert)(variable, `Expected variable with name "${reference.identifier.name}" to be specified.`); + reference.resolved = variable; + variable.references.push(reference); + } + } + this.through = this.through.filter(reference => !nameSet.has(reference.identifier.name)); + this.implicit.variables = this.implicit.variables.filter(variable => !nameSet.has(variable.name)); + this.implicit.leftToBeResolved = this.implicit.leftToBeResolved.filter(reference => !nameSet.has(reference.identifier.name)); + } + close(scopeManager) { + (0, assert_1.assert)(this.leftToResolve); + for (const ref of this.leftToResolve) { + if (ref.maybeImplicitGlobal && !this.set.has(ref.identifier.name)) { + // create an implicit global variable from assignment expression + const info = ref.maybeImplicitGlobal; + const node = info.pattern; + if (node.type === types_1.AST_NODE_TYPES.Identifier) { + this.defineVariable(node.name, this.implicit.set, this.implicit.variables, node, new ImplicitGlobalVariableDefinition_1.ImplicitGlobalVariableDefinition(info.pattern, info.node)); + } + } + } + this.implicit.leftToBeResolved = this.leftToResolve; + super.close(scopeManager); + this.implicit.leftToBeResolved = [...this.through]; + return null; + } + defineImplicitVariable(name, options) { + this.defineVariable(new variable_1.ImplicitLibVariable(this, name, options), this.set, this.variables, null, null); + } +} +exports.GlobalScope = GlobalScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f89bc6a615ca75cbab5781a002a480397066e25 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class MappedTypeScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: MappedTypeScope['upper'], block: MappedTypeScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js new file mode 100644 index 0000000000000000000000000000000000000000..bbe7bd2c8276891428fe8832b653f5272f5b8d3e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/MappedTypeScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MappedTypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class MappedTypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.mappedType, upperScope, block, false); + } +} +exports.MappedTypeScope = MappedTypeScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..96cc6343fdaf879c9f01f3106386ecbcc0b4fd2b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class ModuleScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: ModuleScope['upper'], block: ModuleScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js new file mode 100644 index 0000000000000000000000000000000000000000..3180a5694c264b8cb90a3465dfa7450895095280 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ModuleScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ModuleScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class ModuleScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.module, upperScope, block, false); + } +} +exports.ModuleScope = ModuleScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8ee2e6bdb28cfbcc8217f7fa44e28939e6f1deeb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.d.ts @@ -0,0 +1,19 @@ +import type { BlockScope } from './BlockScope'; +import type { CatchScope } from './CatchScope'; +import type { ClassFieldInitializerScope } from './ClassFieldInitializerScope'; +import type { ClassScope } from './ClassScope'; +import type { ClassStaticBlockScope } from './ClassStaticBlockScope'; +import type { ConditionalTypeScope } from './ConditionalTypeScope'; +import type { ForScope } from './ForScope'; +import type { FunctionExpressionNameScope } from './FunctionExpressionNameScope'; +import type { FunctionScope } from './FunctionScope'; +import type { FunctionTypeScope } from './FunctionTypeScope'; +import type { GlobalScope } from './GlobalScope'; +import type { MappedTypeScope } from './MappedTypeScope'; +import type { ModuleScope } from './ModuleScope'; +import type { SwitchScope } from './SwitchScope'; +import type { TSEnumScope } from './TSEnumScope'; +import type { TSModuleScope } from './TSModuleScope'; +import type { TypeScope } from './TypeScope'; +import type { WithScope } from './WithScope'; +export type Scope = BlockScope | CatchScope | ClassFieldInitializerScope | ClassScope | ClassStaticBlockScope | ConditionalTypeScope | ForScope | FunctionExpressionNameScope | FunctionScope | FunctionTypeScope | GlobalScope | MappedTypeScope | ModuleScope | SwitchScope | TSEnumScope | TSModuleScope | TypeScope | WithScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/Scope.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..df902b7daec9113f6f032b7fc75de9154c6ce501 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.d.ts @@ -0,0 +1,96 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { Definition } from '../definition'; +import type { ReferenceImplicitGlobal } from '../referencer/Reference'; +import type { ScopeManager } from '../ScopeManager'; +import type { FunctionScope } from './FunctionScope'; +import type { GlobalScope } from './GlobalScope'; +import type { ModuleScope } from './ModuleScope'; +import type { Scope } from './Scope'; +import type { TSModuleScope } from './TSModuleScope'; +import { Reference, ReferenceFlag } from '../referencer/Reference'; +import { Variable } from '../variable'; +import { ScopeType } from './ScopeType'; +type VariableScope = FunctionScope | GlobalScope | ModuleScope | TSModuleScope; +export declare abstract class ScopeBase { + #private; + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + readonly $id: number; + /** + * The AST node which created this scope. + * @public + */ + readonly block: Block; + /** + * The array of child scopes. This does not include grandchild scopes. + * @public + */ + readonly childScopes: Scope[]; + /** + * Whether this scope is created by a FunctionExpression. + * @public + */ + readonly functionExpressionScope: boolean; + /** + * Whether 'use strict' is in effect in this scope. + * @public + */ + isStrict: boolean; + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + */ + protected leftToResolve: Reference[] | null; + /** + * Any variable {@link Reference} found in this scope. + * This includes occurrences of local variables as well as variables from parent scopes (including the global scope). + * For local variables this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the formal parameter in the parameter list. + * @public + */ + readonly references: Reference[]; + /** + * The map from variable names to variable objects. + * @public + */ + readonly set: Map; + /** + * The {@link Reference}s that are not resolved with this scope. + * @public + */ + through: Reference[]; + readonly type: Type; + /** + * Reference to the parent {@link Scope}. + * @public + */ + readonly upper: Upper; + /** + * The scoped {@link Variable}s of this scope. + * In the case of a 'function' scope this includes the automatic argument `arguments` as its first element, as well + * as all further formal arguments. + * This does not include variables which are defined in child scopes. + * @public + */ + readonly variables: Variable[]; + readonly variableScope: VariableScope; + constructor(scopeManager: ScopeManager, type: Type, upperScope: Upper, block: Block, isMethodDefinition: boolean); + private isVariableScope; + close(_scopeManager: ScopeManager): Scope | null; + shouldStaticallyClose(): boolean; + /** + * To override by function scopes. + * References in default parameters isn't resolved to variables which are in their function body. + */ + protected defineVariable(nameOrVariable: string | Variable, set: Map, variables: Variable[], node: TSESTree.Identifier | null, def: Definition | null): void; + protected delegateToUpperScope(ref: Reference): void; + protected isValidResolution(_ref: Reference, _variable: Variable): boolean; + private addDeclaredVariablesOfNode; + defineIdentifier(node: TSESTree.Identifier, def: Definition): void; + defineLiteralIdentifier(node: TSESTree.StringLiteral, def: Definition): void; + referenceDualValueType(node: TSESTree.Identifier): void; + referenceType(node: TSESTree.Identifier): void; + referenceValue(node: TSESTree.Identifier | TSESTree.JSXIdentifier, assign?: ReferenceFlag, writeExpr?: TSESTree.Expression | null, maybeImplicitGlobal?: ReferenceImplicitGlobal | null, init?: boolean): void; +} +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js new file mode 100644 index 0000000000000000000000000000000000000000..450a6778840628341a475fa8286eb22d8caf4227 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeBase.js @@ -0,0 +1,308 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeBase = void 0; +const types_1 = require("@typescript-eslint/types"); +const assert_1 = require("../assert"); +const ID_1 = require("../ID"); +const Reference_1 = require("../referencer/Reference"); +const variable_1 = require("../variable"); +const ScopeType_1 = require("./ScopeType"); +/** + * Test if scope is strict + */ +function isStrictScope(scope, block, isMethodDefinition) { + let body; + // When upper scope is exists and strict, inner scope is also strict. + if (scope.upper?.isStrict) { + return true; + } + if (isMethodDefinition) { + return true; + } + if (scope.type === ScopeType_1.ScopeType.class || + scope.type === ScopeType_1.ScopeType.conditionalType || + scope.type === ScopeType_1.ScopeType.functionType || + scope.type === ScopeType_1.ScopeType.mappedType || + scope.type === ScopeType_1.ScopeType.module || + scope.type === ScopeType_1.ScopeType.tsEnum || + scope.type === ScopeType_1.ScopeType.tsModule || + scope.type === ScopeType_1.ScopeType.type) { + return true; + } + if (scope.type === ScopeType_1.ScopeType.block || scope.type === ScopeType_1.ScopeType.switch) { + return false; + } + if (scope.type === ScopeType_1.ScopeType.function) { + const functionBody = block; + switch (functionBody.type) { + case types_1.AST_NODE_TYPES.ArrowFunctionExpression: + if (functionBody.body.type !== types_1.AST_NODE_TYPES.BlockStatement) { + return false; + } + body = functionBody.body; + break; + case types_1.AST_NODE_TYPES.Program: + body = functionBody; + break; + default: + body = functionBody.body; + } + if (!body) { + return false; + } + } + else if (scope.type === ScopeType_1.ScopeType.global) { + body = block; + } + else { + return false; + } + // Search 'use strict' directive. + for (const stmt of body.body) { + if (stmt.type !== types_1.AST_NODE_TYPES.ExpressionStatement || + stmt.directive == null) { + break; + } + if (stmt.directive === 'use strict') { + return true; + } + } + return false; +} +function registerScope(scopeManager, scope) { + scopeManager.scopes.push(scope); + const scopes = scopeManager.nodeToScope.get(scope.block); + if (scopes) { + scopes.push(scope); + } + else { + scopeManager.nodeToScope.set(scope.block, [scope]); + } +} +const generator = (0, ID_1.createIdGenerator)(); +const VARIABLE_SCOPE_TYPES = new Set([ + ScopeType_1.ScopeType.classFieldInitializer, + ScopeType_1.ScopeType.classStaticBlock, + ScopeType_1.ScopeType.function, + ScopeType_1.ScopeType.global, + ScopeType_1.ScopeType.module, + ScopeType_1.ScopeType.tsModule, +]); +class ScopeBase { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + $id = generator(); + /** + * The AST node which created this scope. + * @public + */ + block; + /** + * The array of child scopes. This does not include grandchild scopes. + * @public + */ + childScopes = []; + /** + * A map of the variables for each node in this scope. + * This is map is a pointer to the one in the parent ScopeManager instance + */ + #declaredVariables; + /** + * Generally, through the lexical scoping of JS you can always know which variable an identifier in the source code + * refers to. There are a few exceptions to this rule. With `global` and `with` scopes you can only decide at runtime + * which variable a reference refers to. + * All those scopes are considered "dynamic". + */ + #dynamic; + /** + * Whether this scope is created by a FunctionExpression. + * @public + */ + functionExpressionScope = false; + /** + * Whether 'use strict' is in effect in this scope. + * @public + */ + isStrict; + /** + * List of {@link Reference}s that are left to be resolved (i.e. which + * need to be linked to the variable they refer to). + */ + leftToResolve = []; + /** + * Any variable {@link Reference} found in this scope. + * This includes occurrences of local variables as well as variables from parent scopes (including the global scope). + * For local variables this also includes defining occurrences (like in a 'var' statement). + * In a 'function' scope this does not include the occurrences of the formal parameter in the parameter list. + * @public + */ + references = []; + /** + * The map from variable names to variable objects. + * @public + */ + set = new Map(); + /** + * The {@link Reference}s that are not resolved with this scope. + * @public + */ + through = []; + type; + /** + * Reference to the parent {@link Scope}. + * @public + */ + upper; + /** + * The scoped {@link Variable}s of this scope. + * In the case of a 'function' scope this includes the automatic argument `arguments` as its first element, as well + * as all further formal arguments. + * This does not include variables which are defined in child scopes. + * @public + */ + variables = []; + /** + * For scopes that can contain variable declarations, this is a self-reference. + * For other scope types this is the *variableScope* value of the parent scope. + * @public + */ + #dynamicCloseRef = (ref) => { + // notify all names are through to global + let current = this; + do { + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + current.through.push(ref); + current = current.upper; + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + } while (current); + }; + #staticCloseRef = (ref) => { + const resolve = () => { + const name = ref.identifier.name; + const variable = this.set.get(name); + if (!variable) { + return false; + } + if (!this.isValidResolution(ref, variable)) { + return false; + } + // make sure we don't match a type reference to a value variable + const isValidTypeReference = ref.isTypeReference && variable.isTypeVariable; + const isValidValueReference = ref.isValueReference && variable.isValueVariable; + if (!isValidTypeReference && !isValidValueReference) { + return false; + } + variable.references.push(ref); + ref.resolved = variable; + return true; + }; + if (!resolve()) { + this.delegateToUpperScope(ref); + } + }; + variableScope; + constructor(scopeManager, type, upperScope, block, isMethodDefinition) { + const upperScopeAsScopeBase = upperScope; + this.type = type; + this.#dynamic = + this.type === ScopeType_1.ScopeType.global || this.type === ScopeType_1.ScopeType.with; + this.block = block; + this.variableScope = this.isVariableScope() + ? this + : // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + upperScopeAsScopeBase.variableScope; + this.upper = upperScope; + /** + * Whether 'use strict' is in effect in this scope. + * @member {boolean} Scope#isStrict + */ + this.isStrict = isStrictScope(this, block, isMethodDefinition); + // this is guaranteed to be correct at runtime + upperScopeAsScopeBase?.childScopes.push(this); + this.#declaredVariables = scopeManager.declaredVariables; + registerScope(scopeManager, this); + } + isVariableScope() { + return VARIABLE_SCOPE_TYPES.has(this.type); + } + close(_scopeManager) { + const closeRef = this.shouldStaticallyClose() + ? this.#staticCloseRef + : this.#dynamicCloseRef; + // Try Resolving all references in this scope. + (0, assert_1.assert)(this.leftToResolve); + this.leftToResolve.forEach(ref => closeRef(ref)); + this.leftToResolve = null; + return this.upper; + } + shouldStaticallyClose() { + return !this.#dynamic || this.type === 'global'; + } + /** + * To override by function scopes. + * References in default parameters isn't resolved to variables which are in their function body. + */ + defineVariable(nameOrVariable, set, variables, node, def) { + const name = typeof nameOrVariable === 'string' ? nameOrVariable : nameOrVariable.name; + let variable = set.get(name); + if (!variable) { + variable = + typeof nameOrVariable === 'string' + ? new variable_1.Variable(name, this) + : nameOrVariable; + set.set(name, variable); + variables.push(variable); + } + if (def) { + variable.defs.push(def); + this.addDeclaredVariablesOfNode(variable, def.node); + this.addDeclaredVariablesOfNode(variable, def.parent); + } + if (node) { + variable.identifiers.push(node); + } + } + delegateToUpperScope(ref) { + this.upper?.leftToResolve?.push(ref); + this.through.push(ref); + } + isValidResolution(_ref, _variable) { + return true; + } + addDeclaredVariablesOfNode(variable, node) { + if (node == null) { + return; + } + let variables = this.#declaredVariables.get(node); + if (variables == null) { + variables = []; + this.#declaredVariables.set(node, variables); + } + if (!variables.includes(variable)) { + variables.push(variable); + } + } + defineIdentifier(node, def) { + this.defineVariable(node.name, this.set, this.variables, node, def); + } + defineLiteralIdentifier(node, def) { + this.defineVariable(node.value, this.set, this.variables, null, def); + } + referenceDualValueType(node) { + const ref = new Reference_1.Reference(node, this, Reference_1.ReferenceFlag.Read, null, null, false, Reference_1.ReferenceTypeFlag.Type | Reference_1.ReferenceTypeFlag.Value); + this.references.push(ref); + this.leftToResolve?.push(ref); + } + referenceType(node) { + const ref = new Reference_1.Reference(node, this, Reference_1.ReferenceFlag.Read, null, null, false, Reference_1.ReferenceTypeFlag.Type); + this.references.push(ref); + this.leftToResolve?.push(ref); + } + referenceValue(node, assign = Reference_1.ReferenceFlag.Read, writeExpr, maybeImplicitGlobal, init = false) { + const ref = new Reference_1.Reference(node, this, assign, writeExpr, maybeImplicitGlobal, init, Reference_1.ReferenceTypeFlag.Value); + this.references.push(ref); + this.leftToResolve?.push(ref); + } +} +exports.ScopeBase = ScopeBase; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..120762d1e1d09ff3de339c63e4c1e03f13e6452a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.d.ts @@ -0,0 +1,20 @@ +export declare enum ScopeType { + block = "block", + catch = "catch", + class = "class", + classFieldInitializer = "class-field-initializer", + classStaticBlock = "class-static-block", + conditionalType = "conditionalType", + for = "for", + function = "function", + functionExpressionName = "function-expression-name", + functionType = "functionType", + global = "global", + mappedType = "mappedType", + module = "module", + switch = "switch", + tsEnum = "tsEnum", + tsModule = "tsModule", + type = "type", + with = "with" +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js new file mode 100644 index 0000000000000000000000000000000000000000..a02797385c838cfa2a67e7d8ba4535f939ccd2d8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/ScopeType.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScopeType = void 0; +var ScopeType; +(function (ScopeType) { + ScopeType["block"] = "block"; + ScopeType["catch"] = "catch"; + ScopeType["class"] = "class"; + ScopeType["classFieldInitializer"] = "class-field-initializer"; + ScopeType["classStaticBlock"] = "class-static-block"; + ScopeType["conditionalType"] = "conditionalType"; + ScopeType["for"] = "for"; + ScopeType["function"] = "function"; + ScopeType["functionExpressionName"] = "function-expression-name"; + ScopeType["functionType"] = "functionType"; + ScopeType["global"] = "global"; + ScopeType["mappedType"] = "mappedType"; + ScopeType["module"] = "module"; + ScopeType["switch"] = "switch"; + ScopeType["tsEnum"] = "tsEnum"; + ScopeType["tsModule"] = "tsModule"; + ScopeType["type"] = "type"; + ScopeType["with"] = "with"; +})(ScopeType || (exports.ScopeType = ScopeType = {})); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..21fa9a9636ef04bd0de4696f228224896e769d21 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class SwitchScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: SwitchScope['upper'], block: SwitchScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js new file mode 100644 index 0000000000000000000000000000000000000000..c894a033627145d79832ea26bcfcb5a902c19ff6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/SwitchScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SwitchScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class SwitchScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.switch, upperScope, block, false); + } +} +exports.SwitchScope = SwitchScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3ebed7db1347dce946f8a26641521d5ae49c286 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class TSEnumScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: TSEnumScope['upper'], block: TSEnumScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js new file mode 100644 index 0000000000000000000000000000000000000000..417bdde92c05ed36f7e8a263ec3ff14e7c0ec0a1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSEnumScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSEnumScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class TSEnumScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.tsEnum, upperScope, block, false); + } +} +exports.TSEnumScope = TSEnumScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..42ad536017c1ab7f14e2a92e34b12a91e40f765b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class TSModuleScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: TSModuleScope['upper'], block: TSModuleScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js new file mode 100644 index 0000000000000000000000000000000000000000..04d97746453ed70caf51e835c5ca0775462aba73 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TSModuleScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSModuleScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class TSModuleScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.tsModule, upperScope, block, false); + } +} +exports.TSModuleScope = TSModuleScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..117d17e2b087867c6ea749316d602e9a3bde3da0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.d.ts @@ -0,0 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class TypeScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: TypeScope['upper'], block: TypeScope['block']); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js new file mode 100644 index 0000000000000000000000000000000000000000..c62ad968327db1b50b8de0260cebfb9058d0fda8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/TypeScope.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TypeScope = void 0; +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class TypeScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.type, upperScope, block, false); + } +} +exports.TypeScope = TypeScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1e73eb2ed15435437e004021dd6ad6e95fe92b57 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.d.ts @@ -0,0 +1,9 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; +export declare class WithScope extends ScopeBase { + constructor(scopeManager: ScopeManager, upperScope: WithScope['upper'], block: WithScope['block']); + close(scopeManager: ScopeManager): Scope | null; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js new file mode 100644 index 0000000000000000000000000000000000000000..9ec3a47cb212312c2c0f418a7e4b19bc5e8ff937 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/WithScope.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WithScope = void 0; +const assert_1 = require("../assert"); +const ScopeBase_1 = require("./ScopeBase"); +const ScopeType_1 = require("./ScopeType"); +class WithScope extends ScopeBase_1.ScopeBase { + constructor(scopeManager, upperScope, block) { + super(scopeManager, ScopeType_1.ScopeType.with, upperScope, block, false); + } + close(scopeManager) { + if (this.shouldStaticallyClose()) { + return super.close(scopeManager); + } + (0, assert_1.assert)(this.leftToResolve); + this.leftToResolve.forEach(ref => this.delegateToUpperScope(ref)); + this.leftToResolve = null; + return this.upper; + } +} +exports.WithScope = WithScope; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c94cc2982e1f2baebf886f6df1b90b86ab0215db --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/index.d.ts @@ -0,0 +1,19 @@ +export * from './BlockScope'; +export * from './CatchScope'; +export * from './ClassFieldInitializerScope'; +export * from './ClassScope'; +export * from './ConditionalTypeScope'; +export * from './ForScope'; +export * from './FunctionExpressionNameScope'; +export * from './FunctionScope'; +export * from './FunctionTypeScope'; +export * from './GlobalScope'; +export * from './MappedTypeScope'; +export * from './ModuleScope'; +export * from './Scope'; +export * from './ScopeType'; +export * from './SwitchScope'; +export * from './TSEnumScope'; +export * from './TSModuleScope'; +export * from './TypeScope'; +export * from './WithScope'; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d2e73d8327b9466467feaf013cfe1f58a5de5e95 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/scope/index.js @@ -0,0 +1,35 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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 }); +__exportStar(require("./BlockScope"), exports); +__exportStar(require("./CatchScope"), exports); +__exportStar(require("./ClassFieldInitializerScope"), exports); +__exportStar(require("./ClassScope"), exports); +__exportStar(require("./ConditionalTypeScope"), exports); +__exportStar(require("./ForScope"), exports); +__exportStar(require("./FunctionExpressionNameScope"), exports); +__exportStar(require("./FunctionScope"), exports); +__exportStar(require("./FunctionTypeScope"), exports); +__exportStar(require("./GlobalScope"), exports); +__exportStar(require("./MappedTypeScope"), exports); +__exportStar(require("./ModuleScope"), exports); +__exportStar(require("./Scope"), exports); +__exportStar(require("./ScopeType"), exports); +__exportStar(require("./SwitchScope"), exports); +__exportStar(require("./TSEnumScope"), exports); +__exportStar(require("./TSModuleScope"), exports); +__exportStar(require("./TypeScope"), exports); +__exportStar(require("./WithScope"), exports); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2ba81ca6f39dc0aa602e227d8e665a7106b8e1be --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.d.ts @@ -0,0 +1,32 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import { VariableBase } from './VariableBase'; +/** + * ESLint defines global variables using the eslint-scope Variable class + * This is declared here for consumers to use + */ +export declare class ESLintScopeVariable extends VariableBase { + /** + * Written to by ESLint. + * If this key exists, this variable is a global variable added by ESLint. + * If this is `true`, this variable can be assigned arbitrary values. + * If this is `false`, this variable is readonly. + */ + writeable?: boolean; + /** + * Written to by ESLint. + * This property is undefined if there are no globals comment directives. + * The array of globals comment directives which defined this global variable in the source code file. + */ + eslintExplicitGlobal?: boolean; + /** + * Written to by ESLint. + * The configured value in config files. This can be different from `variable.writeable` if there are globals comment directives. + */ + eslintImplicitGlobalSetting?: 'readonly' | 'writable'; + /** + * Written to by ESLint. + * If this key exists, it is a global variable added by ESLint. + * If `true`, this global variable was defined by a globals comment directive in the source code file. + */ + eslintExplicitGlobalComments?: TSESTree.Comment[]; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js new file mode 100644 index 0000000000000000000000000000000000000000..4450dad2b3749dd87f3254eaf89e2d3127931998 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ESLintScopeVariable.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ESLintScopeVariable = void 0; +const VariableBase_1 = require("./VariableBase"); +/** + * ESLint defines global variables using the eslint-scope Variable class + * This is declared here for consumers to use + */ +class ESLintScopeVariable extends VariableBase_1.VariableBase { + /** + * Written to by ESLint. + * If this key exists, this variable is a global variable added by ESLint. + * If this is `true`, this variable can be assigned arbitrary values. + * If this is `false`, this variable is readonly. + */ + writeable; // note that this isn't a typo - ESlint uses this spelling here + /** + * Written to by ESLint. + * This property is undefined if there are no globals comment directives. + * The array of globals comment directives which defined this global variable in the source code file. + */ + eslintExplicitGlobal; + /** + * Written to by ESLint. + * The configured value in config files. This can be different from `variable.writeable` if there are globals comment directives. + */ + eslintImplicitGlobalSetting; + /** + * Written to by ESLint. + * If this key exists, it is a global variable added by ESLint. + * If `true`, this global variable was defined by a globals comment directive in the source code file. + */ + eslintExplicitGlobalComments; +} +exports.ESLintScopeVariable = ESLintScopeVariable; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6c967519e4bf1ce20c0fc5dd60e5bde2e3ae9ef2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.d.ts @@ -0,0 +1,27 @@ +import type { Scope } from '../scope'; +import type { Variable } from './Variable'; +import { ESLintScopeVariable } from './ESLintScopeVariable'; +export interface ImplicitLibVariableOptions { + readonly eslintImplicitGlobalSetting?: ESLintScopeVariable['eslintImplicitGlobalSetting']; + readonly isTypeVariable?: boolean; + readonly isValueVariable?: boolean; + readonly writeable?: boolean; +} +export interface LibDefinition { + libs: readonly LibDefinition[]; + variables: readonly [string, ImplicitLibVariableOptions][]; +} +/** + * An variable implicitly defined by the TS Lib + */ +export declare class ImplicitLibVariable extends ESLintScopeVariable implements Variable { + /** + * `true` if the variable is valid in a type context, false otherwise + */ + readonly isTypeVariable: boolean; + /** + * `true` if the variable is valid in a value context, false otherwise + */ + readonly isValueVariable: boolean; + constructor(scope: Scope, name: string, { eslintImplicitGlobalSetting, isTypeVariable, isValueVariable, writeable, }: ImplicitLibVariableOptions); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js new file mode 100644 index 0000000000000000000000000000000000000000..b896c1e49e3eb26b6665c78a18e0a59dee938a95 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/ImplicitLibVariable.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ImplicitLibVariable = void 0; +const ESLintScopeVariable_1 = require("./ESLintScopeVariable"); +/** + * An variable implicitly defined by the TS Lib + */ +class ImplicitLibVariable extends ESLintScopeVariable_1.ESLintScopeVariable { + /** + * `true` if the variable is valid in a type context, false otherwise + */ + isTypeVariable; + /** + * `true` if the variable is valid in a value context, false otherwise + */ + isValueVariable; + constructor(scope, name, { eslintImplicitGlobalSetting, isTypeVariable, isValueVariable, writeable, }) { + super(name, scope); + this.isTypeVariable = isTypeVariable ?? false; + this.isValueVariable = isValueVariable ?? false; + this.writeable = writeable ?? false; + this.eslintImplicitGlobalSetting = + eslintImplicitGlobalSetting ?? 'readonly'; + } +} +exports.ImplicitLibVariable = ImplicitLibVariable; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d75ebd292de79bb8f5abea8ebd97435f91efeab4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.d.ts @@ -0,0 +1,16 @@ +import { VariableBase } from './VariableBase'; +/** + * A Variable represents a locally scoped identifier. These include arguments to functions. + */ +export declare class Variable extends VariableBase { + /** + * `true` if the variable is valid in a type context, false otherwise + * @public + */ + get isTypeVariable(): boolean; + /** + * `true` if the variable is valid in a value context, false otherwise + * @public + */ + get isValueVariable(): boolean; +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js new file mode 100644 index 0000000000000000000000000000000000000000..3623de9c21b2ec918a22b76e74e063afc68bfaeb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/Variable.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Variable = void 0; +const VariableBase_1 = require("./VariableBase"); +/** + * A Variable represents a locally scoped identifier. These include arguments to functions. + */ +class Variable extends VariableBase_1.VariableBase { + /** + * `true` if the variable is valid in a type context, false otherwise + * @public + */ + get isTypeVariable() { + if (this.defs.length === 0) { + // we don't statically know whether this is a type or a value + return true; + } + return this.defs.some(def => def.isTypeDefinition); + } + /** + * `true` if the variable is valid in a value context, false otherwise + * @public + */ + get isValueVariable() { + if (this.defs.length === 0) { + // we don't statically know whether this is a type or a value + return true; + } + return this.defs.some(def => def.isVariableDefinition); + } +} +exports.Variable = Variable; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ebe9575680258dfdcf7625e7501e3b06ce77316f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.d.ts @@ -0,0 +1,42 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type { Definition } from '../definition'; +import type { Reference } from '../referencer/Reference'; +import type { Scope } from '../scope'; +export declare class VariableBase { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + readonly $id: number; + /** + * The array of the definitions of this variable. + * @public + */ + readonly defs: Definition[]; + /** + * True if the variable is considered used for the purposes of `no-unused-vars`, false otherwise. + * @public + */ + eslintUsed: boolean; + /** + * The array of `Identifier` nodes which define this variable. + * If this variable is redeclared, this array includes two or more nodes. + * @public + */ + readonly identifiers: TSESTree.Identifier[]; + /** + * The variable name, as given in the source code. + * @public + */ + readonly name: string; + /** + * List of {@link Reference} of this variable (excluding parameter entries) in its defining scope and all nested scopes. + * For defining occurrences only see {@link Variable#defs}. + * @public + */ + readonly references: Reference[]; + /** + * Reference to the enclosing Scope. + */ + readonly scope: Scope; + constructor(name: string, scope: Scope); +} diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js new file mode 100644 index 0000000000000000000000000000000000000000..8a81b3414927d15d46df00c574ab82a158fe146b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/VariableBase.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VariableBase = void 0; +const ID_1 = require("../ID"); +const generator = (0, ID_1.createIdGenerator)(); +class VariableBase { + /** + * A unique ID for this instance - primarily used to help debugging and testing + */ + $id = generator(); + /** + * The array of the definitions of this variable. + * @public + */ + defs = []; + /** + * True if the variable is considered used for the purposes of `no-unused-vars`, false otherwise. + * @public + */ + eslintUsed = false; + /** + * The array of `Identifier` nodes which define this variable. + * If this variable is redeclared, this array includes two or more nodes. + * @public + */ + identifiers = []; + /** + * The variable name, as given in the source code. + * @public + */ + name; + /** + * List of {@link Reference} of this variable (excluding parameter entries) in its defining scope and all nested scopes. + * For defining occurrences only see {@link Variable#defs}. + * @public + */ + references = []; + /** + * Reference to the enclosing Scope. + */ + scope; + constructor(name, scope) { + this.name = name; + this.scope = scope; + } +} +exports.VariableBase = VariableBase; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b6e7828ef27ab2b307b7899cde7f69fbd638f52e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/index.d.ts @@ -0,0 +1,6 @@ +import type { ESLintScopeVariable } from './ESLintScopeVariable'; +import type { Variable } from './Variable'; +export { ESLintScopeVariable } from './ESLintScopeVariable'; +export { ImplicitLibVariable, type ImplicitLibVariableOptions, type LibDefinition, } from './ImplicitLibVariable'; +export { Variable } from './Variable'; +export type ScopeVariable = ESLintScopeVariable | Variable; diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a194a41714d8d4a799464706e3c2efb51ec2f67e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/dist/variable/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Variable = exports.ImplicitLibVariable = exports.ESLintScopeVariable = void 0; +var ESLintScopeVariable_1 = require("./ESLintScopeVariable"); +Object.defineProperty(exports, "ESLintScopeVariable", { enumerable: true, get: function () { return ESLintScopeVariable_1.ESLintScopeVariable; } }); +var ImplicitLibVariable_1 = require("./ImplicitLibVariable"); +Object.defineProperty(exports, "ImplicitLibVariable", { enumerable: true, get: function () { return ImplicitLibVariable_1.ImplicitLibVariable; } }); +var Variable_1 = require("./Variable"); +Object.defineProperty(exports, "Variable", { enumerable: true, get: function () { return Variable_1.Variable; } }); diff --git a/tools/ui/node_modules/@typescript-eslint/scope-manager/package.json b/tools/ui/node_modules/@typescript-eslint/scope-manager/package.json new file mode 100644 index 0000000000000000000000000000000000000000..8dc527942c025d91fa740afc943315c0bdc95bbd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/scope-manager/package.json @@ -0,0 +1,82 @@ +{ + "name": "@typescript-eslint/scope-manager", + "version": "8.60.1", + "description": "TypeScript scope analyser for ESLint", + "files": [ + "dist", + "!**/*.tsbuildinfo", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "types": "./dist/index.d.ts", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/scope-manager" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io/packages/scope-manager", + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "dependencies": { + "@typescript-eslint/types": "8.60.1", + "@typescript-eslint/visitor-keys": "8.60.1" + }, + "devDependencies": { + "@typescript/native-preview": "7.0.0-dev.20260518.1", + "@vitest/coverage-v8": "^4.0.18", + "@vitest/pretty-format": "^4.0.18", + "eslint": "^10.0.0", + "glob": "^11.1.0", + "rimraf": "^5.0.10", + "typescript": ">=4.8.4 <6.1.0", + "vitest": "^4.0.18", + "@typescript-eslint/typescript-estree": "8.60.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "scope-manager", + "includedScripts": [ + "clean", + "clean-fixtures" + ], + "targets": { + "lint": { + "command": "eslint" + }, + "typecheck:tsgo": {} + } + }, + "scripts": { + "build": "pnpm exec nx build", + "clean": "rimraf dist/ coverage/", + "clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"", + "format": "pnpm -w run format", + "generate-lib": "pnpm -w exec nx generate-lib repo", + "lint": "pnpm -w exec nx lint", + "test": "pnpm -w exec nx test", + "typecheck": "pnpm -w exec nx typecheck", + "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/LICENSE b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..310a18f8a6cbbe878d7c2874d6e3323827709b99 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/README.md b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/README.md new file mode 100644 index 0000000000000000000000000000000000000000..075c3fbb7315c3d273368a14531e56af1697cea0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/tsconfig-utils` + +> Utilities for collecting TSConfigs for linting scenarios. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/tsconfig-utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/tsconfig-utils) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/tsconfig-utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/tsconfig-utils) + +The utilities in this package are separated from `@typescript-eslint/utils` so that they do not have a dependency on `eslint` or `@typescript-eslint/typescript-estree`. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/compilerOptions.d.ts b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/compilerOptions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b34f05dc14d8bee79d91228227ddd9ebd337f036 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/compilerOptions.d.ts @@ -0,0 +1,8 @@ +/** + * Compiler options required to avoid critical functionality issues + */ +export declare const CORE_COMPILER_OPTIONS: { + noEmit: true; + noUnusedLocals: true; + noUnusedParameters: true; +}; diff --git a/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/compilerOptions.js b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/compilerOptions.js new file mode 100644 index 0000000000000000000000000000000000000000..06265dd5545512d4e8d0b7d635fd4322a9577946 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/compilerOptions.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CORE_COMPILER_OPTIONS = void 0; +/** + * Compiler options required to avoid critical functionality issues + */ +exports.CORE_COMPILER_OPTIONS = { + // Required to avoid parse from causing emit to occur + noEmit: true, + // Flags required to make no-unused-vars work + noUnusedLocals: true, + noUnusedParameters: true, +}; diff --git a/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/getParsedConfigFile.d.ts b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/getParsedConfigFile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3c4aa607f394bf8c11e96ec3a46aac2e6abbcc6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/getParsedConfigFile.d.ts @@ -0,0 +1,8 @@ +import type * as ts from 'typescript/lib/tsserverlibrary'; +/** + * Parses a TSConfig file using the same logic as tsserver. + * + * @param configFile the path to the tsconfig.json file, relative to `projectDirectory` + * @param projectDirectory the project directory to use as the CWD, defaults to `process.cwd()` + */ +export declare function getParsedConfigFile(tsserver: typeof ts, configFile: string, projectDirectory?: string): ts.ParsedCommandLine; diff --git a/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/getParsedConfigFile.js b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/getParsedConfigFile.js new file mode 100644 index 0000000000000000000000000000000000000000..5a56ced82809f713a6806351cd36b48edc787f87 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/getParsedConfigFile.js @@ -0,0 +1,79 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getParsedConfigFile = getParsedConfigFile; +const fs = __importStar(require("node:fs")); +const path = __importStar(require("node:path")); +const compilerOptions_1 = require("./compilerOptions"); +/** + * Parses a TSConfig file using the same logic as tsserver. + * + * @param configFile the path to the tsconfig.json file, relative to `projectDirectory` + * @param projectDirectory the project directory to use as the CWD, defaults to `process.cwd()` + */ +function getParsedConfigFile(tsserver, configFile, projectDirectory) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/internal/eqeq-nullish + if (tsserver.sys === undefined) { + throw new Error('`getParsedConfigFile` is only supported in a Node-like environment.'); + } + const parsed = tsserver.getParsedCommandLineOfConfigFile(configFile, compilerOptions_1.CORE_COMPILER_OPTIONS, { + fileExists: fs.existsSync, + getCurrentDirectory, + onUnRecoverableConfigFileDiagnostic: diag => { + throw new Error(formatDiagnostics([diag])); // ensures that `parsed` is defined. + }, + readDirectory: tsserver.sys.readDirectory, + readFile: file => fs.readFileSync(path.isAbsolute(file) ? file : path.join(getCurrentDirectory(), file), 'utf-8'), + useCaseSensitiveFileNames: tsserver.sys.useCaseSensitiveFileNames, + }); + if (parsed?.errors.length) { + throw new Error([ + "Unable to parse the specified 'tsconfig' file. Ensure it's correct and has valid syntax.", + formatDiagnostics(parsed.errors), + ].join('\n\n')); + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return parsed; + function getCurrentDirectory() { + return projectDirectory ? path.resolve(projectDirectory) : process.cwd(); + } + function formatDiagnostics(diagnostics) { + return tsserver.formatDiagnostics(diagnostics, { + getCanonicalFileName: f => f, + getCurrentDirectory, + getNewLine: () => '\n', + }); + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/index.d.ts b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3213fc4e40a120cd1045b67e06d692ad8c7e112c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/index.d.ts @@ -0,0 +1,2 @@ +export * from './compilerOptions'; +export * from './getParsedConfigFile'; diff --git a/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/index.js b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fdc529fe98525bbefe7119b81a90c2ae7361a95f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/dist/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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 }); +__exportStar(require("./compilerOptions"), exports); +__exportStar(require("./getParsedConfigFile"), exports); diff --git a/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/package.json b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/package.json new file mode 100644 index 0000000000000000000000000000000000000000..eb9b710c2ca5d19cd4094f50bc3238ffe470c1e3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/tsconfig-utils/package.json @@ -0,0 +1,74 @@ +{ + "name": "@typescript-eslint/tsconfig-utils", + "version": "8.60.1", + "description": "Utilities for collecting TSConfigs for linting scenarios.", + "files": [ + "dist", + "!**/*.tsbuildinfo", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/tsconfig-utils" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io", + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + }, + "devDependencies": { + "@typescript/native-preview": "7.0.0-dev.20260518.1", + "@vitest/coverage-v8": "^4.0.18", + "rimraf": "^5.0.10", + "typescript": ">=4.8.4 <6.1.0", + "vitest": "^4.0.18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "publishConfig": { + "access": "public" + }, + "nx": { + "name": "tsconfig-utils", + "includedScripts": [ + "clean" + ], + "targets": { + "typecheck:tsgo": {} + } + }, + "scripts": { + "//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.", + "build": "pnpm exec nx build", + "clean": "rimraf dist/ coverage/", + "format": "pnpm -w exec format", + "lint": "pnpm -w exec nx lint", + "test": "pnpm -w exec nx test", + "typecheck": "pnpm -w exec nx typecheck", + "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/LICENSE b/tools/ui/node_modules/@typescript-eslint/type-utils/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..dabd464af3a207c5f55cd5250caf63f05fc3b9fc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/README.md b/tools/ui/node_modules/@typescript-eslint/type-utils/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c5d32797dcf082fd71f00c2a76f8718564ee2afd --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/type-utils` + +> Type utilities for working with TypeScript within ESLint rules. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) + +The utilities in this package are separated from `@typescript-eslint/utils` so that that package does not require a dependency on `typescript`. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e27b4addf754f36476dba6591c141ab654ff4f71 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.d.ts @@ -0,0 +1,132 @@ +import type { TSESTree } from '@typescript-eslint/types'; +import type * as ts from 'typescript'; +/** + * Describes specific types or values declared in local files. + * See [TypeOrValueSpecifier > FileSpecifier](/packages/type-utils/type-or-value-specifier#filespecifier). + */ +export interface FileSpecifier { + from: 'file'; + /** + * Type or value name(s) to match on. + */ + name: string | string[]; + /** + * A specific file the types or values must be declared in. + */ + path?: string; +} +/** + * Describes specific types or values declared in TypeScript's built-in lib definitions. + * See [TypeOrValueSpecifier > LibSpecifier](/packages/type-utils/type-or-value-specifier#libspecifier). + */ +export interface LibSpecifier { + from: 'lib'; + /** + * Type or value name(s) to match on. + */ + name: string | string[]; +} +/** + * Describes specific types or values imported from packages. + * See [TypeOrValueSpecifier > PackageSpecifier](/packages/type-utils/type-or-value-specifier#packagespecifier). + */ +export interface PackageSpecifier { + from: 'package'; + /** + * Type or value name(s) to match on. + */ + name: string | string[]; + /** + * Package name the type or value must be declared in. + */ + package: string; +} +/** + * A centralized format for rule options to describe specific _types_ and/or _values_. + * See [TypeOrValueSpecifier](/packages/type-utils/type-or-value-specifier). + */ +export type TypeOrValueSpecifier = string | FileSpecifier | LibSpecifier | PackageSpecifier; +export declare const typeOrValueSpecifiersSchema: { + readonly items: { + readonly oneOf: [{ + readonly type: "string"; + }, { + readonly additionalProperties: false; + readonly properties: { + readonly from: { + readonly enum: ["file"]; + readonly type: "string"; + }; + readonly name: { + readonly oneOf: [{ + readonly type: "string"; + }, { + readonly items: { + readonly type: "string"; + }; + readonly minItems: 1; + readonly type: "array"; + readonly uniqueItems: true; + }]; + }; + readonly path: { + readonly type: "string"; + }; + }; + readonly required: ["from", "name"]; + readonly type: "object"; + }, { + readonly additionalProperties: false; + readonly properties: { + readonly from: { + readonly enum: ["lib"]; + readonly type: "string"; + }; + readonly name: { + readonly oneOf: [{ + readonly type: "string"; + }, { + readonly items: { + readonly type: "string"; + }; + readonly minItems: 1; + readonly type: "array"; + readonly uniqueItems: true; + }]; + }; + }; + readonly required: ["from", "name"]; + readonly type: "object"; + }, { + readonly additionalProperties: false; + readonly properties: { + readonly from: { + readonly enum: ["package"]; + readonly type: "string"; + }; + readonly name: { + readonly oneOf: [{ + readonly type: "string"; + }, { + readonly items: { + readonly type: "string"; + }; + readonly minItems: 1; + readonly type: "array"; + readonly uniqueItems: true; + }]; + }; + readonly package: { + readonly type: "string"; + }; + }; + readonly required: ["from", "name", "package"]; + readonly type: "object"; + }]; + }; + readonly type: "array"; +}; +export declare function typeMatchesSpecifier(type: ts.Type, specifier: TypeOrValueSpecifier, program: ts.Program): boolean; +export declare const typeMatchesSomeSpecifier: (type: ts.Type, specifiers: TypeOrValueSpecifier[] | undefined, program: ts.Program) => boolean; +export declare function valueMatchesSpecifier(node: TSESTree.Node, specifier: TypeOrValueSpecifier, program: ts.Program, type: ts.Type): boolean; +export declare const valueMatchesSomeSpecifier: (node: TSESTree.Node, specifiers: TypeOrValueSpecifier[] | undefined, program: ts.Program, type: ts.Type) => boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.js new file mode 100644 index 0000000000000000000000000000000000000000..77efc17ff79abc893f8c68a8066ef523fa9e91f9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/TypeOrValueSpecifier.js @@ -0,0 +1,212 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.valueMatchesSomeSpecifier = exports.typeMatchesSomeSpecifier = exports.typeOrValueSpecifiersSchema = void 0; +exports.typeMatchesSpecifier = typeMatchesSpecifier; +exports.valueMatchesSpecifier = valueMatchesSpecifier; +const types_1 = require("@typescript-eslint/types"); +const tsutils = __importStar(require("ts-api-utils")); +const specifierNameMatches_1 = require("./typeOrValueSpecifiers/specifierNameMatches"); +const typeDeclaredInFile_1 = require("./typeOrValueSpecifiers/typeDeclaredInFile"); +const typeDeclaredInLib_1 = require("./typeOrValueSpecifiers/typeDeclaredInLib"); +const typeDeclaredInPackageDeclarationFile_1 = require("./typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile"); +exports.typeOrValueSpecifiersSchema = { + items: { + oneOf: [ + { + type: 'string', + }, + { + additionalProperties: false, + properties: { + from: { + enum: ['file'], + type: 'string', + }, + name: { + oneOf: [ + { + type: 'string', + }, + { + items: { + type: 'string', + }, + minItems: 1, + type: 'array', + uniqueItems: true, + }, + ], + }, + path: { + type: 'string', + }, + }, + required: ['from', 'name'], + type: 'object', + }, + { + additionalProperties: false, + properties: { + from: { + enum: ['lib'], + type: 'string', + }, + name: { + oneOf: [ + { + type: 'string', + }, + { + items: { + type: 'string', + }, + minItems: 1, + type: 'array', + uniqueItems: true, + }, + ], + }, + }, + required: ['from', 'name'], + type: 'object', + }, + { + additionalProperties: false, + properties: { + from: { + enum: ['package'], + type: 'string', + }, + name: { + oneOf: [ + { + type: 'string', + }, + { + items: { + type: 'string', + }, + minItems: 1, + type: 'array', + uniqueItems: true, + }, + ], + }, + package: { + type: 'string', + }, + }, + required: ['from', 'name', 'package'], + type: 'object', + }, + ], + }, + type: 'array', +}; +function typeMatchesSpecifier(type, specifier, program) { + if (tsutils.isUnionType(type)) { + return type.types.every(t => typeMatchesSpecifier(t, specifier, program)); + } + const wholeTypeMatches = (() => { + if (tsutils.isIntrinsicErrorType(type)) { + return false; + } + if (typeof specifier === 'string') { + return (0, specifierNameMatches_1.specifierNameMatches)(type, specifier); + } + if (!(0, specifierNameMatches_1.specifierNameMatches)(type, specifier.name)) { + return false; + } + const symbol = type.getSymbol() ?? type.aliasSymbol; + const declarations = symbol?.getDeclarations() ?? []; + const declarationFiles = declarations.map(declaration => declaration.getSourceFile()); + switch (specifier.from) { + case 'file': + return (0, typeDeclaredInFile_1.typeDeclaredInFile)(specifier.path, declarationFiles, program); + case 'lib': + return (0, typeDeclaredInLib_1.typeDeclaredInLib)(declarationFiles, program); + case 'package': + return (0, typeDeclaredInPackageDeclarationFile_1.typeDeclaredInPackageDeclarationFile)(specifier.package, declarations, declarationFiles, program); + } + })(); + if (wholeTypeMatches) { + return true; + } + if (tsutils.isIntersectionType(type) && + tsutils + .intersectionConstituents(type) + .some(part => typeMatchesSpecifier(part, specifier, program))) { + return true; + } + return false; +} +const typeMatchesSomeSpecifier = (type, specifiers = [], program) => specifiers.some(specifier => typeMatchesSpecifier(type, specifier, program)); +exports.typeMatchesSomeSpecifier = typeMatchesSomeSpecifier; +const getSpecifierNames = (specifierName) => { + return typeof specifierName === 'string' ? [specifierName] : specifierName; +}; +const getStaticName = (node) => { + if (node.type === types_1.AST_NODE_TYPES.Identifier || + node.type === types_1.AST_NODE_TYPES.JSXIdentifier || + node.type === types_1.AST_NODE_TYPES.PrivateIdentifier) { + return node.name; + } + if (node.type === types_1.AST_NODE_TYPES.Literal && typeof node.value === 'string') { + return node.value; + } + return undefined; +}; +function valueMatchesSpecifier(node, specifier, program, type) { + const staticName = getStaticName(node); + if (!staticName) { + return false; + } + if (typeof specifier === 'string') { + return specifier === staticName; + } + if (!getSpecifierNames(specifier.name).includes(staticName)) { + return false; + } + if (specifier.from === 'package') { + const symbol = type.getSymbol() ?? type.aliasSymbol; + const declarations = symbol?.getDeclarations() ?? []; + const declarationFiles = declarations.map(declaration => declaration.getSourceFile()); + return (0, typeDeclaredInPackageDeclarationFile_1.typeDeclaredInPackageDeclarationFile)(specifier.package, declarations, declarationFiles, program); + } + return true; +} +const valueMatchesSomeSpecifier = (node, specifiers = [], program, type) => specifiers.some(specifier => valueMatchesSpecifier(node, specifier, program, type)); +exports.valueMatchesSomeSpecifier = valueMatchesSomeSpecifier; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2eba0d83b3dcf29281e4cda1f081e7a0d1a95692 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.d.ts @@ -0,0 +1,53 @@ +import * as ts from 'typescript'; +/** + * @example + * ```ts + * class DerivedClass extends Promise {} + * DerivedClass.reject + * // ^ PromiseLike + * ``` + */ +export declare function isPromiseLike(program: ts.Program, type: ts.Type): boolean; +/** + * @example + * ```ts + * const value = Promise + * value.reject + * // ^ PromiseConstructorLike + * ``` + */ +export declare function isPromiseConstructorLike(program: ts.Program, type: ts.Type): boolean; +/** + * @example + * ```ts + * class Foo extends Error {} + * new Foo() + * // ^ ErrorLike + * ``` + */ +export declare function isErrorLike(program: ts.Program, type: ts.Type): boolean; +/** + * @example + * ```ts + * type T = Readonly + * // ^ ReadonlyErrorLike + * ``` + */ +export declare function isReadonlyErrorLike(program: ts.Program, type: ts.Type): boolean; +/** + * @example + * ```ts + * type T = Readonly<{ foo: 'bar' }> + * // ^ ReadonlyTypeLike + * ``` + */ +export declare function isReadonlyTypeLike(program: ts.Program, type: ts.Type, predicate?: (subType: { + aliasSymbol: ts.Symbol; + aliasTypeArguments: readonly ts.Type[]; +} & ts.Type) => boolean): boolean; +export declare function isBuiltinTypeAliasLike(program: ts.Program, type: ts.Type, predicate: (subType: { + aliasSymbol: ts.Symbol; + aliasTypeArguments: readonly ts.Type[]; +} & ts.Type) => boolean): boolean; +export declare function isBuiltinSymbolLike(program: ts.Program, type: ts.Type, symbolName: string | string[]): boolean; +export declare function isBuiltinSymbolLikeRecurser(program: ts.Program, type: ts.Type, predicate: (subType: ts.Type) => boolean | null): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.js new file mode 100644 index 0000000000000000000000000000000000000000..75bbc567023d4c2cc22bbcd369573bc92e0bc239 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/builtinSymbolLikes.js @@ -0,0 +1,165 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isPromiseLike = isPromiseLike; +exports.isPromiseConstructorLike = isPromiseConstructorLike; +exports.isErrorLike = isErrorLike; +exports.isReadonlyErrorLike = isReadonlyErrorLike; +exports.isReadonlyTypeLike = isReadonlyTypeLike; +exports.isBuiltinTypeAliasLike = isBuiltinTypeAliasLike; +exports.isBuiltinSymbolLike = isBuiltinSymbolLike; +exports.isBuiltinSymbolLikeRecurser = isBuiltinSymbolLikeRecurser; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const isSymbolFromDefaultLibrary_1 = require("./isSymbolFromDefaultLibrary"); +/** + * @example + * ```ts + * class DerivedClass extends Promise {} + * DerivedClass.reject + * // ^ PromiseLike + * ``` + */ +function isPromiseLike(program, type) { + return isBuiltinSymbolLike(program, type, 'Promise'); +} +/** + * @example + * ```ts + * const value = Promise + * value.reject + * // ^ PromiseConstructorLike + * ``` + */ +function isPromiseConstructorLike(program, type) { + return isBuiltinSymbolLike(program, type, 'PromiseConstructor'); +} +/** + * @example + * ```ts + * class Foo extends Error {} + * new Foo() + * // ^ ErrorLike + * ``` + */ +function isErrorLike(program, type) { + return isBuiltinSymbolLike(program, type, 'Error'); +} +/** + * @example + * ```ts + * type T = Readonly + * // ^ ReadonlyErrorLike + * ``` + */ +function isReadonlyErrorLike(program, type) { + return isReadonlyTypeLike(program, type, subtype => { + const [typeArgument] = subtype.aliasTypeArguments; + return (isErrorLike(program, typeArgument) || + isReadonlyErrorLike(program, typeArgument)); + }); +} +/** + * @example + * ```ts + * type T = Readonly<{ foo: 'bar' }> + * // ^ ReadonlyTypeLike + * ``` + */ +function isReadonlyTypeLike(program, type, predicate) { + return isBuiltinTypeAliasLike(program, type, subtype => { + return (subtype.aliasSymbol.getName() === 'Readonly' && !!predicate?.(subtype)); + }); +} +function isBuiltinTypeAliasLike(program, type, predicate) { + return isBuiltinSymbolLikeRecurser(program, type, subtype => { + const { aliasSymbol, aliasTypeArguments } = subtype; + if (!aliasSymbol || !aliasTypeArguments) { + return false; + } + if ((0, isSymbolFromDefaultLibrary_1.isSymbolFromDefaultLibrary)(program, aliasSymbol) && + predicate(subtype)) { + return true; + } + return null; + }); +} +function isBuiltinSymbolLike(program, type, symbolName) { + return isBuiltinSymbolLikeRecurser(program, type, subType => { + const symbol = subType.getSymbol(); + if (!symbol) { + return false; + } + const actualSymbolName = symbol.getName(); + if ((Array.isArray(symbolName) + ? symbolName.some(name => actualSymbolName === name) + : actualSymbolName === symbolName) && + (0, isSymbolFromDefaultLibrary_1.isSymbolFromDefaultLibrary)(program, symbol)) { + return true; + } + return null; + }); +} +function isBuiltinSymbolLikeRecurser(program, type, predicate) { + if (type.isIntersection()) { + return type.types.some(t => isBuiltinSymbolLikeRecurser(program, t, predicate)); + } + if (type.isUnion()) { + return type.types.every(t => isBuiltinSymbolLikeRecurser(program, t, predicate)); + } + if (tsutils.isTypeParameter(type)) { + const t = type.getConstraint(); + if (t) { + return isBuiltinSymbolLikeRecurser(program, t, predicate); + } + return false; + } + const predicateResult = predicate(type); + if (typeof predicateResult === 'boolean') { + return predicateResult; + } + const symbol = type.getSymbol(); + if (symbol && + tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Class | ts.SymbolFlags.Interface)) { + const checker = program.getTypeChecker(); + const declaredType = checker.getDeclaredTypeOfSymbol(symbol); + for (const baseType of checker.getBaseTypes(declaredType)) { + if (isBuiltinSymbolLikeRecurser(program, baseType, predicate)) { + return true; + } + } + } + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..30cd6dfd7e74e79f8b013e501c0490139f925a9f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.d.ts @@ -0,0 +1,9 @@ +import * as ts from 'typescript'; +/** + * @param type Type being checked by name. + * @param allowAny Whether to consider `any` and `unknown` to match. + * @param allowedNames Symbol names checking on the type. + * @param matchAnyInstead Whether to instead just check if any parts match, rather than all parts. + * @returns Whether the type is, extends, or contains the allowed names (or all matches the allowed names, if mustMatchAll is true). + */ +export declare function containsAllTypesByName(type: ts.Type, allowAny: boolean, allowedNames: Set, matchAnyInstead?: boolean): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.js new file mode 100644 index 0000000000000000000000000000000000000000..33079704bc248f8b17d7e9e6daddd86267bb055e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/containsAllTypesByName.js @@ -0,0 +1,69 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.containsAllTypesByName = containsAllTypesByName; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const typeFlagUtils_1 = require("./typeFlagUtils"); +/** + * @param type Type being checked by name. + * @param allowAny Whether to consider `any` and `unknown` to match. + * @param allowedNames Symbol names checking on the type. + * @param matchAnyInstead Whether to instead just check if any parts match, rather than all parts. + * @returns Whether the type is, extends, or contains the allowed names (or all matches the allowed names, if mustMatchAll is true). + */ +function containsAllTypesByName(type, allowAny, allowedNames, matchAnyInstead = false) { + if ((0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { + return !allowAny; + } + if (tsutils.isTypeReference(type)) { + type = type.target; + } + const symbol = type.getSymbol(); + if (symbol && allowedNames.has(symbol.name)) { + return true; + } + const predicate = (t) => containsAllTypesByName(t, allowAny, allowedNames, matchAnyInstead); + if (tsutils.isUnionOrIntersectionType(type)) { + return matchAnyInstead + ? type.types.some(predicate) + : type.types.every(predicate); + } + const bases = type.getBaseTypes(); + return (bases != null && + (matchAnyInstead + ? bases.some(predicate) + : bases.length > 0 && bases.every(predicate))); +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/discriminateAnyType.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/discriminateAnyType.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7b09796c489fa3b70d0806e2228add8fe37085f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/discriminateAnyType.d.ts @@ -0,0 +1,12 @@ +import type * as ts from 'typescript'; +export declare enum AnyType { + Any = 0, + PromiseAny = 1, + AnyArray = 2, + Safe = 3 +} +/** + * @returns `AnyType.Any` if the type is `any`, `AnyType.AnyArray` if the type is `any[]` or `readonly any[]`, `AnyType.PromiseAny` if the type is `Promise`, + * otherwise it returns `AnyType.Safe`. + */ +export declare function discriminateAnyType(type: ts.Type, checker: ts.TypeChecker, program: ts.Program, tsNode: ts.Node): AnyType; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/discriminateAnyType.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/discriminateAnyType.js new file mode 100644 index 0000000000000000000000000000000000000000..6183386d73e00ffafa24cf8d94b0a3b8227e0f91 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/discriminateAnyType.js @@ -0,0 +1,77 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnyType = void 0; +exports.discriminateAnyType = discriminateAnyType; +const tsutils = __importStar(require("ts-api-utils")); +const predicates_1 = require("./predicates"); +var AnyType; +(function (AnyType) { + AnyType[AnyType["Any"] = 0] = "Any"; + AnyType[AnyType["PromiseAny"] = 1] = "PromiseAny"; + AnyType[AnyType["AnyArray"] = 2] = "AnyArray"; + AnyType[AnyType["Safe"] = 3] = "Safe"; +})(AnyType || (exports.AnyType = AnyType = {})); +/** + * @returns `AnyType.Any` if the type is `any`, `AnyType.AnyArray` if the type is `any[]` or `readonly any[]`, `AnyType.PromiseAny` if the type is `Promise`, + * otherwise it returns `AnyType.Safe`. + */ +function discriminateAnyType(type, checker, program, tsNode) { + return discriminateAnyTypeWorker(type, checker, program, tsNode, new Set()); +} +function discriminateAnyTypeWorker(type, checker, program, tsNode, visited) { + if (visited.has(type)) { + return AnyType.Safe; + } + visited.add(type); + if ((0, predicates_1.isTypeAnyType)(type)) { + return AnyType.Any; + } + if ((0, predicates_1.isTypeAnyArrayType)(type, checker)) { + return AnyType.AnyArray; + } + for (const part of tsutils.typeConstituents(type)) { + if (tsutils.isThenableType(checker, tsNode, part)) { + const awaitedType = checker.getAwaitedType(part); + if (awaitedType) { + const awaitedAnyType = discriminateAnyTypeWorker(awaitedType, checker, program, tsNode, visited); + if (awaitedAnyType === AnyType.Any) { + return AnyType.PromiseAny; + } + } + } + } + return AnyType.Safe; +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2c27176317a9723b8b954f1647a2f2de3742da02 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.d.ts @@ -0,0 +1,12 @@ +import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/typescript-estree'; +import type * as ts from 'typescript'; +/** + * Resolves the given node's type. Will return the type's generic constraint, if it has one. + * + * Warning - if the type is generic and does _not_ have a constraint, the type will be + * returned as-is, rather than returning an `unknown` type. This can be checked + * for by checking for the type flag ts.TypeFlags.TypeParameter. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/10438 + */ +export declare function getConstrainedTypeAtLocation(services: ParserServicesWithTypeInformation, node: TSESTree.Node): ts.Type; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.js new file mode 100644 index 0000000000000000000000000000000000000000..05af126dbdd5fd08200d48b28e2954004180a1a9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getConstrainedTypeAtLocation.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getConstrainedTypeAtLocation = getConstrainedTypeAtLocation; +/** + * Resolves the given node's type. Will return the type's generic constraint, if it has one. + * + * Warning - if the type is generic and does _not_ have a constraint, the type will be + * returned as-is, rather than returning an `unknown` type. This can be checked + * for by checking for the type flag ts.TypeFlags.TypeParameter. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/10438 + */ +function getConstrainedTypeAtLocation(services, node) { + const nodeType = services.getTypeAtLocation(node); + const constrained = services.program + .getTypeChecker() + .getBaseConstraintOfType(nodeType); + return constrained ?? nodeType; +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getContextualType.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getContextualType.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8222f131c56a7da698c6183d1bcf620f7438b35 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getContextualType.d.ts @@ -0,0 +1,7 @@ +import * as ts from 'typescript'; +/** + * Returns the contextual type of a given node. + * Contextual type is the type of the target the node is going into. + * i.e. the type of a called function's parameter, or the defined type of a variable declaration + */ +export declare function getContextualType(checker: ts.TypeChecker, node: ts.Expression): ts.Type | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getContextualType.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getContextualType.js new file mode 100644 index 0000000000000000000000000000000000000000..b67ef76d5f09c5dafa7e10ab6ffa3106914b0c65 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getContextualType.js @@ -0,0 +1,76 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getContextualType = getContextualType; +const ts = __importStar(require("typescript")); +/** + * Returns the contextual type of a given node. + * Contextual type is the type of the target the node is going into. + * i.e. the type of a called function's parameter, or the defined type of a variable declaration + */ +function getContextualType(checker, node) { + const parent = node.parent; + if (ts.isCallExpression(parent) || ts.isNewExpression(parent)) { + if (node === parent.expression) { + // is the callee, so has no contextual type + return; + } + } + else if (ts.isVariableDeclaration(parent) || + ts.isPropertyDeclaration(parent) || + ts.isParameter(parent)) { + return parent.type ? checker.getTypeFromTypeNode(parent.type) : undefined; + } + else if (ts.isJsxExpression(parent)) { + return checker.getContextualType(parent); + } + else if (ts.isIdentifier(node) && + (ts.isPropertyAssignment(parent) || + ts.isShorthandPropertyAssignment(parent))) { + return checker.getContextualType(node); + } + else if (ts.isBinaryExpression(parent) && + parent.operatorToken.kind === ts.SyntaxKind.EqualsToken && + parent.right === node) { + // is RHS of assignment + return checker.getTypeAtLocation(parent.left); + } + else if (![ts.SyntaxKind.JsxExpression, ts.SyntaxKind.TemplateSpan].includes(parent.kind)) { + // parent is not something we know we can get the contextual type of + return; + } + // TODO - support return statement checking + return checker.getContextualType(node); +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f384936186a8eee86734ed7fa705c91abadf3b88 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.d.ts @@ -0,0 +1,6 @@ +import type { ParserServicesWithTypeInformation, TSESTree } from '@typescript-eslint/typescript-estree'; +import type * as ts from 'typescript'; +/** + * Gets the declaration for the given variable + */ +export declare function getDeclaration(services: ParserServicesWithTypeInformation, node: TSESTree.Node): ts.Declaration | null; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.js new file mode 100644 index 0000000000000000000000000000000000000000..eba593d6ad51d9b1c804d4843b5d685117c81e6d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getDeclaration.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getDeclaration = getDeclaration; +/** + * Gets the declaration for the given variable + */ +function getDeclaration(services, node) { + const symbol = services.getSymbolAtLocation(node); + if (!symbol) { + return null; + } + const declarations = symbol.getDeclarations(); + return declarations?.[0] ?? null; +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b0264ee8b35b553769bb49e18c38303ace3cb10 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.d.ts @@ -0,0 +1,6 @@ +import * as ts from 'typescript'; +/** + * @deprecated + * Gets the source file for a given node + */ +export declare function getSourceFileOfNode(node: ts.Node): ts.SourceFile; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.js new file mode 100644 index 0000000000000000000000000000000000000000..3842a6bab2ed0d4160d8ddc0db8420b8cd5563d4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getSourceFileOfNode.js @@ -0,0 +1,47 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getSourceFileOfNode = getSourceFileOfNode; +const ts = __importStar(require("typescript")); +/** + * @deprecated + * Gets the source file for a given node + */ +function getSourceFileOfNode(node) { + while (node.kind !== ts.SyntaxKind.SourceFile) { + node = node.parent; + } + return node; +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getTypeName.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getTypeName.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..342d345ba51a5dcbcbb171939c7cd7bec589e645 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getTypeName.d.ts @@ -0,0 +1,7 @@ +import * as ts from 'typescript'; +/** + * Get the type name of a given type. + * @param typeChecker The context sensitive TypeScript TypeChecker. + * @param type The type to get the name of. + */ +export declare function getTypeName(typeChecker: ts.TypeChecker, type: ts.Type): string; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getTypeName.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getTypeName.js new file mode 100644 index 0000000000000000000000000000000000000000..780390245ae4b774ed0e8d1977210a604ce73004 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/getTypeName.js @@ -0,0 +1,84 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTypeName = getTypeName; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +/** + * Get the type name of a given type. + * @param typeChecker The context sensitive TypeScript TypeChecker. + * @param type The type to get the name of. + */ +function getTypeName(typeChecker, type) { + // It handles `string` and string literal types as string. + if (tsutils.isTypeFlagSet(type, ts.TypeFlags.StringLike)) { + return 'string'; + } + // If the type is a type parameter which extends primitive string types, + // but it was not recognized as a string like. So check the constraint + // type of the type parameter. + if (tsutils.isTypeFlagSet(type, ts.TypeFlags.TypeParameter)) { + // `type.getConstraint()` method doesn't return the constraint type of + // the type parameter for some reason. So this gets the constraint type + // via AST. + const symbol = type.getSymbol(); + const decls = symbol?.getDeclarations(); + const typeParamDecl = decls?.[0]; + if (typeParamDecl != null && + ts.isTypeParameterDeclaration(typeParamDecl) && + typeParamDecl.constraint != null) { + return getTypeName(typeChecker, typeChecker.getTypeFromTypeNode(typeParamDecl.constraint)); + } + } + // If the type is a union and all types in the union are string like, + // return `string`. For example: + // - `"a" | "b"` is string. + // - `string | string[]` is not string. + if (type.isUnion() && + type.types + .map(value => getTypeName(typeChecker, value)) + .every(t => t === 'string')) { + return 'string'; + } + // If the type is an intersection and a type in the intersection is string + // like, return `string`. For example: `string & {__htmlEscaped: void}` + if (type.isIntersection() && + type.types + .map(value => getTypeName(typeChecker, value)) + .some(t => t === 'string')) { + return 'string'; + } + return typeChecker.typeToString(type); +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/index.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..af09b7be0566892160f437ff02c9630f16cec34f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/index.d.ts @@ -0,0 +1,18 @@ +export * from './builtinSymbolLikes'; +export * from './containsAllTypesByName'; +export * from './getConstrainedTypeAtLocation'; +export * from './getContextualType'; +export * from './getDeclaration'; +export * from './getSourceFileOfNode'; +export * from './getTypeName'; +export * from './isSymbolFromDefaultLibrary'; +export * from './isTypeBrandedLiteralLike'; +export * from './isTypeReadonly'; +export * from './isUnsafeAssignment'; +export * from './predicates'; +export * from './propertyTypes'; +export * from './requiresQuoting'; +export * from './typeFlagUtils'; +export * from './TypeOrValueSpecifier'; +export * from './discriminateAnyType'; +export { getDecorators, getModifiers, typescriptVersionIsAtLeast, } from '@typescript-eslint/typescript-estree'; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/index.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..961396f9d6cf0b4b666a41145bfc387bbc933b12 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/index.js @@ -0,0 +1,38 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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.typescriptVersionIsAtLeast = exports.getModifiers = exports.getDecorators = void 0; +__exportStar(require("./builtinSymbolLikes"), exports); +__exportStar(require("./containsAllTypesByName"), exports); +__exportStar(require("./getConstrainedTypeAtLocation"), exports); +__exportStar(require("./getContextualType"), exports); +__exportStar(require("./getDeclaration"), exports); +__exportStar(require("./getSourceFileOfNode"), exports); +__exportStar(require("./getTypeName"), exports); +__exportStar(require("./isSymbolFromDefaultLibrary"), exports); +__exportStar(require("./isTypeBrandedLiteralLike"), exports); +__exportStar(require("./isTypeReadonly"), exports); +__exportStar(require("./isUnsafeAssignment"), exports); +__exportStar(require("./predicates"), exports); +__exportStar(require("./propertyTypes"), exports); +__exportStar(require("./requiresQuoting"), exports); +__exportStar(require("./typeFlagUtils"), exports); +__exportStar(require("./TypeOrValueSpecifier"), exports); +__exportStar(require("./discriminateAnyType"), exports); +var typescript_estree_1 = require("@typescript-eslint/typescript-estree"); +Object.defineProperty(exports, "getDecorators", { enumerable: true, get: function () { return typescript_estree_1.getDecorators; } }); +Object.defineProperty(exports, "getModifiers", { enumerable: true, get: function () { return typescript_estree_1.getModifiers; } }); +Object.defineProperty(exports, "typescriptVersionIsAtLeast", { enumerable: true, get: function () { return typescript_estree_1.typescriptVersionIsAtLeast; } }); diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9ec4f2445b66021a8bb091bec73c844837f562af --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.d.ts @@ -0,0 +1,2 @@ +import type * as ts from 'typescript'; +export declare function isSymbolFromDefaultLibrary(program: ts.Program, symbol: ts.Symbol | undefined): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.js new file mode 100644 index 0000000000000000000000000000000000000000..4eba2152a9b1308f96c31b7d5824d5ae6eabae85 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isSymbolFromDefaultLibrary.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSymbolFromDefaultLibrary = isSymbolFromDefaultLibrary; +function isSymbolFromDefaultLibrary(program, symbol) { + if (!symbol) { + return false; + } + const declarations = symbol.getDeclarations() ?? []; + for (const declaration of declarations) { + const sourceFile = declaration.getSourceFile(); + if (program.isSourceFileDefaultLibrary(sourceFile)) { + return true; + } + } + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeBrandedLiteralLike.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeBrandedLiteralLike.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2f619a9bd79863ecc7bf58bf022d452685ff44c2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeBrandedLiteralLike.d.ts @@ -0,0 +1,2 @@ +import * as ts from 'typescript'; +export declare function isTypeBrandedLiteralLike(type: ts.Type): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeBrandedLiteralLike.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeBrandedLiteralLike.js new file mode 100644 index 0000000000000000000000000000000000000000..8368cb18d6cde949a7b124756547a1f3c0e7cbe0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeBrandedLiteralLike.js @@ -0,0 +1,74 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isTypeBrandedLiteralLike = isTypeBrandedLiteralLike; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +function isLiteralOrTaggablePrimitiveLike(type) { + return (type.isLiteral() || + tsutils.isTypeFlagSet(type, ts.TypeFlags.BigInt | + ts.TypeFlags.Number | + ts.TypeFlags.String | + ts.TypeFlags.TemplateLiteral)); +} +function isObjectLiteralLike(type) { + return (!type.getCallSignatures().length && + !type.getConstructSignatures().length && + tsutils.isObjectType(type)); +} +function isTypeBrandedLiteral(type) { + if (!type.isIntersection()) { + return false; + } + let hadObjectLike = false; + let hadPrimitiveLike = false; + for (const constituent of type.types) { + if (isObjectLiteralLike(constituent)) { + hadPrimitiveLike = true; + } + else if (isLiteralOrTaggablePrimitiveLike(constituent)) { + hadObjectLike = true; + } + else { + return false; + } + } + return hadPrimitiveLike && hadObjectLike; +} +function isTypeBrandedLiteralLike(type) { + return type.isUnion() + ? type.types.every(isTypeBrandedLiteral) + : isTypeBrandedLiteral(type); +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95ab028e34ec551a8f1461b5c2288c1a0aea7306 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.d.ts @@ -0,0 +1,100 @@ +import * as ts from 'typescript'; +import type { TypeOrValueSpecifier } from './TypeOrValueSpecifier'; +export interface ReadonlynessOptions { + readonly allow?: TypeOrValueSpecifier[]; + readonly treatMethodsAsReadonly?: boolean; +} +export declare const readonlynessOptionsSchema: { + additionalProperties: false; + properties: { + allow: { + readonly items: { + readonly oneOf: [{ + readonly type: "string"; + }, { + readonly additionalProperties: false; + readonly properties: { + readonly from: { + readonly enum: ["file"]; + readonly type: "string"; + }; + readonly name: { + readonly oneOf: [{ + readonly type: "string"; + }, { + readonly items: { + readonly type: "string"; + }; + readonly minItems: 1; + readonly type: "array"; + readonly uniqueItems: true; + }]; + }; + readonly path: { + readonly type: "string"; + }; + }; + readonly required: ["from", "name"]; + readonly type: "object"; + }, { + readonly additionalProperties: false; + readonly properties: { + readonly from: { + readonly enum: ["lib"]; + readonly type: "string"; + }; + readonly name: { + readonly oneOf: [{ + readonly type: "string"; + }, { + readonly items: { + readonly type: "string"; + }; + readonly minItems: 1; + readonly type: "array"; + readonly uniqueItems: true; + }]; + }; + }; + readonly required: ["from", "name"]; + readonly type: "object"; + }, { + readonly additionalProperties: false; + readonly properties: { + readonly from: { + readonly enum: ["package"]; + readonly type: "string"; + }; + readonly name: { + readonly oneOf: [{ + readonly type: "string"; + }, { + readonly items: { + readonly type: "string"; + }; + readonly minItems: 1; + readonly type: "array"; + readonly uniqueItems: true; + }]; + }; + readonly package: { + readonly type: "string"; + }; + }; + readonly required: ["from", "name", "package"]; + readonly type: "object"; + }]; + }; + readonly type: "array"; + }; + treatMethodsAsReadonly: { + type: "boolean"; + }; + }; + type: "object"; +}; +export declare const readonlynessOptionsDefaults: ReadonlynessOptions; +/** + * Checks if the given type is readonly + */ +export declare function isTypeReadonly(program: ts.Program, type: ts.Type, options?: ReadonlynessOptions): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.js new file mode 100644 index 0000000000000000000000000000000000000000..1b348a9ee65606bd56e4b0b142eac81b45e4371d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isTypeReadonly.js @@ -0,0 +1,255 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readonlynessOptionsDefaults = exports.readonlynessOptionsSchema = void 0; +exports.isTypeReadonly = isTypeReadonly; +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const propertyTypes_1 = require("./propertyTypes"); +const TypeOrValueSpecifier_1 = require("./TypeOrValueSpecifier"); +var Readonlyness; +(function (Readonlyness) { + /** the type cannot be handled by the function */ + Readonlyness[Readonlyness["UnknownType"] = 1] = "UnknownType"; + /** the type is mutable */ + Readonlyness[Readonlyness["Mutable"] = 2] = "Mutable"; + /** the type is readonly */ + Readonlyness[Readonlyness["Readonly"] = 3] = "Readonly"; +})(Readonlyness || (Readonlyness = {})); +exports.readonlynessOptionsSchema = { + additionalProperties: false, + properties: { + allow: TypeOrValueSpecifier_1.typeOrValueSpecifiersSchema, + treatMethodsAsReadonly: { + type: 'boolean', + }, + }, + type: 'object', +}; +exports.readonlynessOptionsDefaults = { + allow: [], + treatMethodsAsReadonly: false, +}; +function hasSymbol(node) { + return Object.hasOwn(node, 'symbol'); +} +function isTypeReadonlyArrayOrTuple(program, type, options, seenTypes) { + const checker = program.getTypeChecker(); + function checkTypeArguments(arrayType) { + const typeArguments = checker.getTypeArguments(arrayType); + // this shouldn't happen in reality as: + // - tuples require at least 1 type argument + // - ReadonlyArray requires at least 1 type argument + /* istanbul ignore if */ if (typeArguments.length === 0) { + return Readonlyness.Readonly; + } + // validate the element types are also readonly + if (typeArguments.some(typeArg => isTypeReadonlyRecurser(program, typeArg, options, seenTypes) === + Readonlyness.Mutable)) { + return Readonlyness.Mutable; + } + return Readonlyness.Readonly; + } + if (checker.isArrayType(type)) { + const symbol = utils_1.ESLintUtils.nullThrows(type.getSymbol(), utils_1.ESLintUtils.NullThrowsReasons.MissingToken('symbol', 'array type')); + const escapedName = symbol.getEscapedName(); + // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison + if (escapedName === 'Array') { + return Readonlyness.Mutable; + } + return checkTypeArguments(type); + } + if (checker.isTupleType(type)) { + if (!type.target.readonly) { + return Readonlyness.Mutable; + } + return checkTypeArguments(type); + } + return Readonlyness.UnknownType; +} +function isTypeReadonlyObject(program, type, options, seenTypes) { + const checker = program.getTypeChecker(); + function checkIndexSignature(kind) { + const indexInfo = checker.getIndexInfoOfType(type, kind); + if (indexInfo) { + if (!indexInfo.isReadonly) { + return Readonlyness.Mutable; + } + if (indexInfo.type === type || seenTypes.has(indexInfo.type)) { + return Readonlyness.Readonly; + } + return isTypeReadonlyRecurser(program, indexInfo.type, options, seenTypes); + } + return Readonlyness.UnknownType; + } + const properties = type.getProperties(); + if (properties.length) { + // ensure the properties are marked as readonly + for (const property of properties) { + if (options.treatMethodsAsReadonly) { + if (property.valueDeclaration != null && + hasSymbol(property.valueDeclaration) && + tsutils.isSymbolFlagSet(property.valueDeclaration.symbol, ts.SymbolFlags.Method)) { + continue; + } + const declarations = property.getDeclarations(); + const lastDeclaration = declarations != null && declarations.length > 0 + ? declarations[declarations.length - 1] + : undefined; + if (lastDeclaration != null && + hasSymbol(lastDeclaration) && + tsutils.isSymbolFlagSet(lastDeclaration.symbol, ts.SymbolFlags.Method)) { + continue; + } + } + if (tsutils.isPropertyReadonlyInType(type, property.getEscapedName(), checker)) { + continue; + } + const name = ts.getNameOfDeclaration(property.valueDeclaration); + if (name && ts.isPrivateIdentifier(name)) { + continue; + } + return Readonlyness.Mutable; + } + // all properties were readonly + // now ensure that all of the values are readonly also. + // do this after checking property readonly-ness as a perf optimization, + // as we might be able to bail out early due to a mutable property before + // doing this deep, potentially expensive check. + for (const property of properties) { + const propertyType = utils_1.ESLintUtils.nullThrows((0, propertyTypes_1.getTypeOfPropertyOfType)(checker, type, property), utils_1.ESLintUtils.NullThrowsReasons.MissingToken(`property "${property.name}"`, 'type')); + // handle recursive types. + // we only need this simple check, because a mutable recursive type will break via the above prop readonly check + if (seenTypes.has(propertyType)) { + continue; + } + if (isTypeReadonlyRecurser(program, propertyType, options, seenTypes) === + Readonlyness.Mutable) { + return Readonlyness.Mutable; + } + } + } + const isStringIndexSigReadonly = checkIndexSignature(ts.IndexKind.String); + if (isStringIndexSigReadonly === Readonlyness.Mutable) { + return isStringIndexSigReadonly; + } + const isNumberIndexSigReadonly = checkIndexSignature(ts.IndexKind.Number); + if (isNumberIndexSigReadonly === Readonlyness.Mutable) { + return isNumberIndexSigReadonly; + } + return Readonlyness.Readonly; +} +// a helper function to ensure the seenTypes map is always passed down, except by the external caller +function isTypeReadonlyRecurser(program, type, options, seenTypes) { + const checker = program.getTypeChecker(); + seenTypes.add(type); + // If the type has an alias symbol, check it against the allow list first + if (type.aliasSymbol && options.allow) { + const aliasSymbol = type.aliasSymbol; + const aliasMatches = options.allow.some(specifier => { + const specifierName = typeof specifier === 'string' ? specifier : specifier.name; + const names = Array.isArray(specifierName) + ? specifierName + : [specifierName]; + return names.includes(aliasSymbol.getName()); + }); + if (aliasMatches) { + return Readonlyness.Readonly; + } + } + if ((0, TypeOrValueSpecifier_1.typeMatchesSomeSpecifier)(type, options.allow, program)) { + return Readonlyness.Readonly; + } + if (tsutils.isUnionType(type)) { + // all types in the union must be readonly + const result = tsutils + .unionConstituents(type) + .every(t => seenTypes.has(t) || + isTypeReadonlyRecurser(program, t, options, seenTypes) === + Readonlyness.Readonly); + const readonlyness = result ? Readonlyness.Readonly : Readonlyness.Mutable; + return readonlyness; + } + if (tsutils.isIntersectionType(type)) { + // Special case for handling arrays/tuples (as readonly arrays/tuples always have mutable methods). + if (type.types.some(t => checker.isArrayType(t) || checker.isTupleType(t))) { + const allReadonlyParts = type.types.every(t => seenTypes.has(t) || + isTypeReadonlyRecurser(program, t, options, seenTypes) === + Readonlyness.Readonly); + return allReadonlyParts ? Readonlyness.Readonly : Readonlyness.Mutable; + } + // Normal case. + const isReadonlyObject = isTypeReadonlyObject(program, type, options, seenTypes); + if (isReadonlyObject !== Readonlyness.UnknownType) { + return isReadonlyObject; + } + } + if (tsutils.isConditionalType(type)) { + const result = [type.root.node.trueType, type.root.node.falseType] + .map(checker.getTypeFromTypeNode) + .every(t => seenTypes.has(t) || + isTypeReadonlyRecurser(program, t, options, seenTypes) === + Readonlyness.Readonly); + const readonlyness = result ? Readonlyness.Readonly : Readonlyness.Mutable; + return readonlyness; + } + // all non-object, non-intersection types are readonly. + // this should only be primitive types + if (!tsutils.isObjectType(type)) { + return Readonlyness.Readonly; + } + // pure function types are readonly + if (type.getCallSignatures().length > 0 && + type.getProperties().length === 0) { + return Readonlyness.Readonly; + } + const isReadonlyArray = isTypeReadonlyArrayOrTuple(program, type, options, seenTypes); + if (isReadonlyArray !== Readonlyness.UnknownType) { + return isReadonlyArray; + } + const isReadonlyObject = isTypeReadonlyObject(program, type, options, seenTypes); + /* istanbul ignore else */ if (isReadonlyObject !== Readonlyness.UnknownType) { + return isReadonlyObject; + } + throw new Error('Unhandled type'); +} +/** + * Checks if the given type is readonly + */ +function isTypeReadonly(program, type, options = exports.readonlynessOptionsDefaults) { + return (isTypeReadonlyRecurser(program, type, options, new Set()) === + Readonlyness.Readonly); +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0dd5a4c96c0fffe1f8beea1862ab018f0983a8aa --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.d.ts @@ -0,0 +1,16 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import type * as ts from 'typescript'; +/** + * Does a simple check to see if there is an any being assigned to a non-any type. + * + * This also checks generic positions to ensure there's no unsafe sub-assignments. + * Note: in the case of generic positions, it makes the assumption that the two types are the same. + * + * @example See tests for examples + * + * @returns false if it's safe, or an object with the two types if it's unsafe + */ +export declare function isUnsafeAssignment(type: ts.Type, receiver: ts.Type, checker: ts.TypeChecker, senderNode: TSESTree.Node | null): false | { + receiver: ts.Type; + sender: ts.Type; +}; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js new file mode 100644 index 0000000000000000000000000000000000000000..2fde82e650d59829999489a503ddf9679bfd921e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/isUnsafeAssignment.js @@ -0,0 +1,114 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isUnsafeAssignment = isUnsafeAssignment; +const utils_1 = require("@typescript-eslint/utils"); +const tsutils = __importStar(require("ts-api-utils")); +const predicates_1 = require("./predicates"); +/** + * Does a simple check to see if there is an any being assigned to a non-any type. + * + * This also checks generic positions to ensure there's no unsafe sub-assignments. + * Note: in the case of generic positions, it makes the assumption that the two types are the same. + * + * @example See tests for examples + * + * @returns false if it's safe, or an object with the two types if it's unsafe + */ +function isUnsafeAssignment(type, receiver, checker, senderNode) { + return isUnsafeAssignmentWorker(type, receiver, checker, senderNode, new Map()); +} +function isUnsafeAssignmentWorker(type, receiver, checker, senderNode, visited) { + if ((0, predicates_1.isTypeAnyType)(type)) { + // Allow assignment of any ==> unknown. + if ((0, predicates_1.isTypeUnknownType)(receiver)) { + return false; + } + if (!(0, predicates_1.isTypeAnyType)(receiver)) { + return { receiver, sender: type }; + } + } + const typeAlreadyVisited = visited.get(type); + if (typeAlreadyVisited) { + if (typeAlreadyVisited.has(receiver)) { + return false; + } + typeAlreadyVisited.add(receiver); + } + else { + visited.set(type, new Set([receiver])); + } + if (tsutils.isTypeReference(type) && tsutils.isTypeReference(receiver)) { + // TODO - figure out how to handle cases like this, + // where the types are assignable, but not the same type + /* + function foo(): ReadonlySet { return new Set(); } + + // and + + type Test = { prop: T } + type Test2 = { prop: string } + declare const a: Test; + const b: Test2 = a; + */ + if (type.target !== receiver.target) { + // if the type references are different, assume safe, as we won't know how to compare the two types + // the generic positions might not be equivalent for both types + return false; + } + if (senderNode?.type === utils_1.AST_NODE_TYPES.NewExpression && + senderNode.callee.type === utils_1.AST_NODE_TYPES.Identifier && + senderNode.callee.name === 'Map' && + senderNode.arguments.length === 0 && + senderNode.typeArguments == null) { + // special case to handle `new Map()` + // unfortunately Map's default empty constructor is typed to return `Map` :( + // https://github.com/typescript-eslint/typescript-eslint/issues/2109#issuecomment-634144396 + return false; + } + const typeArguments = type.typeArguments ?? []; + const receiverTypeArguments = receiver.typeArguments ?? []; + for (let i = 0; i < typeArguments.length; i += 1) { + const arg = typeArguments[i]; + const receiverArg = receiverTypeArguments[i]; + const unsafe = isUnsafeAssignmentWorker(arg, receiverArg, checker, senderNode, visited); + if (unsafe) { + return { receiver, sender: type }; + } + } + return false; + } + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/predicates.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/predicates.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc71fada43caaf048b56d8d70c091e6e93eb5b7f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/predicates.d.ts @@ -0,0 +1,37 @@ +import * as ts from 'typescript'; +/** + * Checks if the given type is (or accepts) nullable + */ +export declare function isNullableType(type: ts.Type): boolean; +/** + * Checks if the given type is either an array type, + * or a union made up solely of array types. + */ +export declare function isTypeArrayTypeOrUnionOfArrayTypes(type: ts.Type, checker: ts.TypeChecker): boolean; +/** + * @returns true if the type is `never` + */ +export declare function isTypeNeverType(type: ts.Type): boolean; +/** + * @returns true if the type is `unknown` + */ +export declare function isTypeUnknownType(type: ts.Type): boolean; +export declare function isTypeReferenceType(type: ts.Type): type is ts.TypeReference; +/** + * @returns true if the type is `any` + */ +export declare function isTypeAnyType(type: ts.Type): boolean; +/** + * @returns true if the type is `any[]` + */ +export declare function isTypeAnyArrayType(type: ts.Type, checker: ts.TypeChecker): boolean; +/** + * @returns true if the type is `unknown[]` + */ +export declare function isTypeUnknownArrayType(type: ts.Type, checker: ts.TypeChecker): boolean; +/** + * @returns Whether a type is an instance of the parent type, including for the parent's base types. + */ +export declare function typeIsOrHasBaseType(type: ts.Type, parentType: ts.Type): boolean; +export declare function isTypeBigIntLiteralType(type: ts.Type): type is ts.BigIntLiteralType; +export declare function isTypeTemplateLiteralType(type: ts.Type): type is ts.TemplateLiteralType; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/predicates.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/predicates.js new file mode 100644 index 0000000000000000000000000000000000000000..d76294b0562c951c6929d225214ab49b538450a2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/predicates.js @@ -0,0 +1,157 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isNullableType = isNullableType; +exports.isTypeArrayTypeOrUnionOfArrayTypes = isTypeArrayTypeOrUnionOfArrayTypes; +exports.isTypeNeverType = isTypeNeverType; +exports.isTypeUnknownType = isTypeUnknownType; +exports.isTypeReferenceType = isTypeReferenceType; +exports.isTypeAnyType = isTypeAnyType; +exports.isTypeAnyArrayType = isTypeAnyArrayType; +exports.isTypeUnknownArrayType = isTypeUnknownArrayType; +exports.typeIsOrHasBaseType = typeIsOrHasBaseType; +exports.isTypeBigIntLiteralType = isTypeBigIntLiteralType; +exports.isTypeTemplateLiteralType = isTypeTemplateLiteralType; +const debug_1 = __importDefault(require("debug")); +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const typeFlagUtils_1 = require("./typeFlagUtils"); +const log = (0, debug_1.default)('typescript-eslint:type-utils:predicates'); +/** + * Checks if the given type is (or accepts) nullable + */ +function isNullableType(type) { + return (0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.Null | + ts.TypeFlags.Undefined | + ts.TypeFlags.Void); +} +/** + * Checks if the given type is either an array type, + * or a union made up solely of array types. + */ +function isTypeArrayTypeOrUnionOfArrayTypes(type, checker) { + for (const t of tsutils.unionConstituents(type)) { + if (!checker.isArrayType(t)) { + return false; + } + } + return true; +} +/** + * @returns true if the type is `never` + */ +function isTypeNeverType(type) { + return (0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.Never); +} +/** + * @returns true if the type is `unknown` + */ +function isTypeUnknownType(type) { + return (0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.Unknown); +} +// https://github.com/microsoft/TypeScript/blob/42aa18bf442c4df147e30deaf27261a41cbdc617/src/compiler/types.ts#L5157 +const Nullable = ts.TypeFlags.Undefined | ts.TypeFlags.Null; +// https://github.com/microsoft/TypeScript/blob/42aa18bf442c4df147e30deaf27261a41cbdc617/src/compiler/types.ts#L5187 +const ObjectFlagsType = ts.TypeFlags.Any | + Nullable | + ts.TypeFlags.Never | + ts.TypeFlags.Object | + ts.TypeFlags.Union | + ts.TypeFlags.Intersection; +function isTypeReferenceType(type) { + if ((type.flags & ObjectFlagsType) === 0) { + return false; + } + const objectTypeFlags = type.objectFlags; + return (objectTypeFlags & ts.ObjectFlags.Reference) !== 0; +} +/** + * @returns true if the type is `any` + */ +function isTypeAnyType(type) { + if ((0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.Any)) { + if (type.intrinsicName === 'error') { + log('Found an "error" any type'); + } + return true; + } + return false; +} +/** + * @returns true if the type is `any[]` + */ +function isTypeAnyArrayType(type, checker) { + return (checker.isArrayType(type) && + isTypeAnyType(checker.getTypeArguments(type)[0])); +} +/** + * @returns true if the type is `unknown[]` + */ +function isTypeUnknownArrayType(type, checker) { + return (checker.isArrayType(type) && + isTypeUnknownType(checker.getTypeArguments(type)[0])); +} +/** + * @returns Whether a type is an instance of the parent type, including for the parent's base types. + */ +function typeIsOrHasBaseType(type, parentType) { + const parentSymbol = parentType.getSymbol(); + if (!type.getSymbol() || !parentSymbol) { + return false; + } + const typeAndBaseTypes = [type]; + const ancestorTypes = type.getBaseTypes(); + if (ancestorTypes) { + typeAndBaseTypes.push(...ancestorTypes); + } + for (const baseType of typeAndBaseTypes) { + const baseSymbol = baseType.getSymbol(); + if (baseSymbol?.name === parentSymbol.name) { + return true; + } + } + return false; +} +function isTypeBigIntLiteralType(type) { + return (0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.BigIntLiteral); +} +function isTypeTemplateLiteralType(type) { + return (0, typeFlagUtils_1.isTypeFlagSet)(type, ts.TypeFlags.TemplateLiteral); +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d76768bc4da8b2dac7fb07f1d07d48a1202d6d7e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.d.ts @@ -0,0 +1,3 @@ +import type * as ts from 'typescript'; +export declare function getTypeOfPropertyOfName(checker: ts.TypeChecker, type: ts.Type, name: string, escapedName?: ts.__String): ts.Type | undefined; +export declare function getTypeOfPropertyOfType(checker: ts.TypeChecker, type: ts.Type, property: ts.Symbol): ts.Type | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.js new file mode 100644 index 0000000000000000000000000000000000000000..d2c95a69f4eb5c82f9bd48fde8817f458d595960 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/propertyTypes.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTypeOfPropertyOfName = getTypeOfPropertyOfName; +exports.getTypeOfPropertyOfType = getTypeOfPropertyOfType; +function getTypeOfPropertyOfName(checker, type, name, escapedName) { + // Most names are directly usable in the checker and aren't different from escaped names + if (!escapedName || !isSymbol(escapedName)) { + return checker.getTypeOfPropertyOfType(type, name); + } + // Symbolic names may differ in their escaped name compared to their human-readable name + // https://github.com/typescript-eslint/typescript-eslint/issues/2143 + const escapedProperty = type + .getProperties() + .find(property => property.escapedName === escapedName); + return escapedProperty + ? checker.getDeclaredTypeOfSymbol(escapedProperty) + : undefined; +} +function getTypeOfPropertyOfType(checker, type, property) { + return getTypeOfPropertyOfName(checker, type, property.getName(), property.getEscapedName()); +} +// Symbolic names need to be specially handled because TS api is not sufficient for these cases. +// Source based on: +// https://github.com/microsoft/TypeScript/blob/0043abe982aae0d35f8df59f9715be6ada758ff7/src/compiler/utilities.ts#L3388-L3402 +function isSymbol(escapedName) { + return isKnownSymbol(escapedName) || isPrivateIdentifierSymbol(escapedName); +} +// case for escapedName: "__@foo@10", name: "__@foo@10" +function isKnownSymbol(escapedName) { + return escapedName.startsWith('__@'); +} +// case for escapedName: "__#1@#foo", name: "#foo" +function isPrivateIdentifierSymbol(escapedName) { + return escapedName.startsWith('__#'); +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e72f09900c95079d549c6a6841e5accb192b29de --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.d.ts @@ -0,0 +1,3 @@ +import * as ts from 'typescript'; +/*** Indicates whether identifiers require the use of quotation marks when accessing property definitions and dot notation. */ +export declare function requiresQuoting(name: string, target?: ts.ScriptTarget): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.js new file mode 100644 index 0000000000000000000000000000000000000000..1f2b379b2f15cf332baadd6c7d6c655c92966d86 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/requiresQuoting.js @@ -0,0 +1,52 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.requiresQuoting = requiresQuoting; +const ts = __importStar(require("typescript")); +/*** Indicates whether identifiers require the use of quotation marks when accessing property definitions and dot notation. */ +function requiresQuoting(name, target = ts.ScriptTarget.ESNext) { + if (name.length === 0) { + return true; + } + if (!ts.isIdentifierStart(name.charCodeAt(0), target)) { + return true; + } + for (let i = 1; i < name.length; i += 1) { + if (!ts.isIdentifierPart(name.charCodeAt(i), target)) { + return true; + } + } + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2cb433e687d1314586f37ad5b434571d185065be --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.d.ts @@ -0,0 +1,17 @@ +import * as ts from 'typescript'; +/** + * Gets all of the type flags in a type, iterating through unions automatically. + */ +export declare function getTypeFlags(type: ts.Type): ts.TypeFlags; +/** + * @param flagsToCheck The composition of one or more `ts.TypeFlags`. + * @param isReceiver Whether the type is a receiving type (e.g. the type of a + * called function's parameter). + * @remarks + * Note that if the type is a union, this function will decompose it into the + * parts and get the flags of every union constituent. If this is not desired, + * use the `isTypeFlag` function from tsutils. + */ +export declare function isTypeFlagSet(type: ts.Type, flagsToCheck: ts.TypeFlags, +/** @deprecated This params is not used and will be removed in the future.*/ +isReceiver?: boolean): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..6310209697197ee3560da8643053cefb271e4712 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeFlagUtils.js @@ -0,0 +1,70 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getTypeFlags = getTypeFlags; +exports.isTypeFlagSet = isTypeFlagSet; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const ANY_OR_UNKNOWN = ts.TypeFlags.Any | ts.TypeFlags.Unknown; +/** + * Gets all of the type flags in a type, iterating through unions automatically. + */ +function getTypeFlags(type) { + // @ts-expect-error Since typescript 5.0, this is invalid, but uses 0 as the default value of TypeFlags. + let flags = 0; + for (const t of tsutils.unionConstituents(type)) { + flags |= t.flags; + } + return flags; +} +/** + * @param flagsToCheck The composition of one or more `ts.TypeFlags`. + * @param isReceiver Whether the type is a receiving type (e.g. the type of a + * called function's parameter). + * @remarks + * Note that if the type is a union, this function will decompose it into the + * parts and get the flags of every union constituent. If this is not desired, + * use the `isTypeFlag` function from tsutils. + */ +function isTypeFlagSet(type, flagsToCheck, +/** @deprecated This params is not used and will be removed in the future.*/ +isReceiver) { + const flags = getTypeFlags(type); + // eslint-disable-next-line @typescript-eslint/no-deprecated -- not used + if (isReceiver && flags & ANY_OR_UNKNOWN) { + return true; + } + return (flags & flagsToCheck) !== 0; +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..933a8aa22e69541ff7bf0f76b21ebc8fe57afbc8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.d.ts @@ -0,0 +1,2 @@ +import type * as ts from 'typescript'; +export declare function specifierNameMatches(type: ts.Type, names: string | string[]): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.js new file mode 100644 index 0000000000000000000000000000000000000000..ac91b763628e3593084af6a11eeecfd5451dca4f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/specifierNameMatches.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.specifierNameMatches = specifierNameMatches; +function specifierNameMatches(type, names) { + if (typeof names === 'string') { + names = [names]; + } + const symbol = type.aliasSymbol ?? type.getSymbol(); + const candidateNames = symbol + ? [symbol.escapedName, type.intrinsicName] + : [type.intrinsicName]; + if (names.some(item => candidateNames.includes(item))) { + return true; + } + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b78c4031e7596a01a716c2bc6602910e162987f7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.d.ts @@ -0,0 +1,2 @@ +import type * as ts from 'typescript'; +export declare function typeDeclaredInFile(relativePath: string | undefined, declarationFiles: ts.SourceFile[], program: ts.Program): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.js new file mode 100644 index 0000000000000000000000000000000000000000..953064940c066228b1b67a55eeed480bca7d974b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInFile.js @@ -0,0 +1,16 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeDeclaredInFile = typeDeclaredInFile; +const typescript_estree_1 = require("@typescript-eslint/typescript-estree"); +const node_path_1 = __importDefault(require("node:path")); +function typeDeclaredInFile(relativePath, declarationFiles, program) { + if (relativePath == null) { + const cwd = (0, typescript_estree_1.getCanonicalFileName)(program.getCurrentDirectory()); + return declarationFiles.some(declaration => (0, typescript_estree_1.getCanonicalFileName)(declaration.fileName).startsWith(cwd)); + } + const absolutePath = (0, typescript_estree_1.getCanonicalFileName)(node_path_1.default.join(program.getCurrentDirectory(), relativePath)); + return declarationFiles.some(declaration => (0, typescript_estree_1.getCanonicalFileName)(declaration.fileName) === absolutePath); +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c470f92b4210ea893e35253d1db94f7a7e497bb0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.d.ts @@ -0,0 +1,2 @@ +import type * as ts from 'typescript'; +export declare function typeDeclaredInLib(declarationFiles: ts.SourceFile[], program: ts.Program): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.js new file mode 100644 index 0000000000000000000000000000000000000000..e25031a13d7f9b43fdff6611c8b9a3e718035e34 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInLib.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeDeclaredInLib = typeDeclaredInLib; +function typeDeclaredInLib(declarationFiles, program) { + // Assertion: The type is not an error type. + // Intrinsic type (i.e. string, number, boolean, etc) - Treat it as if it's from lib. + if (declarationFiles.length === 0) { + return true; + } + return declarationFiles.some(declaration => program.isSourceFileDefaultLibrary(declaration)); +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.d.ts b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..556d15000a5e6bd7624674f6633262e3ee4687ef --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.d.ts @@ -0,0 +1,2 @@ +import * as ts from 'typescript'; +export declare function typeDeclaredInPackageDeclarationFile(packageName: string, declarations: ts.Node[], declarationFiles: ts.SourceFile[], program: ts.Program): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.js b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.js new file mode 100644 index 0000000000000000000000000000000000000000..f51b2a1d54bd32a9e20a1269a83fffab19b12b1f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/dist/typeOrValueSpecifiers/typeDeclaredInPackageDeclarationFile.js @@ -0,0 +1,70 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typeDeclaredInPackageDeclarationFile = typeDeclaredInPackageDeclarationFile; +const ts = __importStar(require("typescript")); +function findParentModuleDeclaration(node) { + switch (node.kind) { + case ts.SyntaxKind.ModuleDeclaration: + // "namespace x {...}" should be ignored here + if (node.flags & ts.NodeFlags.Namespace) { + break; + } + return ts.isStringLiteral(node.name) + ? node + : undefined; + case ts.SyntaxKind.SourceFile: + return undefined; + } + return findParentModuleDeclaration(node.parent); +} +function typeDeclaredInDeclareModule(packageName, declarations) { + return declarations.some(declaration => findParentModuleDeclaration(declaration)?.name.text === packageName); +} +function typeDeclaredInDeclarationFile(packageName, declarationFiles, program) { + // Handle scoped packages: if the name starts with @, remove it and replace / with __ + const typesPackageName = packageName.replace(/^@([^/]+)\//, '$1__'); + const matcher = new RegExp(`${packageName}|${typesPackageName}`); + return declarationFiles.some(declaration => { + const packageIdName = program.sourceFileToPackageName.get(declaration.path); + return (packageIdName != null && + matcher.test(packageIdName) && + program.isSourceFileFromExternalLibrary(declaration)); + }); +} +function typeDeclaredInPackageDeclarationFile(packageName, declarations, declarationFiles, program) { + return (typeDeclaredInDeclareModule(packageName, declarations) || + typeDeclaredInDeclarationFile(packageName, declarationFiles, program)); +} diff --git a/tools/ui/node_modules/@typescript-eslint/type-utils/package.json b/tools/ui/node_modules/@typescript-eslint/type-utils/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d7e4c95802e5e50ede64d22cce04d9420f5c2689 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/type-utils/package.json @@ -0,0 +1,85 @@ +{ + "name": "@typescript-eslint/type-utils", + "version": "8.60.1", + "description": "Type utilities for working with TypeScript + ESLint together", + "files": [ + "dist", + "!**/*.tsbuildinfo", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/type-utils" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io", + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "dependencies": { + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0", + "@typescript-eslint/typescript-estree": "8.60.1", + "@typescript-eslint/utils": "8.60.1", + "@typescript-eslint/types": "8.60.1" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + }, + "devDependencies": { + "@types/babel__code-frame": "^7.0.6", + "@typescript/native-preview": "7.0.0-dev.20260518.1", + "@vitest/coverage-v8": "^4.0.18", + "ajv": "^6.12.6", + "eslint": "^10.0.0", + "rimraf": "^5.0.10", + "typescript": ">=4.8.4 <6.1.0", + "vitest": "^4.0.18", + "@typescript-eslint/parser": "8.60.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "type-utils", + "includedScripts": [ + "clean" + ], + "targets": { + "lint": { + "command": "eslint" + }, + "typecheck:tsgo": {} + } + }, + "scripts": { + "build": "pnpm exec nx build", + "clean": "rimraf dist/ coverage/", + "format": "pnpm -w run format", + "lint": "pnpm -w exec nx lint", + "test": "pnpm -w exec nx test", + "typecheck": "pnpm -w exec nx typecheck", + "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/types/LICENSE b/tools/ui/node_modules/@typescript-eslint/types/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a1164108d4d6037cb976384c16e5493917d87157 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/@typescript-eslint/types/README.md b/tools/ui/node_modules/@typescript-eslint/types/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7a3008bb982abdf588b84c49a662f79e01957342 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/README.md @@ -0,0 +1,12 @@ +# `@typescript-eslint/types` + +> Types for the TypeScript-ESTree AST spec + +This package exists to help us reduce cycles and provide lighter-weight packages at runtime. + +## ✋ Internal Package + +This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint). +You likely don't want to use it directly. + +👉 See **https://typescript-eslint.io** for docs on typescript-eslint. diff --git a/tools/ui/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts b/tools/ui/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a153a74c3e926ecdd413dc6d400091779172165b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts @@ -0,0 +1,2163 @@ +/********************************************** + * DO NOT MODIFY THIS FILE MANUALLY * + * * + * THIS FILE HAS BEEN COPIED FROM ast-spec. * + * ANY CHANGES WILL BE LOST ON THE NEXT BUILD * + * * + * MAKE CHANGES TO ast-spec AND THEN RUN * + * pnpm run build * + **********************************************/ +import type { SyntaxKind } from 'typescript'; +export declare type Accessibility = 'private' | 'protected' | 'public'; +export declare type AccessorProperty = AccessorPropertyComputedName | AccessorPropertyNonComputedName; +export declare interface AccessorPropertyComputedName extends PropertyDefinitionComputedNameBase { + type: AST_NODE_TYPES.AccessorProperty; +} +export declare interface AccessorPropertyNonComputedName extends PropertyDefinitionNonComputedNameBase { + type: AST_NODE_TYPES.AccessorProperty; +} +export declare interface ArrayExpression extends BaseNode { + type: AST_NODE_TYPES.ArrayExpression; + /** + * an element will be `null` in the case of a sparse array: `[1, ,3]` + */ + elements: (Expression | SpreadElement | null)[]; +} +export declare interface ArrayPattern extends BaseNode { + type: AST_NODE_TYPES.ArrayPattern; + decorators: Decorator[]; + elements: (DestructuringPattern | null)[]; + optional: boolean; + typeAnnotation: TSTypeAnnotation | undefined; +} +export declare interface ArrowFunctionExpression extends BaseNode { + type: AST_NODE_TYPES.ArrowFunctionExpression; + async: boolean; + body: BlockStatement | Expression; + expression: boolean; + generator: false; + id: null; + params: Parameter[]; + returnType: TSTypeAnnotation | undefined; + typeParameters: TSTypeParameterDeclaration | undefined; +} +export declare interface AssignmentExpression extends BaseNode { + type: AST_NODE_TYPES.AssignmentExpression; + left: Expression; + operator: ValueOf; + right: Expression; +} +export declare interface AssignmentOperatorToText { + [SyntaxKind.AmpersandAmpersandEqualsToken]: '&&='; + [SyntaxKind.AmpersandEqualsToken]: '&='; + [SyntaxKind.AsteriskAsteriskEqualsToken]: '**='; + [SyntaxKind.AsteriskEqualsToken]: '*='; + [SyntaxKind.BarBarEqualsToken]: '||='; + [SyntaxKind.BarEqualsToken]: '|='; + [SyntaxKind.CaretEqualsToken]: '^='; + [SyntaxKind.EqualsToken]: '='; + [SyntaxKind.GreaterThanGreaterThanEqualsToken]: '>>='; + [SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken]: '>>>='; + [SyntaxKind.LessThanLessThanEqualsToken]: '<<='; + [SyntaxKind.MinusEqualsToken]: '-='; + [SyntaxKind.PercentEqualsToken]: '%='; + [SyntaxKind.PlusEqualsToken]: '+='; + [SyntaxKind.QuestionQuestionEqualsToken]: '??='; + [SyntaxKind.SlashEqualsToken]: '/='; +} +export declare interface AssignmentPattern extends BaseNode { + type: AST_NODE_TYPES.AssignmentPattern; + decorators: Decorator[]; + left: BindingName; + optional: boolean; + right: Expression; + typeAnnotation: TSTypeAnnotation | undefined; +} +export declare enum AST_NODE_TYPES { + AccessorProperty = "AccessorProperty", + ArrayExpression = "ArrayExpression", + ArrayPattern = "ArrayPattern", + ArrowFunctionExpression = "ArrowFunctionExpression", + AssignmentExpression = "AssignmentExpression", + AssignmentPattern = "AssignmentPattern", + AwaitExpression = "AwaitExpression", + BinaryExpression = "BinaryExpression", + BlockStatement = "BlockStatement", + BreakStatement = "BreakStatement", + CallExpression = "CallExpression", + CatchClause = "CatchClause", + ChainExpression = "ChainExpression", + ClassBody = "ClassBody", + ClassDeclaration = "ClassDeclaration", + ClassExpression = "ClassExpression", + ConditionalExpression = "ConditionalExpression", + ContinueStatement = "ContinueStatement", + DebuggerStatement = "DebuggerStatement", + Decorator = "Decorator", + DoWhileStatement = "DoWhileStatement", + EmptyStatement = "EmptyStatement", + ExportAllDeclaration = "ExportAllDeclaration", + ExportDefaultDeclaration = "ExportDefaultDeclaration", + ExportNamedDeclaration = "ExportNamedDeclaration", + ExportSpecifier = "ExportSpecifier", + ExpressionStatement = "ExpressionStatement", + ForInStatement = "ForInStatement", + ForOfStatement = "ForOfStatement", + ForStatement = "ForStatement", + FunctionDeclaration = "FunctionDeclaration", + FunctionExpression = "FunctionExpression", + Identifier = "Identifier", + IfStatement = "IfStatement", + ImportAttribute = "ImportAttribute", + ImportDeclaration = "ImportDeclaration", + ImportDefaultSpecifier = "ImportDefaultSpecifier", + ImportExpression = "ImportExpression", + ImportNamespaceSpecifier = "ImportNamespaceSpecifier", + ImportSpecifier = "ImportSpecifier", + JSXAttribute = "JSXAttribute", + JSXClosingElement = "JSXClosingElement", + JSXClosingFragment = "JSXClosingFragment", + JSXElement = "JSXElement", + JSXEmptyExpression = "JSXEmptyExpression", + JSXExpressionContainer = "JSXExpressionContainer", + JSXFragment = "JSXFragment", + JSXIdentifier = "JSXIdentifier", + JSXMemberExpression = "JSXMemberExpression", + JSXNamespacedName = "JSXNamespacedName", + JSXOpeningElement = "JSXOpeningElement", + JSXOpeningFragment = "JSXOpeningFragment", + JSXSpreadAttribute = "JSXSpreadAttribute", + JSXSpreadChild = "JSXSpreadChild", + JSXText = "JSXText", + LabeledStatement = "LabeledStatement", + Literal = "Literal", + LogicalExpression = "LogicalExpression", + MemberExpression = "MemberExpression", + MetaProperty = "MetaProperty", + MethodDefinition = "MethodDefinition", + NewExpression = "NewExpression", + ObjectExpression = "ObjectExpression", + ObjectPattern = "ObjectPattern", + PrivateIdentifier = "PrivateIdentifier", + Program = "Program", + Property = "Property", + PropertyDefinition = "PropertyDefinition", + RestElement = "RestElement", + ReturnStatement = "ReturnStatement", + SequenceExpression = "SequenceExpression", + SpreadElement = "SpreadElement", + StaticBlock = "StaticBlock", + Super = "Super", + SwitchCase = "SwitchCase", + SwitchStatement = "SwitchStatement", + TaggedTemplateExpression = "TaggedTemplateExpression", + TemplateElement = "TemplateElement", + TemplateLiteral = "TemplateLiteral", + ThisExpression = "ThisExpression", + ThrowStatement = "ThrowStatement", + TryStatement = "TryStatement", + UnaryExpression = "UnaryExpression", + UpdateExpression = "UpdateExpression", + VariableDeclaration = "VariableDeclaration", + VariableDeclarator = "VariableDeclarator", + WhileStatement = "WhileStatement", + WithStatement = "WithStatement", + YieldExpression = "YieldExpression", + TSAbstractAccessorProperty = "TSAbstractAccessorProperty", + TSAbstractKeyword = "TSAbstractKeyword", + TSAbstractMethodDefinition = "TSAbstractMethodDefinition", + TSAbstractPropertyDefinition = "TSAbstractPropertyDefinition", + TSAnyKeyword = "TSAnyKeyword", + TSArrayType = "TSArrayType", + TSAsExpression = "TSAsExpression", + TSAsyncKeyword = "TSAsyncKeyword", + TSBigIntKeyword = "TSBigIntKeyword", + TSBooleanKeyword = "TSBooleanKeyword", + TSCallSignatureDeclaration = "TSCallSignatureDeclaration", + TSClassImplements = "TSClassImplements", + TSConditionalType = "TSConditionalType", + TSConstructorType = "TSConstructorType", + TSConstructSignatureDeclaration = "TSConstructSignatureDeclaration", + TSDeclareFunction = "TSDeclareFunction", + TSDeclareKeyword = "TSDeclareKeyword", + TSEmptyBodyFunctionExpression = "TSEmptyBodyFunctionExpression", + TSEnumBody = "TSEnumBody", + TSEnumDeclaration = "TSEnumDeclaration", + TSEnumMember = "TSEnumMember", + TSExportAssignment = "TSExportAssignment", + TSExportKeyword = "TSExportKeyword", + TSExternalModuleReference = "TSExternalModuleReference", + TSFunctionType = "TSFunctionType", + TSImportEqualsDeclaration = "TSImportEqualsDeclaration", + TSImportType = "TSImportType", + TSIndexedAccessType = "TSIndexedAccessType", + TSIndexSignature = "TSIndexSignature", + TSInferType = "TSInferType", + TSInstantiationExpression = "TSInstantiationExpression", + TSInterfaceBody = "TSInterfaceBody", + TSInterfaceDeclaration = "TSInterfaceDeclaration", + TSInterfaceHeritage = "TSInterfaceHeritage", + TSIntersectionType = "TSIntersectionType", + TSIntrinsicKeyword = "TSIntrinsicKeyword", + TSLiteralType = "TSLiteralType", + TSMappedType = "TSMappedType", + TSMethodSignature = "TSMethodSignature", + TSModuleBlock = "TSModuleBlock", + TSModuleDeclaration = "TSModuleDeclaration", + TSNamedTupleMember = "TSNamedTupleMember", + TSNamespaceExportDeclaration = "TSNamespaceExportDeclaration", + TSNeverKeyword = "TSNeverKeyword", + TSNonNullExpression = "TSNonNullExpression", + TSNullKeyword = "TSNullKeyword", + TSNumberKeyword = "TSNumberKeyword", + TSObjectKeyword = "TSObjectKeyword", + TSOptionalType = "TSOptionalType", + TSParameterProperty = "TSParameterProperty", + TSPrivateKeyword = "TSPrivateKeyword", + TSPropertySignature = "TSPropertySignature", + TSProtectedKeyword = "TSProtectedKeyword", + TSPublicKeyword = "TSPublicKeyword", + TSQualifiedName = "TSQualifiedName", + TSReadonlyKeyword = "TSReadonlyKeyword", + TSRestType = "TSRestType", + TSSatisfiesExpression = "TSSatisfiesExpression", + TSStaticKeyword = "TSStaticKeyword", + TSStringKeyword = "TSStringKeyword", + TSSymbolKeyword = "TSSymbolKeyword", + TSTemplateLiteralType = "TSTemplateLiteralType", + TSThisType = "TSThisType", + TSTupleType = "TSTupleType", + TSTypeAliasDeclaration = "TSTypeAliasDeclaration", + TSTypeAnnotation = "TSTypeAnnotation", + TSTypeAssertion = "TSTypeAssertion", + TSTypeLiteral = "TSTypeLiteral", + TSTypeOperator = "TSTypeOperator", + TSTypeParameter = "TSTypeParameter", + TSTypeParameterDeclaration = "TSTypeParameterDeclaration", + TSTypeParameterInstantiation = "TSTypeParameterInstantiation", + TSTypePredicate = "TSTypePredicate", + TSTypeQuery = "TSTypeQuery", + TSTypeReference = "TSTypeReference", + TSUndefinedKeyword = "TSUndefinedKeyword", + TSUnionType = "TSUnionType", + TSUnknownKeyword = "TSUnknownKeyword", + TSVoidKeyword = "TSVoidKeyword" +} +export declare enum AST_TOKEN_TYPES { + Boolean = "Boolean", + Identifier = "Identifier", + JSXIdentifier = "JSXIdentifier", + PrivateIdentifier = "PrivateIdentifier", + JSXText = "JSXText", + Keyword = "Keyword", + Null = "Null", + Numeric = "Numeric", + Punctuator = "Punctuator", + RegularExpression = "RegularExpression", + String = "String", + Template = "Template", + Block = "Block", + Line = "Line" +} +export declare interface AwaitExpression extends BaseNode { + type: AST_NODE_TYPES.AwaitExpression; + argument: Expression; +} +export declare interface BaseNode extends NodeOrTokenData { + type: AST_NODE_TYPES; +} +declare interface BaseToken extends NodeOrTokenData { + type: AST_TOKEN_TYPES; + value: string; +} +export declare interface BigIntLiteral extends LiteralBase { + bigint: string; + value: bigint | null; +} +export declare type BinaryExpression = PrivateInExpression | SymmetricBinaryExpression; +export declare interface BinaryOperatorToText { + [SyntaxKind.AmpersandAmpersandToken]: '&&'; + [SyntaxKind.AmpersandToken]: '&'; + [SyntaxKind.AsteriskAsteriskToken]: '**'; + [SyntaxKind.AsteriskToken]: '*'; + [SyntaxKind.BarBarToken]: '||'; + [SyntaxKind.BarToken]: '|'; + [SyntaxKind.CaretToken]: '^'; + [SyntaxKind.EqualsEqualsEqualsToken]: '==='; + [SyntaxKind.EqualsEqualsToken]: '=='; + [SyntaxKind.ExclamationEqualsEqualsToken]: '!=='; + [SyntaxKind.ExclamationEqualsToken]: '!='; + [SyntaxKind.GreaterThanEqualsToken]: '>='; + [SyntaxKind.GreaterThanGreaterThanGreaterThanToken]: '>>>'; + [SyntaxKind.GreaterThanGreaterThanToken]: '>>'; + [SyntaxKind.GreaterThanToken]: '>'; + [SyntaxKind.InKeyword]: 'in'; + [SyntaxKind.InstanceOfKeyword]: 'instanceof'; + [SyntaxKind.LessThanEqualsToken]: '<='; + [SyntaxKind.LessThanLessThanToken]: '<<'; + [SyntaxKind.LessThanToken]: '<'; + [SyntaxKind.MinusToken]: '-'; + [SyntaxKind.PercentToken]: '%'; + [SyntaxKind.PlusToken]: '+'; + [SyntaxKind.SlashToken]: '/'; +} +export declare type BindingName = BindingPattern | Identifier; +export declare type BindingPattern = ArrayPattern | ObjectPattern; +export declare interface BlockComment extends BaseToken { + type: AST_TOKEN_TYPES.Block; +} +export declare interface BlockStatement extends BaseNode { + type: AST_NODE_TYPES.BlockStatement; + body: Statement[]; +} +export declare interface BooleanLiteral extends LiteralBase { + raw: 'false' | 'true'; + value: boolean; +} +export declare interface BooleanToken extends BaseToken { + type: AST_TOKEN_TYPES.Boolean; +} +export declare interface BreakStatement extends BaseNode { + type: AST_NODE_TYPES.BreakStatement; + label: Identifier | null; +} +export declare interface CallExpression extends BaseNode { + type: AST_NODE_TYPES.CallExpression; + arguments: CallExpressionArgument[]; + callee: Expression; + optional: boolean; + typeArguments: TSTypeParameterInstantiation | undefined; +} +export declare type CallExpressionArgument = Expression | SpreadElement; +export declare interface CatchClause extends BaseNode { + type: AST_NODE_TYPES.CatchClause; + body: BlockStatement; + param: BindingName | null; +} +export declare type ChainElement = CallExpression | MemberExpression | TSNonNullExpression; +export declare interface ChainExpression extends BaseNode { + type: AST_NODE_TYPES.ChainExpression; + expression: ChainElement; +} +declare interface ClassBase extends BaseNode { + /** + * Whether the class is an abstract class. + * @example + * ```ts + * abstract class Foo {} + * ``` + */ + abstract: boolean; + /** + * The class body. + */ + body: ClassBody; + /** + * Whether the class has been `declare`d: + * @example + * ```ts + * declare class Foo {} + * ``` + */ + declare: boolean; + /** + * The decorators declared for the class. + * @example + * ```ts + * @deco + * class Foo {} + * ``` + */ + decorators: Decorator[]; + /** + * The class's name. + * - For a `ClassExpression` this may be `null` if the name is omitted. + * - For a `ClassDeclaration` this may be `null` if and only if the parent is + * an `ExportDefaultDeclaration`. + */ + id: Identifier | null; + /** + * The implemented interfaces for the class. + */ + implements: TSClassImplements[]; + /** + * The super class this class extends. + */ + superClass: LeftHandSideExpression | null; + /** + * The generic type parameters passed to the superClass. + */ + superTypeArguments: TSTypeParameterInstantiation | undefined; + /** + * The generic type parameters declared for the class. + */ + typeParameters: TSTypeParameterDeclaration | undefined; +} +export declare interface ClassBody extends BaseNode { + type: AST_NODE_TYPES.ClassBody; + body: ClassElement[]; +} +export declare type ClassDeclaration = ClassDeclarationWithName | ClassDeclarationWithOptionalName; +declare interface ClassDeclarationBase extends ClassBase { + type: AST_NODE_TYPES.ClassDeclaration; +} +/** + * A normal class declaration: + * ``` + * class A {} + * ``` + */ +export declare interface ClassDeclarationWithName extends ClassDeclarationBase { + id: Identifier; +} +/** + * Default-exported class declarations have optional names: + * ``` + * export default class {} + * ``` + */ +export declare interface ClassDeclarationWithOptionalName extends ClassDeclarationBase { + id: Identifier | null; +} +export declare type ClassElement = AccessorProperty | MethodDefinition | PropertyDefinition | StaticBlock | TSAbstractAccessorProperty | TSAbstractMethodDefinition | TSAbstractPropertyDefinition | TSIndexSignature; +export declare interface ClassExpression extends ClassBase { + type: AST_NODE_TYPES.ClassExpression; + abstract: false; + declare: false; +} +declare interface ClassMethodDefinitionNonComputedNameBase extends MethodDefinitionBase { + computed: false; + key: ClassPropertyNameNonComputed; +} +declare interface ClassPropertyDefinitionNonComputedNameBase extends PropertyDefinitionBase { + computed: false; + key: ClassPropertyNameNonComputed; +} +export declare type ClassPropertyNameNonComputed = PrivateIdentifier | PropertyNameNonComputed; +export declare type Comment = BlockComment | LineComment; +export declare interface ConditionalExpression extends BaseNode { + type: AST_NODE_TYPES.ConditionalExpression; + alternate: Expression; + consequent: Expression; + test: Expression; +} +export declare interface ConstDeclaration extends LetOrConstOrVarDeclarationBase { + /** + * In a `declare const` declaration, the declarators may have initializers, but + * not definite assignment assertions. Each declarator cannot have both an + * initializer and a type annotation. + * + * Even if the declaration has no `declare`, it may still be ambient and have + * no initializer. + */ + declarations: VariableDeclaratorMaybeInit[]; + kind: 'const'; +} +export declare interface ContinueStatement extends BaseNode { + type: AST_NODE_TYPES.ContinueStatement; + label: Identifier | null; +} +export declare interface DebuggerStatement extends BaseNode { + type: AST_NODE_TYPES.DebuggerStatement; +} +/** + * @deprecated + * Note that this is neither up to date nor fully correct. + */ +export declare type DeclarationStatement = ClassDeclaration | ClassExpression | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | FunctionDeclaration | TSDeclareFunction | TSEnumDeclaration | TSImportEqualsDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSNamespaceExportDeclaration | TSTypeAliasDeclaration; +export declare interface Decorator extends BaseNode { + type: AST_NODE_TYPES.Decorator; + expression: LeftHandSideExpression; +} +export declare type DefaultExportDeclarations = ClassDeclarationWithOptionalName | Expression | FunctionDeclarationWithName | FunctionDeclarationWithOptionalName | TSDeclareFunction | TSEnumDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSTypeAliasDeclaration | VariableDeclaration; +export declare type DestructuringPattern = ArrayPattern | AssignmentPattern | Identifier | MemberExpression | ObjectPattern | RestElement; +export declare interface DoWhileStatement extends BaseNode { + type: AST_NODE_TYPES.DoWhileStatement; + body: Statement; + test: Expression; +} +export declare interface EmptyStatement extends BaseNode { + type: AST_NODE_TYPES.EmptyStatement; +} +export declare type EntityName = Identifier | ThisExpression | TSQualifiedName; +export declare interface ExportAllDeclaration extends BaseNode { + type: AST_NODE_TYPES.ExportAllDeclaration; + /** + * The assertions declared for the export. + * @example + * ```ts + * export * from 'mod' assert \{ type: 'json' \}; + * ``` + * @deprecated Replaced with {@link `attributes`}. + */ + assertions: ImportAttribute[]; + /** + * The attributes declared for the export. + * @example + * ```ts + * export * from 'mod' with \{ type: 'json' \}; + * ``` + */ + attributes: ImportAttribute[]; + /** + * The name for the exported items (`as X`). `null` if no name is assigned. + */ + exported: Identifier | null; + /** + * The kind of the export. + */ + exportKind: ExportKind; + /** + * The source module being exported from. + */ + source: StringLiteral; +} +declare type ExportAndImportKind = 'type' | 'value'; +export declare type ExportDeclaration = DefaultExportDeclarations | NamedExportDeclarations; +export declare interface ExportDefaultDeclaration extends BaseNode { + type: AST_NODE_TYPES.ExportDefaultDeclaration; + /** + * The declaration being exported. + */ + declaration: DefaultExportDeclarations; + /** + * The kind of the export. Always `value` for default exports. + */ + exportKind: 'value'; +} +declare type ExportKind = ExportAndImportKind; +export declare type ExportNamedDeclaration = ExportNamedDeclarationWithoutSourceWithMultiple | ExportNamedDeclarationWithoutSourceWithSingle | ExportNamedDeclarationWithSource; +declare interface ExportNamedDeclarationBase extends BaseNode { + type: AST_NODE_TYPES.ExportNamedDeclaration; + /** + * The assertions declared for the export. + * @example + * ```ts + * export { foo } from 'mod' assert \{ type: 'json' \}; + * ``` + * This will be an empty array if `source` is `null` + * @deprecated Replaced with {@link `attributes`}. + */ + assertions: ImportAttribute[]; + /** + * The attributes declared for the export. + * @example + * ```ts + * export { foo } from 'mod' with \{ type: 'json' \}; + * ``` + * This will be an empty array if `source` is `null` + */ + attributes: ImportAttribute[]; + /** + * The exported declaration. + * @example + * ```ts + * export const x = 1; + * ``` + * This will be `null` if `source` is not `null`, or if there are `specifiers` + */ + declaration: NamedExportDeclarations | null; + /** + * The kind of the export. + */ + exportKind: ExportKind; + /** + * The source module being exported from. + */ + source: StringLiteral | null; + /** + * The specifiers being exported. + * @example + * ```ts + * export { a, b }; + * ``` + * This will be an empty array if `declaration` is not `null` + */ + specifiers: ExportSpecifier[]; +} +export declare type ExportNamedDeclarationWithoutSource = ExportNamedDeclarationWithoutSourceWithMultiple | ExportNamedDeclarationWithoutSourceWithSingle; +/** + * Exporting names from the current module. + * ``` + * export {}; + * export { a, b }; + * ``` + */ +export declare interface ExportNamedDeclarationWithoutSourceWithMultiple extends ExportNamedDeclarationBase { + /** + * This will always be an empty array. + * @deprecated Replaced with {@link `attributes`}. + */ + assertions: ImportAttribute[]; + /** + * This will always be an empty array. + */ + attributes: ImportAttribute[]; + declaration: null; + source: null; + specifiers: ExportSpecifierWithIdentifierLocal[]; +} +/** + * Exporting a single named declaration. + * ``` + * export const x = 1; + * ``` + */ +export declare interface ExportNamedDeclarationWithoutSourceWithSingle extends ExportNamedDeclarationBase { + /** + * This will always be an empty array. + * @deprecated Replaced with {@link `attributes`}. + */ + assertions: ImportAttribute[]; + /** + * This will always be an empty array. + */ + attributes: ImportAttribute[]; + declaration: NamedExportDeclarations; + source: null; + /** + * This will always be an empty array. + */ + specifiers: ExportSpecifierWithIdentifierLocal[]; +} +/** + * Export names from another module. + * ``` + * export { a, b } from 'mod'; + * ``` + */ +export declare interface ExportNamedDeclarationWithSource extends ExportNamedDeclarationBase { + declaration: null; + source: StringLiteral; +} +export declare type ExportSpecifier = ExportSpecifierWithIdentifierLocal | ExportSpecifierWithStringOrLiteralLocal; +declare interface ExportSpecifierBase extends BaseNode { + type: AST_NODE_TYPES.ExportSpecifier; + exported: Identifier | StringLiteral; + exportKind: ExportKind; + local: Identifier | StringLiteral; +} +export declare interface ExportSpecifierWithIdentifierLocal extends ExportSpecifierBase { + local: Identifier; +} +export declare interface ExportSpecifierWithStringOrLiteralLocal extends ExportSpecifierBase { + local: Identifier | StringLiteral; +} +export declare type Expression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | ImportExpression | JSXElement | JSXFragment | LiteralExpression | LogicalExpression | MemberExpression | MetaProperty | NewExpression | ObjectExpression | ObjectPattern | SequenceExpression | Super | TaggedTemplateExpression | TemplateLiteral | ThisExpression | TSAsExpression | TSInstantiationExpression | TSNonNullExpression | TSSatisfiesExpression | TSTypeAssertion | UnaryExpression | UpdateExpression | YieldExpression; +export declare interface ExpressionStatement extends BaseNode { + type: AST_NODE_TYPES.ExpressionStatement; + directive: string | undefined; + expression: Expression; +} +export declare type ForInitialiser = Expression | LetOrConstOrVarDeclaration; +export declare interface ForInStatement extends BaseNode { + type: AST_NODE_TYPES.ForInStatement; + body: Statement; + left: ForInitialiser; + right: Expression; +} +declare type ForOfInitialiser = Expression | LetOrConstOrVarDeclaration | UsingInForOfDeclaration; +export declare interface ForOfStatement extends BaseNode { + type: AST_NODE_TYPES.ForOfStatement; + await: boolean; + body: Statement; + left: ForOfInitialiser; + right: Expression; +} +export declare interface ForStatement extends BaseNode { + type: AST_NODE_TYPES.ForStatement; + body: Statement; + init: Expression | ForInitialiser | null; + test: Expression | null; + update: Expression | null; +} +declare interface FunctionBase extends BaseNode { + /** + * Whether the function is async: + * ``` + * async function foo() {} + * const x = async function () {} + * const x = async () => {} + * ``` + */ + async: boolean; + /** + * The body of the function. + * - For an `ArrowFunctionExpression` this may be an `Expression` or `BlockStatement`. + * - For a `FunctionDeclaration` or `FunctionExpression` this is always a `BlockStatement`. + * - For a `TSDeclareFunction` this is always `undefined`. + * - For a `TSEmptyBodyFunctionExpression` this is always `null`. + */ + body: BlockStatement | Expression | null | undefined; + /** + * This is only `true` if and only if the node is a `TSDeclareFunction` and it has `declare`: + * ``` + * declare function foo() {} + * ``` + */ + declare: boolean; + /** + * This is only ever `true` if and only the node is an `ArrowFunctionExpression` and the body + * is an expression: + * ``` + * (() => 1) + * ``` + */ + expression: boolean; + /** + * Whether the function is a generator function: + * ``` + * function *foo() {} + * const x = function *() {} + * ``` + * This is always `false` for arrow functions as they cannot be generators. + */ + generator: boolean; + /** + * The function's name. + * - For an `ArrowFunctionExpression` this is always `null`. + * - For a `FunctionExpression` this may be `null` if the name is omitted. + * - For a `FunctionDeclaration` or `TSDeclareFunction` this may be `null` if + * and only if the parent is an `ExportDefaultDeclaration`. + */ + id: Identifier | null; + /** + * The list of parameters declared for the function. + */ + params: Parameter[]; + /** + * The return type annotation for the function. + */ + returnType: TSTypeAnnotation | undefined; + /** + * The generic type parameter declaration for the function. + */ + typeParameters: TSTypeParameterDeclaration | undefined; +} +export declare type FunctionDeclaration = FunctionDeclarationWithName | FunctionDeclarationWithOptionalName; +declare interface FunctionDeclarationBase extends FunctionBase { + type: AST_NODE_TYPES.FunctionDeclaration; + body: BlockStatement; + declare: false; + expression: false; +} +/** + * A normal function declaration: + * ``` + * function f() {} + * ``` + */ +export declare interface FunctionDeclarationWithName extends FunctionDeclarationBase { + id: Identifier; +} +/** + * Default-exported function declarations have optional names: + * ``` + * export default function () {} + * ``` + */ +export declare interface FunctionDeclarationWithOptionalName extends FunctionDeclarationBase { + id: Identifier | null; +} +export declare interface FunctionExpression extends FunctionBase { + type: AST_NODE_TYPES.FunctionExpression; + body: BlockStatement; + expression: false; +} +export declare type FunctionLike = ArrowFunctionExpression | FunctionDeclaration | FunctionExpression | TSDeclareFunction | TSEmptyBodyFunctionExpression; +export declare interface Identifier extends BaseNode { + type: AST_NODE_TYPES.Identifier; + decorators: Decorator[]; + name: string; + optional: boolean; + typeAnnotation: TSTypeAnnotation | undefined; +} +export declare interface IdentifierToken extends BaseToken { + type: AST_TOKEN_TYPES.Identifier; +} +export declare interface IfStatement extends BaseNode { + type: AST_NODE_TYPES.IfStatement; + alternate: Statement | null; + consequent: Statement; + test: Expression; +} +export declare interface ImportAttribute extends BaseNode { + type: AST_NODE_TYPES.ImportAttribute; + key: Identifier | Literal; + value: Literal; +} +export declare type ImportClause = ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier; +export declare interface ImportDeclaration extends BaseNode { + type: AST_NODE_TYPES.ImportDeclaration; + /** + * The assertions declared for the export. + * @example + * ```ts + * import * from 'mod' assert \{ type: 'json' \}; + * ``` + * @deprecated Replaced with {@link `attributes`}. + */ + assertions: ImportAttribute[]; + /** + * The attributes declared for the export. + * @example + * ```ts + * import * from 'mod' with \{ type: 'json' \}; + * ``` + */ + attributes: ImportAttribute[]; + /** + * The kind of the import. + */ + importKind: ImportKind; + /** + * The source module being imported from. + */ + source: StringLiteral; + /** + * The specifiers being imported. + * If this is an empty array then either there are no specifiers: + * ``` + * import {} from 'mod'; + * ``` + * Or it is a side-effect import: + * ``` + * import 'mod'; + * ``` + */ + specifiers: ImportClause[]; +} +export declare interface ImportDefaultSpecifier extends BaseNode { + type: AST_NODE_TYPES.ImportDefaultSpecifier; + local: Identifier; +} +export declare interface ImportExpression extends BaseNode { + type: AST_NODE_TYPES.ImportExpression; + /** + * The attributes declared for the dynamic import. + * @example + * ```ts + * import('mod', \{ assert: \{ type: 'json' \} \}); + * ``` + * @deprecated Replaced with {@link `options`}. + */ + attributes: Expression | null; + /** + * The options bag declared for the dynamic import. + * @example + * ```ts + * import('mod', \{ assert: \{ type: 'json' \} \}); + * ``` + */ + options: Expression | null; + source: Expression; +} +declare type ImportKind = ExportAndImportKind; +export declare interface ImportNamespaceSpecifier extends BaseNode { + type: AST_NODE_TYPES.ImportNamespaceSpecifier; + local: Identifier; +} +export declare interface ImportSpecifier extends BaseNode { + type: AST_NODE_TYPES.ImportSpecifier; + imported: Identifier | StringLiteral; + importKind: ImportKind; + local: Identifier; +} +export declare type IterationStatement = DoWhileStatement | ForInStatement | ForOfStatement | ForStatement | WhileStatement; +export declare interface JSXAttribute extends BaseNode { + type: AST_NODE_TYPES.JSXAttribute; + name: JSXIdentifier | JSXNamespacedName; + value: JSXElement | JSXExpression | Literal | null; +} +export declare type JSXChild = JSXElement | JSXExpression | JSXFragment | JSXText; +export declare interface JSXClosingElement extends BaseNode { + type: AST_NODE_TYPES.JSXClosingElement; + name: JSXTagNameExpression; +} +export declare interface JSXClosingFragment extends BaseNode { + type: AST_NODE_TYPES.JSXClosingFragment; +} +export declare interface JSXElement extends BaseNode { + type: AST_NODE_TYPES.JSXElement; + children: JSXChild[]; + closingElement: JSXClosingElement | null; + openingElement: JSXOpeningElement; +} +export declare interface JSXEmptyExpression extends BaseNode { + type: AST_NODE_TYPES.JSXEmptyExpression; +} +export declare type JSXExpression = JSXExpressionContainer | JSXSpreadChild; +export declare interface JSXExpressionContainer extends BaseNode { + type: AST_NODE_TYPES.JSXExpressionContainer; + expression: Expression | JSXEmptyExpression; +} +export declare interface JSXFragment extends BaseNode { + type: AST_NODE_TYPES.JSXFragment; + children: JSXChild[]; + closingFragment: JSXClosingFragment; + openingFragment: JSXOpeningFragment; +} +export declare interface JSXIdentifier extends BaseNode { + type: AST_NODE_TYPES.JSXIdentifier; + name: string; +} +export declare interface JSXIdentifierToken extends BaseToken { + type: AST_TOKEN_TYPES.JSXIdentifier; +} +export declare interface JSXMemberExpression extends BaseNode { + type: AST_NODE_TYPES.JSXMemberExpression; + object: JSXTagNameExpression; + property: JSXIdentifier; +} +export declare interface JSXNamespacedName extends BaseNode { + type: AST_NODE_TYPES.JSXNamespacedName; + name: JSXIdentifier; + namespace: JSXIdentifier; +} +export declare interface JSXOpeningElement extends BaseNode { + type: AST_NODE_TYPES.JSXOpeningElement; + attributes: (JSXAttribute | JSXSpreadAttribute)[]; + name: JSXTagNameExpression; + selfClosing: boolean; + typeArguments: TSTypeParameterInstantiation | undefined; +} +export declare interface JSXOpeningFragment extends BaseNode { + type: AST_NODE_TYPES.JSXOpeningFragment; +} +export declare interface JSXSpreadAttribute extends BaseNode { + type: AST_NODE_TYPES.JSXSpreadAttribute; + argument: Expression; +} +export declare interface JSXSpreadChild extends BaseNode { + type: AST_NODE_TYPES.JSXSpreadChild; + expression: Expression | JSXEmptyExpression; +} +export declare type JSXTagNameExpression = JSXIdentifier | JSXMemberExpression | JSXNamespacedName; +export declare interface JSXText extends BaseNode { + type: AST_NODE_TYPES.JSXText; + raw: string; + value: string; +} +export declare interface JSXTextToken extends BaseToken { + type: AST_TOKEN_TYPES.JSXText; +} +export declare interface KeywordToken extends BaseToken { + type: AST_TOKEN_TYPES.Keyword; +} +export declare interface LabeledStatement extends BaseNode { + type: AST_NODE_TYPES.LabeledStatement; + body: Statement; + label: Identifier; +} +export declare type LeftHandSideExpression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | CallExpression | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | LiteralExpression | MemberExpression | MetaProperty | ObjectExpression | ObjectPattern | SequenceExpression | Super | TaggedTemplateExpression | ThisExpression | TSAsExpression | TSNonNullExpression | TSTypeAssertion; +export declare type LetOrConstOrVarDeclaration = ConstDeclaration | LetOrVarDeclaredDeclaration | LetOrVarNonDeclaredDeclaration; +declare interface LetOrConstOrVarDeclarationBase extends BaseNode { + type: AST_NODE_TYPES.VariableDeclaration; + /** + * The variables declared by this declaration. + * Always non-empty. + * @example + * ```ts + * let x; + * let y, z; + * ``` + */ + declarations: LetOrConstOrVarDeclarator[]; + /** + * Whether the declaration is `declare`d + * @example + * ```ts + * declare const x = 1; + * ``` + */ + declare: boolean; + /** + * The keyword used to declare the variable(s) + * @example + * ```ts + * const x = 1; + * let y = 2; + * var z = 3; + * ``` + */ + kind: 'const' | 'let' | 'var'; +} +export declare type LetOrConstOrVarDeclarator = VariableDeclaratorDefiniteAssignment | VariableDeclaratorMaybeInit | VariableDeclaratorNoInit; +export declare interface LetOrVarDeclaredDeclaration extends LetOrConstOrVarDeclarationBase { + /** + * In a `declare let` declaration, the declarators must not have definite assignment + * assertions or initializers. + * + * @example + * ```ts + * using x = 1; + * using y =1, z = 2; + * ``` + */ + declarations: VariableDeclaratorNoInit[]; + declare: true; + kind: 'let' | 'var'; +} +export declare interface LetOrVarNonDeclaredDeclaration extends LetOrConstOrVarDeclarationBase { + /** + * In a `let`/`var` declaration, the declarators may have definite assignment + * assertions or initializers, but not both. + */ + declarations: (VariableDeclaratorDefiniteAssignment | VariableDeclaratorMaybeInit)[]; + declare: false; + kind: 'let' | 'var'; +} +export declare interface LineComment extends BaseToken { + type: AST_TOKEN_TYPES.Line; +} +export declare type Literal = BigIntLiteral | BooleanLiteral | NullLiteral | NumberLiteral | RegExpLiteral | StringLiteral; +declare interface LiteralBase extends BaseNode { + type: AST_NODE_TYPES.Literal; + raw: string; + value: bigint | boolean | number | string | RegExp | null; +} +export declare type LiteralExpression = Literal | TemplateLiteral; +export declare interface LogicalExpression extends BaseNode { + type: AST_NODE_TYPES.LogicalExpression; + left: Expression; + operator: '&&' | '??' | '||'; + right: Expression; +} +export declare type MemberExpression = MemberExpressionComputedName | MemberExpressionNonComputedName; +declare interface MemberExpressionBase extends BaseNode { + computed: boolean; + object: Expression; + optional: boolean; + property: Expression | Identifier | PrivateIdentifier; +} +export declare interface MemberExpressionComputedName extends MemberExpressionBase { + type: AST_NODE_TYPES.MemberExpression; + computed: true; + property: Expression; +} +export declare interface MemberExpressionNonComputedName extends MemberExpressionBase { + type: AST_NODE_TYPES.MemberExpression; + computed: false; + property: Identifier | PrivateIdentifier; +} +export declare interface MetaProperty extends BaseNode { + type: AST_NODE_TYPES.MetaProperty; + meta: Identifier; + property: Identifier; +} +export declare type MethodDefinition = MethodDefinitionComputedName | MethodDefinitionNonComputedName; +/** this should not be directly used - instead use MethodDefinitionComputedNameBase or MethodDefinitionNonComputedNameBase */ +declare interface MethodDefinitionBase extends BaseNode { + accessibility: Accessibility | undefined; + computed: boolean; + decorators: Decorator[]; + key: PropertyName; + kind: 'constructor' | 'get' | 'method' | 'set'; + optional: boolean; + override: boolean; + static: boolean; + value: FunctionExpression | TSEmptyBodyFunctionExpression; +} +export declare interface MethodDefinitionComputedName extends MethodDefinitionComputedNameBase { + type: AST_NODE_TYPES.MethodDefinition; +} +declare interface MethodDefinitionComputedNameBase extends MethodDefinitionBase { + computed: true; + key: PropertyNameComputed; +} +export declare interface MethodDefinitionNonComputedName extends ClassMethodDefinitionNonComputedNameBase { + type: AST_NODE_TYPES.MethodDefinition; +} +declare interface MethodDefinitionNonComputedNameBase extends MethodDefinitionBase { + computed: false; + key: PropertyNameNonComputed; +} +export declare type NamedExportDeclarations = ClassDeclarationWithName | ClassDeclarationWithOptionalName | FunctionDeclarationWithName | FunctionDeclarationWithOptionalName | TSDeclareFunction | TSEnumDeclaration | TSImportEqualsDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSTypeAliasDeclaration | VariableDeclaration; +export declare interface NewExpression extends BaseNode { + type: AST_NODE_TYPES.NewExpression; + arguments: CallExpressionArgument[]; + callee: Expression; + typeArguments: TSTypeParameterInstantiation | undefined; +} +export declare type Node = AccessorProperty | ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BinaryExpression | BlockStatement | BreakStatement | CallExpression | CatchClause | ChainExpression | ClassBody | ClassDeclaration | ClassExpression | ConditionalExpression | ContinueStatement | DebuggerStatement | Decorator | DoWhileStatement | EmptyStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportSpecifier | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LabeledStatement | Literal | LogicalExpression | MemberExpression | MetaProperty | MethodDefinition | NewExpression | ObjectExpression | ObjectPattern | PrivateIdentifier | Program | Property | PropertyDefinition | RestElement | ReturnStatement | SequenceExpression | SpreadElement | StaticBlock | Super | SwitchCase | SwitchStatement | TaggedTemplateExpression | TemplateElement | TemplateLiteral | ThisExpression | ThrowStatement | TryStatement | TSAbstractAccessorProperty | TSAbstractKeyword | TSAbstractMethodDefinition | TSAbstractPropertyDefinition | TSAnyKeyword | TSArrayType | TSAsExpression | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSClassImplements | TSConditionalType | TSConstructorType | TSConstructSignatureDeclaration | TSDeclareFunction | TSDeclareKeyword | TSEmptyBodyFunctionExpression | TSEnumBody | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExportKeyword | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexedAccessType | TSIndexSignature | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSInterfaceHeritage | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSPrivateKeyword | TSPropertySignature | TSProtectedKeyword | TSPublicKeyword | TSQualifiedName | TSReadonlyKeyword | TSRestType | TSSatisfiesExpression | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | YieldExpression; +export declare interface NodeOrTokenData { + type: string; + /** + * The source location information of the node. + * + * The loc property is defined as nullable by ESTree, but ESLint requires this property. + */ + loc: SourceLocation; + range: Range; +} +export declare interface NullLiteral extends LiteralBase { + raw: 'null'; + value: null; +} +export declare interface NullToken extends BaseToken { + type: AST_TOKEN_TYPES.Null; +} +export declare interface NumberLiteral extends LiteralBase { + value: number; +} +export declare interface NumericToken extends BaseToken { + type: AST_TOKEN_TYPES.Numeric; +} +export declare interface ObjectExpression extends BaseNode { + type: AST_NODE_TYPES.ObjectExpression; + properties: ObjectLiteralElement[]; +} +export declare type ObjectLiteralElement = Property | SpreadElement; +export declare type ObjectLiteralElementLike = ObjectLiteralElement; +export declare interface ObjectPattern extends BaseNode { + type: AST_NODE_TYPES.ObjectPattern; + decorators: Decorator[]; + optional: boolean; + properties: (Property | RestElement)[]; + typeAnnotation: TSTypeAnnotation | undefined; +} +export declare type OptionalRangeAndLoc = { + loc?: SourceLocation; + range?: Range; +} & Pick>; +export declare type Parameter = ArrayPattern | AssignmentPattern | Identifier | ObjectPattern | RestElement | TSParameterProperty; +declare type ParameterPropertyParameter = (AssignmentPattern & { + left: Identifier; +}) | Identifier; +export declare interface Position { + /** + * Column number on the line (0-indexed) + */ + column: number; + /** + * Line number (1-indexed) + */ + line: number; +} +export declare type PrimaryExpression = ArrayExpression | ArrayPattern | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | JSXOpeningElement | LiteralExpression | MetaProperty | ObjectExpression | ObjectPattern | Super | TemplateLiteral | ThisExpression | TSNullKeyword; +export declare interface PrivateIdentifier extends BaseNode { + type: AST_NODE_TYPES.PrivateIdentifier; + name: string; +} +export declare interface PrivateIdentifierToken extends BaseToken { + type: AST_TOKEN_TYPES.PrivateIdentifier; +} +export declare interface PrivateInExpression extends BaseNode { + type: AST_NODE_TYPES.BinaryExpression; + left: PrivateIdentifier; + operator: 'in'; + right: Expression; +} +export declare interface Program extends NodeOrTokenData { + type: AST_NODE_TYPES.Program; + body: ProgramStatement[]; + comments: Comment[] | undefined; + sourceType: 'module' | 'script'; + tokens: Token[] | undefined; +} +export declare type ProgramStatement = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | Statement | TSImportEqualsDeclaration | TSNamespaceExportDeclaration; +export declare type Property = PropertyComputedName | PropertyNonComputedName; +declare interface PropertyBase extends BaseNode { + type: AST_NODE_TYPES.Property; + computed: boolean; + key: PropertyName; + kind: 'get' | 'init' | 'set'; + method: boolean; + optional: boolean; + shorthand: boolean; + value: AssignmentPattern | BindingName | Expression | TSEmptyBodyFunctionExpression; +} +export declare interface PropertyComputedName extends PropertyBase { + computed: true; + key: PropertyNameComputed; +} +export declare type PropertyDefinition = PropertyDefinitionComputedName | PropertyDefinitionNonComputedName; +declare interface PropertyDefinitionBase extends BaseNode { + accessibility: Accessibility | undefined; + computed: boolean; + declare: boolean; + decorators: Decorator[]; + definite: boolean; + key: PropertyName; + optional: boolean; + override: boolean; + readonly: boolean; + static: boolean; + typeAnnotation: TSTypeAnnotation | undefined; + value: Expression | null; +} +export declare interface PropertyDefinitionComputedName extends PropertyDefinitionComputedNameBase { + type: AST_NODE_TYPES.PropertyDefinition; +} +declare interface PropertyDefinitionComputedNameBase extends PropertyDefinitionBase { + computed: true; + key: PropertyNameComputed; +} +export declare interface PropertyDefinitionNonComputedName extends ClassPropertyDefinitionNonComputedNameBase { + type: AST_NODE_TYPES.PropertyDefinition; +} +declare interface PropertyDefinitionNonComputedNameBase extends PropertyDefinitionBase { + computed: false; + key: PropertyNameNonComputed; +} +export declare type PropertyName = ClassPropertyNameNonComputed | PropertyNameComputed | PropertyNameNonComputed; +export declare type PropertyNameComputed = Expression; +export declare type PropertyNameNonComputed = Identifier | NumberLiteral | StringLiteral; +export declare interface PropertyNonComputedName extends PropertyBase { + computed: false; + key: PropertyNameNonComputed; +} +export declare interface PunctuatorToken extends BaseToken { + type: AST_TOKEN_TYPES.Punctuator; + value: ValueOf; +} +export declare interface PunctuatorTokenToText extends AssignmentOperatorToText { + [SyntaxKind.AmpersandAmpersandToken]: '&&'; + [SyntaxKind.AmpersandToken]: '&'; + [SyntaxKind.AsteriskAsteriskToken]: '**'; + [SyntaxKind.AsteriskToken]: '*'; + [SyntaxKind.AtToken]: '@'; + [SyntaxKind.BacktickToken]: '`'; + [SyntaxKind.BarBarToken]: '||'; + [SyntaxKind.BarToken]: '|'; + [SyntaxKind.CaretToken]: '^'; + [SyntaxKind.CloseBraceToken]: '}'; + [SyntaxKind.CloseBracketToken]: ']'; + [SyntaxKind.CloseParenToken]: ')'; + [SyntaxKind.ColonToken]: ':'; + [SyntaxKind.CommaToken]: ','; + [SyntaxKind.DotDotDotToken]: '...'; + [SyntaxKind.DotToken]: '.'; + [SyntaxKind.EqualsEqualsEqualsToken]: '==='; + [SyntaxKind.EqualsEqualsToken]: '=='; + [SyntaxKind.EqualsGreaterThanToken]: '=>'; + [SyntaxKind.ExclamationEqualsEqualsToken]: '!=='; + [SyntaxKind.ExclamationEqualsToken]: '!='; + [SyntaxKind.ExclamationToken]: '!'; + [SyntaxKind.GreaterThanEqualsToken]: '>='; + [SyntaxKind.GreaterThanGreaterThanGreaterThanToken]: '>>>'; + [SyntaxKind.GreaterThanGreaterThanToken]: '>>'; + [SyntaxKind.GreaterThanToken]: '>'; + [SyntaxKind.HashToken]: '#'; + [SyntaxKind.LessThanEqualsToken]: '<='; + [SyntaxKind.LessThanLessThanToken]: '<<'; + [SyntaxKind.LessThanSlashToken]: '; + right: Expression; +} +export declare interface TaggedTemplateExpression extends BaseNode { + type: AST_NODE_TYPES.TaggedTemplateExpression; + quasi: TemplateLiteral; + tag: Expression; + typeArguments: TSTypeParameterInstantiation | undefined; +} +export declare interface TemplateElement extends BaseNode { + type: AST_NODE_TYPES.TemplateElement; + tail: boolean; + value: { + cooked: string | null; + raw: string; + }; +} +export declare interface TemplateLiteral extends BaseNode { + type: AST_NODE_TYPES.TemplateLiteral; + expressions: Expression[]; + quasis: TemplateElement[]; +} +export declare interface TemplateToken extends BaseToken { + type: AST_TOKEN_TYPES.Template; +} +export declare interface ThisExpression extends BaseNode { + type: AST_NODE_TYPES.ThisExpression; +} +export declare interface ThrowStatement extends BaseNode { + type: AST_NODE_TYPES.ThrowStatement; + argument: Expression; +} +export declare type Token = BooleanToken | Comment | IdentifierToken | JSXIdentifierToken | JSXTextToken | KeywordToken | NullToken | NumericToken | PrivateIdentifierToken | PunctuatorToken | RegularExpressionToken | StringToken | TemplateToken; +export declare interface TryStatement extends BaseNode { + type: AST_NODE_TYPES.TryStatement; + block: BlockStatement; + finalizer: BlockStatement | null; + handler: CatchClause | null; +} +export declare type TSAbstractAccessorProperty = TSAbstractAccessorPropertyComputedName | TSAbstractAccessorPropertyNonComputedName; +export declare interface TSAbstractAccessorPropertyComputedName extends PropertyDefinitionComputedNameBase { + type: AST_NODE_TYPES.TSAbstractAccessorProperty; + value: null; +} +export declare interface TSAbstractAccessorPropertyNonComputedName extends PropertyDefinitionNonComputedNameBase { + type: AST_NODE_TYPES.TSAbstractAccessorProperty; + value: null; +} +export declare interface TSAbstractKeyword extends BaseNode { + type: AST_NODE_TYPES.TSAbstractKeyword; +} +export declare type TSAbstractMethodDefinition = TSAbstractMethodDefinitionComputedName | TSAbstractMethodDefinitionNonComputedName; +export declare interface TSAbstractMethodDefinitionComputedName extends MethodDefinitionComputedNameBase { + type: AST_NODE_TYPES.TSAbstractMethodDefinition; +} +export declare interface TSAbstractMethodDefinitionNonComputedName extends MethodDefinitionNonComputedNameBase { + type: AST_NODE_TYPES.TSAbstractMethodDefinition; +} +export declare type TSAbstractPropertyDefinition = TSAbstractPropertyDefinitionComputedName | TSAbstractPropertyDefinitionNonComputedName; +export declare interface TSAbstractPropertyDefinitionComputedName extends PropertyDefinitionComputedNameBase { + type: AST_NODE_TYPES.TSAbstractPropertyDefinition; + value: null; +} +export declare interface TSAbstractPropertyDefinitionNonComputedName extends PropertyDefinitionNonComputedNameBase { + type: AST_NODE_TYPES.TSAbstractPropertyDefinition; + value: null; +} +export declare interface TSAnyKeyword extends BaseNode { + type: AST_NODE_TYPES.TSAnyKeyword; +} +export declare interface TSArrayType extends BaseNode { + type: AST_NODE_TYPES.TSArrayType; + elementType: TypeNode; +} +export declare interface TSAsExpression extends BaseNode { + type: AST_NODE_TYPES.TSAsExpression; + expression: Expression; + typeAnnotation: TypeNode; +} +export declare interface TSAsyncKeyword extends BaseNode { + type: AST_NODE_TYPES.TSAsyncKeyword; +} +export declare interface TSBigIntKeyword extends BaseNode { + type: AST_NODE_TYPES.TSBigIntKeyword; +} +export declare interface TSBooleanKeyword extends BaseNode { + type: AST_NODE_TYPES.TSBooleanKeyword; +} +export declare interface TSCallSignatureDeclaration extends TSFunctionSignatureBase { + type: AST_NODE_TYPES.TSCallSignatureDeclaration; +} +export declare interface TSClassImplements extends TSHeritageBase { + type: AST_NODE_TYPES.TSClassImplements; +} +export declare interface TSConditionalType extends BaseNode { + type: AST_NODE_TYPES.TSConditionalType; + checkType: TypeNode; + extendsType: TypeNode; + falseType: TypeNode; + trueType: TypeNode; +} +export declare interface TSConstructorType extends TSFunctionSignatureBase { + type: AST_NODE_TYPES.TSConstructorType; + abstract: boolean; +} +export declare interface TSConstructSignatureDeclaration extends TSFunctionSignatureBase { + type: AST_NODE_TYPES.TSConstructSignatureDeclaration; +} +export declare type TSDeclareFunction = TSDeclareFunctionNoDeclare | TSDeclareFunctionWithDeclare; +declare interface TSDeclareFunctionBase extends FunctionBase { + type: AST_NODE_TYPES.TSDeclareFunction; + /** + * TS1183: An implementation cannot be declared in ambient contexts. + */ + body: undefined; + /** + * Whether the declaration has `declare` modifier. + */ + declare: boolean; + expression: false; +} +/** + * Function declaration without the `declare` keyword: + * ``` + * function foo(): void; + * ``` + * This can either be an overload signature or a declaration in an ambient context + * (e.g. `declare module`) + */ +export declare interface TSDeclareFunctionNoDeclare extends TSDeclareFunctionBase { + declare: false; + /** + * - TS1221: Generators are not allowed in an ambient context. + * - TS1222: An overload signature cannot be declared as a generator. + */ + generator: false; +} +/** + * Function declaration with the `declare` keyword: + * ``` + * declare function foo(): void; + * ``` + */ +export declare interface TSDeclareFunctionWithDeclare extends TSDeclareFunctionBase { + /** + * TS1040: 'async' modifier cannot be used in an ambient context. + */ + async: false; + declare: true; + /** + * TS1221: Generators are not allowed in an ambient context. + */ + generator: false; +} +export declare interface TSDeclareKeyword extends BaseNode { + type: AST_NODE_TYPES.TSDeclareKeyword; +} +export declare interface TSEmptyBodyFunctionExpression extends FunctionBase { + type: AST_NODE_TYPES.TSEmptyBodyFunctionExpression; + body: null; + id: null; +} +export declare interface TSEnumBody extends BaseNode { + type: AST_NODE_TYPES.TSEnumBody; + members: TSEnumMember[]; +} +export declare interface TSEnumDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSEnumDeclaration; + /** + * The body of the enum. + */ + body: TSEnumBody; + /** + * Whether this is a `const` enum. + * @example + * ```ts + * const enum Foo {} + * ``` + */ + const: boolean; + /** + * Whether this is a `declare`d enum. + * @example + * ```ts + * declare enum Foo {} + * ``` + */ + declare: boolean; + /** + * The enum name. + */ + id: Identifier; + /** + * The enum members. + * @deprecated Use {@link body} instead. + */ + members: TSEnumMember[]; +} +export declare interface TSEnumMember extends BaseNode { + type: AST_NODE_TYPES.TSEnumMember; + id: Identifier | StringLiteral; + initializer: Expression | undefined; + /** + * @deprecated the enum member is always non-computed. + */ + computed: boolean; +} +export declare interface TSExportAssignment extends BaseNode { + type: AST_NODE_TYPES.TSExportAssignment; + expression: Expression; +} +export declare interface TSExportKeyword extends BaseNode { + type: AST_NODE_TYPES.TSExportKeyword; +} +export declare interface TSExternalModuleReference extends BaseNode { + type: AST_NODE_TYPES.TSExternalModuleReference; + expression: StringLiteral; +} +declare interface TSFunctionSignatureBase extends BaseNode { + params: Parameter[]; + returnType: TSTypeAnnotation | undefined; + typeParameters: TSTypeParameterDeclaration | undefined; +} +export declare interface TSFunctionType extends TSFunctionSignatureBase { + type: AST_NODE_TYPES.TSFunctionType; +} +declare interface TSHeritageBase extends BaseNode { + expression: Expression; + typeArguments: TSTypeParameterInstantiation | undefined; +} +export declare type TSImportEqualsDeclaration = TSImportEqualsNamespaceDeclaration | TSImportEqualsRequireDeclaration; +declare interface TSImportEqualsDeclarationBase extends BaseNode { + type: AST_NODE_TYPES.TSImportEqualsDeclaration; + /** + * The locally imported name. + */ + id: Identifier; + /** + * The kind of the import. Always `'value'` unless `moduleReference` is a + * `TSExternalModuleReference`. + */ + importKind: ImportKind; + /** + * The value being aliased. + * @example + * ```ts + * import F1 = A; + * import F2 = A.B.C; + * import F3 = require('mod'); + * ``` + */ + moduleReference: Identifier | TSExternalModuleReference | TSQualifiedName; +} +export declare interface TSImportEqualsNamespaceDeclaration extends TSImportEqualsDeclarationBase { + /** + * The kind of the import. + */ + importKind: 'value'; + /** + * The value being aliased. + * ``` + * import F1 = A; + * import F2 = A.B.C; + * ``` + */ + moduleReference: Identifier | TSQualifiedName; +} +export declare interface TSImportEqualsRequireDeclaration extends TSImportEqualsDeclarationBase { + /** + * The kind of the import. + */ + importKind: ImportKind; + /** + * The value being aliased. + * ``` + * import F3 = require('mod'); + * ``` + */ + moduleReference: TSExternalModuleReference; +} +export declare interface TSImportType extends BaseNode { + type: AST_NODE_TYPES.TSImportType; + /** @deprecated Use {@link `source`} instead. */ + argument: TypeNode; + options: ObjectExpression | null; + qualifier: EntityName | null; + source: StringLiteral; + typeArguments: TSTypeParameterInstantiation | null; +} +export declare interface TSIndexedAccessType extends BaseNode { + type: AST_NODE_TYPES.TSIndexedAccessType; + indexType: TypeNode; + objectType: TypeNode; +} +export declare interface TSIndexSignature extends BaseNode { + type: AST_NODE_TYPES.TSIndexSignature; + accessibility: Accessibility | undefined; + parameters: Parameter[]; + readonly: boolean; + static: boolean; + typeAnnotation: TSTypeAnnotation | undefined; +} +export declare interface TSInferType extends BaseNode { + type: AST_NODE_TYPES.TSInferType; + typeParameter: TSTypeParameter; +} +export declare interface TSInstantiationExpression extends BaseNode { + type: AST_NODE_TYPES.TSInstantiationExpression; + expression: Expression; + typeArguments: TSTypeParameterInstantiation; +} +export declare interface TSInterfaceBody extends BaseNode { + type: AST_NODE_TYPES.TSInterfaceBody; + body: TypeElement[]; +} +export declare interface TSInterfaceDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSInterfaceDeclaration; + /** + * The body of the interface + */ + body: TSInterfaceBody; + /** + * Whether the interface was `declare`d + */ + declare: boolean; + /** + * The types this interface `extends` + */ + extends: TSInterfaceHeritage[]; + /** + * The name of this interface + */ + id: Identifier; + /** + * The generic type parameters declared for the interface. Empty declaration + * (`<>`) is different from no declaration. + */ + typeParameters: TSTypeParameterDeclaration | undefined; +} +export declare interface TSInterfaceHeritage extends TSHeritageBase { + type: AST_NODE_TYPES.TSInterfaceHeritage; +} +export declare interface TSIntersectionType extends BaseNode { + type: AST_NODE_TYPES.TSIntersectionType; + types: TypeNode[]; +} +export declare interface TSIntrinsicKeyword extends BaseNode { + type: AST_NODE_TYPES.TSIntrinsicKeyword; +} +export declare interface TSLiteralType extends BaseNode { + type: AST_NODE_TYPES.TSLiteralType; + literal: Exclude | UnaryExpressionMinus | UnaryExpressionPlus; +} +export declare interface TSMappedType extends BaseNode { + type: AST_NODE_TYPES.TSMappedType; + constraint: TypeNode; + key: Identifier; + nameType: TypeNode | null; + optional: boolean | '+' | '-' | undefined; + readonly: boolean | '+' | '-' | undefined; + typeAnnotation: TypeNode | undefined; + /** @deprecated Use {@link `constraint`} and {@link `key`} instead. */ + typeParameter: TSTypeParameter; +} +export declare type TSMethodSignature = TSMethodSignatureComputedName | TSMethodSignatureNonComputedName; +declare interface TSMethodSignatureBase extends BaseNode { + type: AST_NODE_TYPES.TSMethodSignature; + accessibility: Accessibility | undefined; + computed: boolean; + key: PropertyName; + kind: 'get' | 'method' | 'set'; + optional: boolean; + params: Parameter[]; + readonly: boolean; + returnType: TSTypeAnnotation | undefined; + static: boolean; + typeParameters: TSTypeParameterDeclaration | undefined; +} +export declare interface TSMethodSignatureComputedName extends TSMethodSignatureBase { + computed: true; + key: PropertyNameComputed; +} +export declare interface TSMethodSignatureNonComputedName extends TSMethodSignatureBase { + computed: false; + key: PropertyNameNonComputed; +} +export declare interface TSModuleBlock extends BaseNode { + type: AST_NODE_TYPES.TSModuleBlock; + body: ProgramStatement[]; +} +export declare type TSModuleDeclaration = TSModuleDeclarationGlobal | TSModuleDeclarationModule | TSModuleDeclarationNamespace; +declare interface TSModuleDeclarationBase extends BaseNode { + type: AST_NODE_TYPES.TSModuleDeclaration; + /** + * The body of the module. + * This can only be `undefined` for the code `declare module 'mod';` + */ + body?: TSModuleBlock; + /** + * Whether the module is `declare`d + * @example + * ```ts + * declare namespace F {} + * ``` + */ + declare: boolean; + /** + * Whether this is a global declaration + * @example + * ```ts + * declare global {} + * ``` + * + * @deprecated Use {@link kind} instead + */ + global: boolean; + /** + * The name of the module + * ``` + * namespace A {} + * namespace A.B.C {} + * module 'a' {} + * ``` + */ + id: Identifier | Literal | TSQualifiedName; + /** + * The keyword used to define this module declaration + * @example + * ```ts + * namespace Foo {} + * ^^^^^^^^^ + * + * module 'foo' {} + * ^^^^^^ + * + * global {} + * ^^^^^^ + * ``` + */ + kind: TSModuleDeclarationKind; +} +export declare interface TSModuleDeclarationGlobal extends TSModuleDeclarationBase { + body: TSModuleBlock; + /** + * This will always be an Identifier with name `global` + */ + id: Identifier; + kind: 'global'; +} +export declare type TSModuleDeclarationKind = 'global' | 'module' | 'namespace'; +export declare type TSModuleDeclarationModule = TSModuleDeclarationModuleWithIdentifierId | TSModuleDeclarationModuleWithStringId; +declare interface TSModuleDeclarationModuleBase extends TSModuleDeclarationBase { + kind: 'module'; +} +/** + * The legacy module declaration, replaced with namespace declarations. + * ``` + * module A {} + * ``` + */ +export declare interface TSModuleDeclarationModuleWithIdentifierId extends TSModuleDeclarationModuleBase { + body: TSModuleBlock; + id: Identifier; + kind: 'module'; +} +export declare type TSModuleDeclarationModuleWithStringId = TSModuleDeclarationModuleWithStringIdDeclared | TSModuleDeclarationModuleWithStringIdNotDeclared; +/** + * A string module declaration that is declared: + * ``` + * declare module 'foo' {} + * declare module 'foo'; + * ``` + */ +export declare interface TSModuleDeclarationModuleWithStringIdDeclared extends TSModuleDeclarationModuleBase { + body?: TSModuleBlock; + declare: true; + id: StringLiteral; + kind: 'module'; +} +/** + * A string module declaration that is not declared: + * ``` + * module 'foo' {} + * ``` + */ +export declare interface TSModuleDeclarationModuleWithStringIdNotDeclared extends TSModuleDeclarationModuleBase { + body: TSModuleBlock; + declare: false; + id: StringLiteral; + kind: 'module'; +} +export declare interface TSModuleDeclarationNamespace extends TSModuleDeclarationBase { + body: TSModuleBlock; + id: Identifier | TSQualifiedName; + kind: 'namespace'; +} +export declare interface TSNamedTupleMember extends BaseNode { + type: AST_NODE_TYPES.TSNamedTupleMember; + elementType: TypeNode; + label: Identifier; + optional: boolean; +} +/** + * For the following declaration: + * ``` + * export as namespace X; + * ``` + */ +export declare interface TSNamespaceExportDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSNamespaceExportDeclaration; + /** + * The name of the global variable that's exported as namespace + */ + id: Identifier; +} +export declare interface TSNeverKeyword extends BaseNode { + type: AST_NODE_TYPES.TSNeverKeyword; +} +export declare interface TSNonNullExpression extends BaseNode { + type: AST_NODE_TYPES.TSNonNullExpression; + expression: Expression; +} +export declare interface TSNullKeyword extends BaseNode { + type: AST_NODE_TYPES.TSNullKeyword; +} +export declare interface TSNumberKeyword extends BaseNode { + type: AST_NODE_TYPES.TSNumberKeyword; +} +export declare interface TSObjectKeyword extends BaseNode { + type: AST_NODE_TYPES.TSObjectKeyword; +} +export declare interface TSOptionalType extends BaseNode { + type: AST_NODE_TYPES.TSOptionalType; + typeAnnotation: TypeNode; +} +export declare interface TSParameterProperty extends BaseNode { + type: AST_NODE_TYPES.TSParameterProperty; + accessibility: Accessibility | undefined; + decorators: Decorator[]; + override: boolean; + parameter: ParameterPropertyParameter; + readonly: boolean; + static: boolean; +} +export declare interface TSPrivateKeyword extends BaseNode { + type: AST_NODE_TYPES.TSPrivateKeyword; +} +export declare type TSPropertySignature = TSPropertySignatureComputedName | TSPropertySignatureNonComputedName; +declare interface TSPropertySignatureBase extends BaseNode { + type: AST_NODE_TYPES.TSPropertySignature; + accessibility: Accessibility | undefined; + computed: boolean; + key: PropertyName; + optional: boolean; + readonly: boolean; + static: boolean; + typeAnnotation: TSTypeAnnotation | undefined; +} +export declare interface TSPropertySignatureComputedName extends TSPropertySignatureBase { + computed: true; + key: PropertyNameComputed; +} +export declare interface TSPropertySignatureNonComputedName extends TSPropertySignatureBase { + computed: false; + key: PropertyNameNonComputed; +} +export declare interface TSProtectedKeyword extends BaseNode { + type: AST_NODE_TYPES.TSProtectedKeyword; +} +export declare interface TSPublicKeyword extends BaseNode { + type: AST_NODE_TYPES.TSPublicKeyword; +} +export declare interface TSQualifiedName extends BaseNode { + type: AST_NODE_TYPES.TSQualifiedName; + left: EntityName; + right: Identifier; +} +export declare interface TSReadonlyKeyword extends BaseNode { + type: AST_NODE_TYPES.TSReadonlyKeyword; +} +export declare interface TSRestType extends BaseNode { + type: AST_NODE_TYPES.TSRestType; + typeAnnotation: TypeNode; +} +export declare interface TSSatisfiesExpression extends BaseNode { + type: AST_NODE_TYPES.TSSatisfiesExpression; + expression: Expression; + typeAnnotation: TypeNode; +} +export declare interface TSStaticKeyword extends BaseNode { + type: AST_NODE_TYPES.TSStaticKeyword; +} +export declare interface TSStringKeyword extends BaseNode { + type: AST_NODE_TYPES.TSStringKeyword; +} +export declare interface TSSymbolKeyword extends BaseNode { + type: AST_NODE_TYPES.TSSymbolKeyword; +} +export declare interface TSTemplateLiteralType extends BaseNode { + type: AST_NODE_TYPES.TSTemplateLiteralType; + quasis: TemplateElement[]; + types: TypeNode[]; +} +export declare interface TSThisType extends BaseNode { + type: AST_NODE_TYPES.TSThisType; +} +export declare interface TSTupleType extends BaseNode { + type: AST_NODE_TYPES.TSTupleType; + elementTypes: TypeNode[]; +} +export declare interface TSTypeAliasDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSTypeAliasDeclaration; + /** + * Whether the type was `declare`d. + * @example + * ```ts + * declare type T = 1; + * ``` + */ + declare: boolean; + /** + * The name of the type. + */ + id: Identifier; + /** + * The "value" (type) of the declaration + */ + typeAnnotation: TypeNode; + /** + * The generic type parameters declared for the type. Empty declaration + * (`<>`) is different from no declaration. + */ + typeParameters: TSTypeParameterDeclaration | undefined; +} +export declare interface TSTypeAnnotation extends BaseNode { + type: AST_NODE_TYPES.TSTypeAnnotation; + typeAnnotation: TypeNode; +} +export declare interface TSTypeAssertion extends BaseNode { + type: AST_NODE_TYPES.TSTypeAssertion; + expression: Expression; + typeAnnotation: TypeNode; +} +export declare interface TSTypeLiteral extends BaseNode { + type: AST_NODE_TYPES.TSTypeLiteral; + members: TypeElement[]; +} +export declare interface TSTypeOperator extends BaseNode { + type: AST_NODE_TYPES.TSTypeOperator; + operator: 'keyof' | 'readonly' | 'unique'; + typeAnnotation: TypeNode | undefined; +} +export declare interface TSTypeParameter extends BaseNode { + type: AST_NODE_TYPES.TSTypeParameter; + const: boolean; + constraint: TypeNode | undefined; + default: TypeNode | undefined; + in: boolean; + name: Identifier; + out: boolean; +} +export declare interface TSTypeParameterDeclaration extends BaseNode { + type: AST_NODE_TYPES.TSTypeParameterDeclaration; + params: TSTypeParameter[]; +} +export declare interface TSTypeParameterInstantiation extends BaseNode { + type: AST_NODE_TYPES.TSTypeParameterInstantiation; + params: TypeNode[]; +} +export declare interface TSTypePredicate extends BaseNode { + type: AST_NODE_TYPES.TSTypePredicate; + asserts: boolean; + parameterName: Identifier | TSThisType; + typeAnnotation: TSTypeAnnotation | null; +} +export declare interface TSTypeQuery extends BaseNode { + type: AST_NODE_TYPES.TSTypeQuery; + exprName: EntityName | TSImportType; + typeArguments: TSTypeParameterInstantiation | undefined; +} +export declare interface TSTypeReference extends BaseNode { + type: AST_NODE_TYPES.TSTypeReference; + typeArguments: TSTypeParameterInstantiation | undefined; + typeName: EntityName; +} +export declare type TSUnaryExpression = AwaitExpression | LeftHandSideExpression | UnaryExpression | UpdateExpression; +export declare interface TSUndefinedKeyword extends BaseNode { + type: AST_NODE_TYPES.TSUndefinedKeyword; +} +export declare interface TSUnionType extends BaseNode { + type: AST_NODE_TYPES.TSUnionType; + types: TypeNode[]; +} +export declare interface TSUnknownKeyword extends BaseNode { + type: AST_NODE_TYPES.TSUnknownKeyword; +} +export declare interface TSVoidKeyword extends BaseNode { + type: AST_NODE_TYPES.TSVoidKeyword; +} +export declare type TypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSIndexSignature | TSMethodSignature | TSPropertySignature; +export declare type TypeNode = TSAbstractKeyword | TSAnyKeyword | TSArrayType | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSConditionalType | TSConstructorType | TSDeclareKeyword | TSExportKeyword | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSNamedTupleMember | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSPrivateKeyword | TSProtectedKeyword | TSPublicKeyword | TSQualifiedName | TSReadonlyKeyword | TSRestType | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword; +export declare type UnaryExpression = UnaryExpressionBitwiseNot | UnaryExpressionDelete | UnaryExpressionMinus | UnaryExpressionNot | UnaryExpressionPlus | UnaryExpressionTypeof | UnaryExpressionVoid; +declare interface UnaryExpressionBase extends BaseNode { + argument: Expression; + operator: string; + prefix: boolean; +} +export declare type UnaryExpressionBitwiseNot = UnaryExpressionSpecific<'~'>; +export declare type UnaryExpressionDelete = UnaryExpressionSpecific<'delete'>; +export declare type UnaryExpressionMinus = UnaryExpressionSpecific<'-'>; +export declare type UnaryExpressionNot = UnaryExpressionSpecific<'!'>; +export declare type UnaryExpressionPlus = UnaryExpressionSpecific<'+'>; +declare interface UnaryExpressionSpecific extends UnaryExpressionBase { + type: AST_NODE_TYPES.UnaryExpression; + operator: T; +} +export declare type UnaryExpressionTypeof = UnaryExpressionSpecific<'typeof'>; +export declare type UnaryExpressionVoid = UnaryExpressionSpecific<'void'>; +export declare interface UpdateExpression extends UnaryExpressionBase { + type: AST_NODE_TYPES.UpdateExpression; + operator: '++' | '--'; +} +export declare type UsingDeclaration = UsingInForOfDeclaration | UsingInNormalContextDeclaration; +declare interface UsingDeclarationBase extends BaseNode { + type: AST_NODE_TYPES.VariableDeclaration; + /** + * This value will always be `false` + * because 'declare' modifier cannot appear on a 'using' declaration. + */ + declare: false; + /** + * The keyword used to declare the variable(s) + * @example + * ```ts + * using x = 1; + * await using y = 2; + * ``` + */ + kind: 'await using' | 'using'; +} +export declare type UsingDeclarator = UsingInForOfDeclarator | UsingInNormalContextDeclarator; +export declare interface UsingInForOfDeclaration extends UsingDeclarationBase { + /** + * The variables declared by this declaration. + * Always has exactly one element. + * @example + * ```ts + * for (using x of y) {} + * ``` + */ + declarations: [UsingInForOfDeclarator]; +} +export declare interface UsingInForOfDeclarator extends VariableDeclaratorBase { + definite: false; + id: Identifier; + init: null; +} +export declare interface UsingInNormalContextDeclaration extends UsingDeclarationBase { + /** + * The variables declared by this declaration. + * Always non-empty. + * @example + * ```ts + * using x = 1; + * using y = 1, z = 2; + * ``` + */ + declarations: UsingInNormalContextDeclarator[]; +} +export declare interface UsingInNormalContextDeclarator extends VariableDeclaratorBase { + definite: false; + id: Identifier; + init: Expression; +} +declare type ValueOf = T[keyof T]; +export declare type VariableDeclaration = LetOrConstOrVarDeclaration | UsingDeclaration; +export declare type VariableDeclarator = LetOrConstOrVarDeclarator | UsingDeclarator; +declare interface VariableDeclaratorBase extends BaseNode { + type: AST_NODE_TYPES.VariableDeclarator; + /** + * Whether there's definite assignment assertion (`let x!: number`). + * If `true`, then: `id` must be an identifier with a type annotation, + * `init` must be `null`, and the declarator must be a `var`/`let` declarator. + */ + definite: boolean; + /** + * The name(s) of the variable(s). + */ + id: BindingName; + /** + * The initializer expression of the variable. Must be present for `const` unless + * in a `declare const`. + */ + init: Expression | null; +} +export declare interface VariableDeclaratorDefiniteAssignment extends VariableDeclaratorBase { + definite: true; + /** + * The name of the variable. Must have a type annotation. + */ + id: Identifier; + init: null; +} +export declare interface VariableDeclaratorMaybeInit extends VariableDeclaratorBase { + definite: false; +} +export declare interface VariableDeclaratorNoInit extends VariableDeclaratorBase { + definite: false; + init: null; +} +export declare interface WhileStatement extends BaseNode { + type: AST_NODE_TYPES.WhileStatement; + body: Statement; + test: Expression; +} +export declare interface WithStatement extends BaseNode { + type: AST_NODE_TYPES.WithStatement; + body: Statement; + object: Expression; +} +export declare interface YieldExpression extends BaseNode { + type: AST_NODE_TYPES.YieldExpression; + argument: Expression | null; + delegate: boolean; +} +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js b/tools/ui/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js new file mode 100644 index 0000000000000000000000000000000000000000..0295681013568b4f5bcce18e40c4e4737916bdf2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js @@ -0,0 +1,200 @@ +"use strict"; +/********************************************** + * DO NOT MODIFY THIS FILE MANUALLY * + * * + * THIS FILE HAS BEEN COPIED FROM ast-spec. * + * ANY CHANGES WILL BE LOST ON THE NEXT BUILD * + * * + * MAKE CHANGES TO ast-spec AND THEN RUN * + * pnpm run build * + **********************************************/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0; +var AST_NODE_TYPES; +(function (AST_NODE_TYPES) { + AST_NODE_TYPES["AccessorProperty"] = "AccessorProperty"; + AST_NODE_TYPES["ArrayExpression"] = "ArrayExpression"; + AST_NODE_TYPES["ArrayPattern"] = "ArrayPattern"; + AST_NODE_TYPES["ArrowFunctionExpression"] = "ArrowFunctionExpression"; + AST_NODE_TYPES["AssignmentExpression"] = "AssignmentExpression"; + AST_NODE_TYPES["AssignmentPattern"] = "AssignmentPattern"; + AST_NODE_TYPES["AwaitExpression"] = "AwaitExpression"; + AST_NODE_TYPES["BinaryExpression"] = "BinaryExpression"; + AST_NODE_TYPES["BlockStatement"] = "BlockStatement"; + AST_NODE_TYPES["BreakStatement"] = "BreakStatement"; + AST_NODE_TYPES["CallExpression"] = "CallExpression"; + AST_NODE_TYPES["CatchClause"] = "CatchClause"; + AST_NODE_TYPES["ChainExpression"] = "ChainExpression"; + AST_NODE_TYPES["ClassBody"] = "ClassBody"; + AST_NODE_TYPES["ClassDeclaration"] = "ClassDeclaration"; + AST_NODE_TYPES["ClassExpression"] = "ClassExpression"; + AST_NODE_TYPES["ConditionalExpression"] = "ConditionalExpression"; + AST_NODE_TYPES["ContinueStatement"] = "ContinueStatement"; + AST_NODE_TYPES["DebuggerStatement"] = "DebuggerStatement"; + AST_NODE_TYPES["Decorator"] = "Decorator"; + AST_NODE_TYPES["DoWhileStatement"] = "DoWhileStatement"; + AST_NODE_TYPES["EmptyStatement"] = "EmptyStatement"; + AST_NODE_TYPES["ExportAllDeclaration"] = "ExportAllDeclaration"; + AST_NODE_TYPES["ExportDefaultDeclaration"] = "ExportDefaultDeclaration"; + AST_NODE_TYPES["ExportNamedDeclaration"] = "ExportNamedDeclaration"; + AST_NODE_TYPES["ExportSpecifier"] = "ExportSpecifier"; + AST_NODE_TYPES["ExpressionStatement"] = "ExpressionStatement"; + AST_NODE_TYPES["ForInStatement"] = "ForInStatement"; + AST_NODE_TYPES["ForOfStatement"] = "ForOfStatement"; + AST_NODE_TYPES["ForStatement"] = "ForStatement"; + AST_NODE_TYPES["FunctionDeclaration"] = "FunctionDeclaration"; + AST_NODE_TYPES["FunctionExpression"] = "FunctionExpression"; + AST_NODE_TYPES["Identifier"] = "Identifier"; + AST_NODE_TYPES["IfStatement"] = "IfStatement"; + AST_NODE_TYPES["ImportAttribute"] = "ImportAttribute"; + AST_NODE_TYPES["ImportDeclaration"] = "ImportDeclaration"; + AST_NODE_TYPES["ImportDefaultSpecifier"] = "ImportDefaultSpecifier"; + AST_NODE_TYPES["ImportExpression"] = "ImportExpression"; + AST_NODE_TYPES["ImportNamespaceSpecifier"] = "ImportNamespaceSpecifier"; + AST_NODE_TYPES["ImportSpecifier"] = "ImportSpecifier"; + AST_NODE_TYPES["JSXAttribute"] = "JSXAttribute"; + AST_NODE_TYPES["JSXClosingElement"] = "JSXClosingElement"; + AST_NODE_TYPES["JSXClosingFragment"] = "JSXClosingFragment"; + AST_NODE_TYPES["JSXElement"] = "JSXElement"; + AST_NODE_TYPES["JSXEmptyExpression"] = "JSXEmptyExpression"; + AST_NODE_TYPES["JSXExpressionContainer"] = "JSXExpressionContainer"; + AST_NODE_TYPES["JSXFragment"] = "JSXFragment"; + AST_NODE_TYPES["JSXIdentifier"] = "JSXIdentifier"; + AST_NODE_TYPES["JSXMemberExpression"] = "JSXMemberExpression"; + AST_NODE_TYPES["JSXNamespacedName"] = "JSXNamespacedName"; + AST_NODE_TYPES["JSXOpeningElement"] = "JSXOpeningElement"; + AST_NODE_TYPES["JSXOpeningFragment"] = "JSXOpeningFragment"; + AST_NODE_TYPES["JSXSpreadAttribute"] = "JSXSpreadAttribute"; + AST_NODE_TYPES["JSXSpreadChild"] = "JSXSpreadChild"; + AST_NODE_TYPES["JSXText"] = "JSXText"; + AST_NODE_TYPES["LabeledStatement"] = "LabeledStatement"; + AST_NODE_TYPES["Literal"] = "Literal"; + AST_NODE_TYPES["LogicalExpression"] = "LogicalExpression"; + AST_NODE_TYPES["MemberExpression"] = "MemberExpression"; + AST_NODE_TYPES["MetaProperty"] = "MetaProperty"; + AST_NODE_TYPES["MethodDefinition"] = "MethodDefinition"; + AST_NODE_TYPES["NewExpression"] = "NewExpression"; + AST_NODE_TYPES["ObjectExpression"] = "ObjectExpression"; + AST_NODE_TYPES["ObjectPattern"] = "ObjectPattern"; + AST_NODE_TYPES["PrivateIdentifier"] = "PrivateIdentifier"; + AST_NODE_TYPES["Program"] = "Program"; + AST_NODE_TYPES["Property"] = "Property"; + AST_NODE_TYPES["PropertyDefinition"] = "PropertyDefinition"; + AST_NODE_TYPES["RestElement"] = "RestElement"; + AST_NODE_TYPES["ReturnStatement"] = "ReturnStatement"; + AST_NODE_TYPES["SequenceExpression"] = "SequenceExpression"; + AST_NODE_TYPES["SpreadElement"] = "SpreadElement"; + AST_NODE_TYPES["StaticBlock"] = "StaticBlock"; + AST_NODE_TYPES["Super"] = "Super"; + AST_NODE_TYPES["SwitchCase"] = "SwitchCase"; + AST_NODE_TYPES["SwitchStatement"] = "SwitchStatement"; + AST_NODE_TYPES["TaggedTemplateExpression"] = "TaggedTemplateExpression"; + AST_NODE_TYPES["TemplateElement"] = "TemplateElement"; + AST_NODE_TYPES["TemplateLiteral"] = "TemplateLiteral"; + AST_NODE_TYPES["ThisExpression"] = "ThisExpression"; + AST_NODE_TYPES["ThrowStatement"] = "ThrowStatement"; + AST_NODE_TYPES["TryStatement"] = "TryStatement"; + AST_NODE_TYPES["UnaryExpression"] = "UnaryExpression"; + AST_NODE_TYPES["UpdateExpression"] = "UpdateExpression"; + AST_NODE_TYPES["VariableDeclaration"] = "VariableDeclaration"; + AST_NODE_TYPES["VariableDeclarator"] = "VariableDeclarator"; + AST_NODE_TYPES["WhileStatement"] = "WhileStatement"; + AST_NODE_TYPES["WithStatement"] = "WithStatement"; + AST_NODE_TYPES["YieldExpression"] = "YieldExpression"; + AST_NODE_TYPES["TSAbstractAccessorProperty"] = "TSAbstractAccessorProperty"; + AST_NODE_TYPES["TSAbstractKeyword"] = "TSAbstractKeyword"; + AST_NODE_TYPES["TSAbstractMethodDefinition"] = "TSAbstractMethodDefinition"; + AST_NODE_TYPES["TSAbstractPropertyDefinition"] = "TSAbstractPropertyDefinition"; + AST_NODE_TYPES["TSAnyKeyword"] = "TSAnyKeyword"; + AST_NODE_TYPES["TSArrayType"] = "TSArrayType"; + AST_NODE_TYPES["TSAsExpression"] = "TSAsExpression"; + AST_NODE_TYPES["TSAsyncKeyword"] = "TSAsyncKeyword"; + AST_NODE_TYPES["TSBigIntKeyword"] = "TSBigIntKeyword"; + AST_NODE_TYPES["TSBooleanKeyword"] = "TSBooleanKeyword"; + AST_NODE_TYPES["TSCallSignatureDeclaration"] = "TSCallSignatureDeclaration"; + AST_NODE_TYPES["TSClassImplements"] = "TSClassImplements"; + AST_NODE_TYPES["TSConditionalType"] = "TSConditionalType"; + AST_NODE_TYPES["TSConstructorType"] = "TSConstructorType"; + AST_NODE_TYPES["TSConstructSignatureDeclaration"] = "TSConstructSignatureDeclaration"; + AST_NODE_TYPES["TSDeclareFunction"] = "TSDeclareFunction"; + AST_NODE_TYPES["TSDeclareKeyword"] = "TSDeclareKeyword"; + AST_NODE_TYPES["TSEmptyBodyFunctionExpression"] = "TSEmptyBodyFunctionExpression"; + AST_NODE_TYPES["TSEnumBody"] = "TSEnumBody"; + AST_NODE_TYPES["TSEnumDeclaration"] = "TSEnumDeclaration"; + AST_NODE_TYPES["TSEnumMember"] = "TSEnumMember"; + AST_NODE_TYPES["TSExportAssignment"] = "TSExportAssignment"; + AST_NODE_TYPES["TSExportKeyword"] = "TSExportKeyword"; + AST_NODE_TYPES["TSExternalModuleReference"] = "TSExternalModuleReference"; + AST_NODE_TYPES["TSFunctionType"] = "TSFunctionType"; + AST_NODE_TYPES["TSImportEqualsDeclaration"] = "TSImportEqualsDeclaration"; + AST_NODE_TYPES["TSImportType"] = "TSImportType"; + AST_NODE_TYPES["TSIndexedAccessType"] = "TSIndexedAccessType"; + AST_NODE_TYPES["TSIndexSignature"] = "TSIndexSignature"; + AST_NODE_TYPES["TSInferType"] = "TSInferType"; + AST_NODE_TYPES["TSInstantiationExpression"] = "TSInstantiationExpression"; + AST_NODE_TYPES["TSInterfaceBody"] = "TSInterfaceBody"; + AST_NODE_TYPES["TSInterfaceDeclaration"] = "TSInterfaceDeclaration"; + AST_NODE_TYPES["TSInterfaceHeritage"] = "TSInterfaceHeritage"; + AST_NODE_TYPES["TSIntersectionType"] = "TSIntersectionType"; + AST_NODE_TYPES["TSIntrinsicKeyword"] = "TSIntrinsicKeyword"; + AST_NODE_TYPES["TSLiteralType"] = "TSLiteralType"; + AST_NODE_TYPES["TSMappedType"] = "TSMappedType"; + AST_NODE_TYPES["TSMethodSignature"] = "TSMethodSignature"; + AST_NODE_TYPES["TSModuleBlock"] = "TSModuleBlock"; + AST_NODE_TYPES["TSModuleDeclaration"] = "TSModuleDeclaration"; + AST_NODE_TYPES["TSNamedTupleMember"] = "TSNamedTupleMember"; + AST_NODE_TYPES["TSNamespaceExportDeclaration"] = "TSNamespaceExportDeclaration"; + AST_NODE_TYPES["TSNeverKeyword"] = "TSNeverKeyword"; + AST_NODE_TYPES["TSNonNullExpression"] = "TSNonNullExpression"; + AST_NODE_TYPES["TSNullKeyword"] = "TSNullKeyword"; + AST_NODE_TYPES["TSNumberKeyword"] = "TSNumberKeyword"; + AST_NODE_TYPES["TSObjectKeyword"] = "TSObjectKeyword"; + AST_NODE_TYPES["TSOptionalType"] = "TSOptionalType"; + AST_NODE_TYPES["TSParameterProperty"] = "TSParameterProperty"; + AST_NODE_TYPES["TSPrivateKeyword"] = "TSPrivateKeyword"; + AST_NODE_TYPES["TSPropertySignature"] = "TSPropertySignature"; + AST_NODE_TYPES["TSProtectedKeyword"] = "TSProtectedKeyword"; + AST_NODE_TYPES["TSPublicKeyword"] = "TSPublicKeyword"; + AST_NODE_TYPES["TSQualifiedName"] = "TSQualifiedName"; + AST_NODE_TYPES["TSReadonlyKeyword"] = "TSReadonlyKeyword"; + AST_NODE_TYPES["TSRestType"] = "TSRestType"; + AST_NODE_TYPES["TSSatisfiesExpression"] = "TSSatisfiesExpression"; + AST_NODE_TYPES["TSStaticKeyword"] = "TSStaticKeyword"; + AST_NODE_TYPES["TSStringKeyword"] = "TSStringKeyword"; + AST_NODE_TYPES["TSSymbolKeyword"] = "TSSymbolKeyword"; + AST_NODE_TYPES["TSTemplateLiteralType"] = "TSTemplateLiteralType"; + AST_NODE_TYPES["TSThisType"] = "TSThisType"; + AST_NODE_TYPES["TSTupleType"] = "TSTupleType"; + AST_NODE_TYPES["TSTypeAliasDeclaration"] = "TSTypeAliasDeclaration"; + AST_NODE_TYPES["TSTypeAnnotation"] = "TSTypeAnnotation"; + AST_NODE_TYPES["TSTypeAssertion"] = "TSTypeAssertion"; + AST_NODE_TYPES["TSTypeLiteral"] = "TSTypeLiteral"; + AST_NODE_TYPES["TSTypeOperator"] = "TSTypeOperator"; + AST_NODE_TYPES["TSTypeParameter"] = "TSTypeParameter"; + AST_NODE_TYPES["TSTypeParameterDeclaration"] = "TSTypeParameterDeclaration"; + AST_NODE_TYPES["TSTypeParameterInstantiation"] = "TSTypeParameterInstantiation"; + AST_NODE_TYPES["TSTypePredicate"] = "TSTypePredicate"; + AST_NODE_TYPES["TSTypeQuery"] = "TSTypeQuery"; + AST_NODE_TYPES["TSTypeReference"] = "TSTypeReference"; + AST_NODE_TYPES["TSUndefinedKeyword"] = "TSUndefinedKeyword"; + AST_NODE_TYPES["TSUnionType"] = "TSUnionType"; + AST_NODE_TYPES["TSUnknownKeyword"] = "TSUnknownKeyword"; + AST_NODE_TYPES["TSVoidKeyword"] = "TSVoidKeyword"; +})(AST_NODE_TYPES || (exports.AST_NODE_TYPES = AST_NODE_TYPES = {})); +var AST_TOKEN_TYPES; +(function (AST_TOKEN_TYPES) { + AST_TOKEN_TYPES["Boolean"] = "Boolean"; + AST_TOKEN_TYPES["Identifier"] = "Identifier"; + AST_TOKEN_TYPES["JSXIdentifier"] = "JSXIdentifier"; + AST_TOKEN_TYPES["PrivateIdentifier"] = "PrivateIdentifier"; + AST_TOKEN_TYPES["JSXText"] = "JSXText"; + AST_TOKEN_TYPES["Keyword"] = "Keyword"; + AST_TOKEN_TYPES["Null"] = "Null"; + AST_TOKEN_TYPES["Numeric"] = "Numeric"; + AST_TOKEN_TYPES["Punctuator"] = "Punctuator"; + AST_TOKEN_TYPES["RegularExpression"] = "RegularExpression"; + AST_TOKEN_TYPES["String"] = "String"; + AST_TOKEN_TYPES["Template"] = "Template"; + AST_TOKEN_TYPES["Block"] = "Block"; + AST_TOKEN_TYPES["Line"] = "Line"; +})(AST_TOKEN_TYPES || (exports.AST_TOKEN_TYPES = AST_TOKEN_TYPES = {})); diff --git a/tools/ui/node_modules/@typescript-eslint/types/dist/index.d.ts b/tools/ui/node_modules/@typescript-eslint/types/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb733d5275aaa932ced682effd2ca853b8323a4b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/dist/index.d.ts @@ -0,0 +1,4 @@ +export { AST_NODE_TYPES, AST_TOKEN_TYPES } from './generated/ast-spec'; +export * from './lib'; +export * from './parser-options'; +export * from './ts-estree'; diff --git a/tools/ui/node_modules/@typescript-eslint/types/dist/index.js b/tools/ui/node_modules/@typescript-eslint/types/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..837a2321b88b2b1458b89eeb3c227944cc874529 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/dist/index.js @@ -0,0 +1,23 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0; +var ast_spec_1 = require("./generated/ast-spec"); +Object.defineProperty(exports, "AST_NODE_TYPES", { enumerable: true, get: function () { return ast_spec_1.AST_NODE_TYPES; } }); +Object.defineProperty(exports, "AST_TOKEN_TYPES", { enumerable: true, get: function () { return ast_spec_1.AST_TOKEN_TYPES; } }); +__exportStar(require("./lib"), exports); +__exportStar(require("./parser-options"), exports); +__exportStar(require("./ts-estree"), exports); diff --git a/tools/ui/node_modules/@typescript-eslint/types/dist/lib.d.ts b/tools/ui/node_modules/@typescript-eslint/types/dist/lib.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..800a927620414603db177786e5cefe1008ca57ee --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/dist/lib.d.ts @@ -0,0 +1 @@ +export type Lib = 'decorators' | 'decorators.legacy' | 'dom' | 'dom.asynciterable' | 'dom.iterable' | 'es5' | 'es6' | 'es7' | 'es2015' | 'es2015.collection' | 'es2015.core' | 'es2015.generator' | 'es2015.iterable' | 'es2015.promise' | 'es2015.proxy' | 'es2015.reflect' | 'es2015.symbol' | 'es2015.symbol.wellknown' | 'es2016' | 'es2016.array.include' | 'es2016.full' | 'es2016.intl' | 'es2017' | 'es2017.arraybuffer' | 'es2017.date' | 'es2017.full' | 'es2017.intl' | 'es2017.object' | 'es2017.sharedmemory' | 'es2017.string' | 'es2017.typedarrays' | 'es2018' | 'es2018.asyncgenerator' | 'es2018.asynciterable' | 'es2018.full' | 'es2018.intl' | 'es2018.promise' | 'es2018.regexp' | 'es2019' | 'es2019.array' | 'es2019.full' | 'es2019.intl' | 'es2019.object' | 'es2019.string' | 'es2019.symbol' | 'es2020' | 'es2020.bigint' | 'es2020.date' | 'es2020.full' | 'es2020.intl' | 'es2020.number' | 'es2020.promise' | 'es2020.sharedmemory' | 'es2020.string' | 'es2020.symbol.wellknown' | 'es2021' | 'es2021.full' | 'es2021.intl' | 'es2021.promise' | 'es2021.string' | 'es2021.weakref' | 'es2022' | 'es2022.array' | 'es2022.error' | 'es2022.full' | 'es2022.intl' | 'es2022.object' | 'es2022.regexp' | 'es2022.string' | 'es2023' | 'es2023.array' | 'es2023.collection' | 'es2023.full' | 'es2023.intl' | 'es2024' | 'es2024.arraybuffer' | 'es2024.collection' | 'es2024.full' | 'es2024.object' | 'es2024.promise' | 'es2024.regexp' | 'es2024.sharedmemory' | 'es2024.string' | 'es2025' | 'es2025.collection' | 'es2025.float16' | 'es2025.full' | 'es2025.intl' | 'es2025.iterator' | 'es2025.promise' | 'es2025.regexp' | 'esnext' | 'esnext.array' | 'esnext.asynciterable' | 'esnext.bigint' | 'esnext.collection' | 'esnext.date' | 'esnext.decorators' | 'esnext.disposable' | 'esnext.error' | 'esnext.float16' | 'esnext.full' | 'esnext.intl' | 'esnext.iterator' | 'esnext.object' | 'esnext.promise' | 'esnext.regexp' | 'esnext.sharedmemory' | 'esnext.string' | 'esnext.symbol' | 'esnext.temporal' | 'esnext.typedarrays' | 'esnext.weakref' | 'lib' | 'scripthost' | 'webworker' | 'webworker.asynciterable' | 'webworker.importscripts' | 'webworker.iterable'; diff --git a/tools/ui/node_modules/@typescript-eslint/types/dist/lib.js b/tools/ui/node_modules/@typescript-eslint/types/dist/lib.js new file mode 100644 index 0000000000000000000000000000000000000000..fa29352b403d88d2f02fcbe7d09ea8259ae45ced --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/dist/lib.js @@ -0,0 +1,6 @@ +"use strict"; +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/types/dist/parser-options.d.ts b/tools/ui/node_modules/@typescript-eslint/types/dist/parser-options.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d0195a283c18df3cf42250f518db1f19284f38cc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/dist/parser-options.d.ts @@ -0,0 +1,68 @@ +import type { Program } from 'typescript'; +import type { Lib } from './lib'; +export type DebugLevel = boolean | ('eslint' | 'typescript' | 'typescript-eslint')[]; +export type CacheDurationSeconds = number | 'Infinity'; +export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | 'latest' | undefined; +export type SourceTypeClassic = 'module' | 'script'; +export type SourceType = 'commonjs' | SourceTypeClassic; +export type JSDocParsingMode = 'all' | 'none' | 'type-info'; +/** + * Granular options to configure the project service. + */ +export interface ProjectServiceOptions { + /** + * Globs of files to allow running with the default project compiler options + * despite not being matched by the project service. + */ + allowDefaultProject?: string[]; + /** + * Path to a TSConfig to use instead of TypeScript's default project configuration. + * @default 'tsconfig.json' + */ + defaultProject?: string; + /** + * Whether to allow TypeScript plugins as configured in the TSConfig. + */ + loadTypeScriptPlugins?: boolean; + /** + * The maximum number of files {@link allowDefaultProject} may match. + * Each file match slows down linting, so if you do need to use this, please + * file an informative issue on typescript-eslint explaining why - so we can + * help you avoid using it! + * @default 8 + */ + maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING?: number; +} +export interface ParserOptions { + [additionalProperties: string]: unknown; + cacheLifetime?: { + glob?: CacheDurationSeconds; + }; + debugLevel?: DebugLevel; + ecmaFeatures?: { + [key: string]: unknown; + globalReturn?: boolean | undefined; + jsx?: boolean | undefined; + } | undefined; + ecmaVersion?: EcmaVersion; + emitDecoratorMetadata?: boolean; + errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; + errorOnUnknownASTType?: boolean; + experimentalDecorators?: boolean; + extraFileExtensions?: string[]; + filePath?: string; + isolatedDeclarations?: boolean; + jsDocParsingMode?: JSDocParsingMode; + jsxFragmentName?: string | null; + jsxPragma?: string | null; + lib?: Lib[]; + programs?: Program[] | null; + project?: boolean | string | string[] | null; + projectFolderIgnoreList?: string[]; + projectService?: boolean | ProjectServiceOptions; + range?: boolean; + sourceType?: SourceType | undefined; + tokens?: boolean; + tsconfigRootDir?: string; + warnOnUnsupportedTypeScriptVersion?: boolean; +} diff --git a/tools/ui/node_modules/@typescript-eslint/types/dist/parser-options.js b/tools/ui/node_modules/@typescript-eslint/types/dist/parser-options.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/dist/parser-options.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts b/tools/ui/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c31ff839662c3c998c9cf4e85c0bf6810144f391 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/dist/ts-estree.d.ts @@ -0,0 +1,188 @@ +import type * as TSESTree from './generated/ast-spec'; +declare module './generated/ast-spec' { + interface BaseNode { + parent: TSESTree.Node; + } + interface Program { + /** + * @remarks This never-used property exists only as a convenience for code that tries to access node parents repeatedly. + */ + parent?: never; + } + interface AccessorPropertyComputedName { + parent: TSESTree.ClassBody; + } + interface AccessorPropertyNonComputedName { + parent: TSESTree.ClassBody; + } + interface TSAbstractAccessorPropertyComputedName { + parent: TSESTree.ClassBody; + } + interface TSAbstractAccessorPropertyNonComputedName { + parent: TSESTree.ClassBody; + } + interface VariableDeclaratorDefiniteAssignment { + parent: TSESTree.VariableDeclaration; + } + interface VariableDeclaratorMaybeInit { + parent: TSESTree.VariableDeclaration; + } + interface VariableDeclaratorNoInit { + parent: TSESTree.VariableDeclaration; + } + interface UsingInForOfDeclarator { + parent: TSESTree.VariableDeclaration; + } + interface UsingInNormalContextDeclarator { + parent: TSESTree.VariableDeclaration; + } + interface CatchClause { + parent: TSESTree.TryStatement; + } + interface ClassBody { + parent: TSESTree.ClassDeclaration | TSESTree.ClassExpression; + } + interface ImportAttribute { + parent: TSESTree.ExportAllDeclaration | TSESTree.ExportNamedDeclaration | TSESTree.ImportDeclaration | TSESTree.TSImportType; + } + interface ImportDefaultSpecifier { + parent: TSESTree.ImportDeclaration; + } + interface ImportNamespaceSpecifier { + parent: TSESTree.ImportDeclaration; + } + interface ImportSpecifier { + parent: TSESTree.ExportAllDeclaration | TSESTree.ExportNamedDeclaration | TSESTree.ImportDeclaration; + } + interface ExportDefaultDeclaration { + parent: TSESTree.BlockStatement | TSESTree.Program | TSESTree.TSModuleBlock; + } + interface ExportNamedDeclarationWithoutSourceWithMultiple { + parent: TSESTree.BlockStatement | TSESTree.Program | TSESTree.TSModuleBlock; + } + interface ExportNamedDeclarationWithoutSourceWithSingle { + parent: TSESTree.BlockStatement | TSESTree.Program | TSESTree.TSModuleBlock; + } + interface ExportNamedDeclarationWithSource { + parent: TSESTree.BlockStatement | TSESTree.Program | TSESTree.TSModuleBlock; + } + interface FunctionDeclarationWithName { + parent: TSESTree.BlockStatement | TSESTree.ExportDefaultDeclaration | TSESTree.ExportNamedDeclaration | TSESTree.Program; + } + interface FunctionDeclarationWithOptionalName { + parent: TSESTree.ExportDefaultDeclaration; + } + interface JSXAttribute { + parent: TSESTree.JSXOpeningElement; + } + interface JSXClosingElement { + parent: TSESTree.JSXElement; + } + interface JSXClosingFragment { + parent: TSESTree.JSXFragment; + } + interface JSXOpeningElement { + parent: TSESTree.JSXElement; + } + interface JSXOpeningFragment { + parent: TSESTree.JSXFragment; + } + interface JSXSpreadAttribute { + parent: TSESTree.JSXOpeningElement; + } + interface MethodDefinitionComputedName { + parent: TSESTree.ClassBody; + } + interface MethodDefinitionNonComputedName { + parent: TSESTree.ClassBody; + } + interface TSAbstractMethodDefinitionComputedName { + parent: TSESTree.ClassBody; + } + interface TSAbstractMethodDefinitionNonComputedName { + parent: TSESTree.ClassBody; + } + interface PropertyComputedName { + parent: TSESTree.ObjectExpression | TSESTree.ObjectPattern; + } + interface PropertyNonComputedName { + parent: TSESTree.ObjectExpression | TSESTree.ObjectPattern; + } + interface PropertyDefinitionComputedName { + parent: TSESTree.ClassBody; + } + interface PropertyDefinitionNonComputedName { + parent: TSESTree.ClassBody; + } + interface TSAbstractPropertyDefinitionComputedName { + parent: TSESTree.ClassBody; + } + interface TSAbstractPropertyDefinitionNonComputedName { + parent: TSESTree.ClassBody; + } + interface SpreadElement { + parent: TSESTree.ArrayExpression | TSESTree.CallExpression | TSESTree.NewExpression | TSESTree.ObjectExpression; + } + interface StaticBlock { + parent: TSESTree.ClassBody; + } + interface SwitchCase { + parent: TSESTree.SwitchStatement; + } + interface TemplateElement { + parent: TSESTree.TemplateLiteral | TSESTree.TSTemplateLiteralType; + } + interface TSCallSignatureDeclaration { + parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral; + } + interface TSConstructSignatureDeclaration { + parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral; + } + interface TSClassImplements { + parent: TSESTree.ClassDeclaration | TSESTree.ClassExpression; + } + interface TSEnumBody { + parent: TSESTree.TSEnumDeclaration; + } + interface TSEnumMember { + parent: TSESTree.TSEnumBody; + } + interface TSIndexSignature { + parent: TSESTree.ClassBody | TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral; + } + interface TSInterfaceBody { + parent: TSESTree.TSInterfaceDeclaration; + } + interface TSInterfaceHeritage { + parent: TSESTree.TSInterfaceBody; + } + interface TSMethodSignatureComputedName { + parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral; + } + interface TSMethodSignatureNonComputedName { + parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral; + } + interface TSModuleBlock { + parent: TSESTree.TSModuleDeclaration; + } + interface TSParameterProperty { + parent: TSESTree.FunctionLike; + } + interface TSPropertySignatureComputedName { + parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral; + } + interface TSPropertySignatureNonComputedName { + parent: TSESTree.TSInterfaceBody | TSESTree.TSTypeLiteral; + } + interface TSTypeParameter { + parent: TSESTree.TSInferType | TSESTree.TSMappedType | TSESTree.TSTypeParameterDeclaration; + } + interface ExportSpecifierWithIdentifierLocal { + parent: TSESTree.ExportNamedDeclaration; + } + interface ExportSpecifierWithStringOrLiteralLocal { + parent: TSESTree.ExportNamedDeclaration; + } +} +export * as TSESTree from './generated/ast-spec'; +export type NodeWithParent = Exclude; diff --git a/tools/ui/node_modules/@typescript-eslint/types/dist/ts-estree.js b/tools/ui/node_modules/@typescript-eslint/types/dist/ts-estree.js new file mode 100644 index 0000000000000000000000000000000000000000..004be3cdb34e29ca34682c84bbbe0fb7932170d8 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/dist/ts-estree.js @@ -0,0 +1,37 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSESTree = void 0; +exports.TSESTree = __importStar(require("./generated/ast-spec")); diff --git a/tools/ui/node_modules/@typescript-eslint/types/package.json b/tools/ui/node_modules/@typescript-eslint/types/package.json new file mode 100644 index 0000000000000000000000000000000000000000..78b83d0a9d766f3b60da6ba967c34a13685075f6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/types/package.json @@ -0,0 +1,103 @@ +{ + "name": "@typescript-eslint/types", + "version": "8.60.1", + "description": "Types for the TypeScript-ESTree AST spec", + "files": [ + "dist", + "!**/*.tsbuildinfo", + "package.json", + "README.md", + "LICENSE" + ], + "type": "commonjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "types": "./dist/index.d.ts", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/typescript-eslint/typescript-eslint.git", + "directory": "packages/types" + }, + "bugs": { + "url": "https://github.com/typescript-eslint/typescript-eslint/issues" + }, + "homepage": "https://typescript-eslint.io", + "license": "MIT", + "keywords": [ + "eslint", + "typescript", + "estree" + ], + "devDependencies": { + "@typescript/native-preview": "7.0.0-dev.20260518.1", + "@vitest/coverage-v8": "^4.0.18", + "eslint": "^10.0.0", + "rimraf": "^5.0.10", + "tsx": "^4.7.2", + "typescript": ">=4.8.4 <6.1.0", + "vitest": "^4.0.18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "nx": { + "name": "types", + "implicitDependencies": [ + "ast-spec" + ], + "includedScripts": [ + "clean" + ], + "targets": { + "build": { + "dependsOn": [ + "copy-ast-spec" + ], + "inputs": [ + "{projectRoot}/src/generated/**/*" + ] + }, + "copy-ast-spec": { + "cache": false, + "command": "tsx tools/copy-ast-spec.mts", + "dependsOn": [ + "ast-spec:build" + ], + "options": { + "cwd": "{projectRoot}" + }, + "outputs": [ + "{projectRoot}/src/generated" + ] + }, + "lint": { + "command": "eslint", + "dependsOn": [ + "typescript-eslint:build", + "eslint-plugin-internal:build" + ] + }, + "typecheck:tsgo": {} + } + }, + "scripts": { + "build": "pnpm exec nx build", + "clean": "rimraf dist/ src/generated/ coverage/", + "copy-ast-spec": "tsx ./tools/copy-ast-spec.mts", + "format": "pnpm -w run format", + "generate-lib": "pnpm -w exec nx run scope-manager:generate-lib", + "lint": "pnpm -w exec nx lint", + "test": "pnpm -w exec nx test", + "typecheck": "pnpm -w exec nx typecheck", + "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/LICENSE b/tools/ui/node_modules/@typescript-eslint/typescript-estree/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a1164108d4d6037cb976384c16e5493917d87157 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 typescript-eslint and other contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/README.md b/tools/ui/node_modules/@typescript-eslint/typescript-estree/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c98838dad403029865246da7fd08274e983ee39b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/README.md @@ -0,0 +1,14 @@ +# `@typescript-eslint/typescript-estree` + +> A parser that produces an ESTree-compatible AST for TypeScript code. + +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/typescript-estree.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/typescript-estree.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) + +## Contributing + +👉 See **https://typescript-eslint.io/packages/typescript-estree** for documentation on this package. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. + + diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad2b2d3156f1bfbb325ca607057fdf49c30d65bc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.d.ts @@ -0,0 +1,8 @@ +import type { SourceFile } from 'typescript'; +import type { ASTMaps } from './convert'; +import type { ParseSettings } from './parseSettings'; +import type { TSESTree } from './ts-estree'; +export declare function astConverter(ast: SourceFile, parseSettings: ParseSettings, shouldPreserveNodeMaps: boolean): { + astMaps: ASTMaps; + estree: TSESTree.Program; +}; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js new file mode 100644 index 0000000000000000000000000000000000000000..82fe7d83dab95ec56883ef42c15fb875c824efa6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ast-converter.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.astConverter = astConverter; +const convert_1 = require("./convert"); +const convert_comments_1 = require("./convert-comments"); +const node_utils_1 = require("./node-utils"); +const simple_traverse_1 = require("./simple-traverse"); +function astConverter(ast, parseSettings, shouldPreserveNodeMaps) { + /** + * The TypeScript compiler produced fundamental parse errors when parsing the + * source. + */ + const { parseDiagnostics } = ast; + if (parseDiagnostics.length) { + throw (0, convert_1.convertError)(parseDiagnostics[0]); + } + /** + * Recursively convert the TypeScript AST into an ESTree-compatible AST + */ + const instance = new convert_1.Converter(ast, { + allowInvalidAST: parseSettings.allowInvalidAST, + errorOnUnknownASTType: parseSettings.errorOnUnknownASTType, + shouldPreserveNodeMaps, + suppressDeprecatedPropertyWarnings: parseSettings.suppressDeprecatedPropertyWarnings, + }); + const estree = instance.convertProgram(); + /** + * Optionally remove range and loc if specified + */ + if (!parseSettings.range || !parseSettings.loc) { + (0, simple_traverse_1.simpleTraverse)(estree, { + enter: node => { + if (!parseSettings.range) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- TS 4.0 made this an error because the types aren't optional + // @ts-expect-error + delete node.range; + } + if (!parseSettings.loc) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- TS 4.0 made this an error because the types aren't optional + // @ts-expect-error + delete node.loc; + } + }, + }); + } + /** + * Optionally convert and include all tokens in the AST + */ + if (parseSettings.tokens) { + estree.tokens = (0, node_utils_1.convertTokens)(ast); + } + /** + * Optionally convert and include all comments in the AST + */ + if (parseSettings.comment) { + estree.comments = (0, convert_comments_1.convertComments)(ast); + } + const astMaps = instance.getASTMaps(); + return { astMaps, estree }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-modifiers.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-modifiers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f00bbce09a52118fc32a12233324e7f60471714 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-modifiers.d.ts @@ -0,0 +1,2 @@ +import * as ts from 'typescript'; +export declare function checkModifiers(node: ts.Node): void; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-modifiers.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-modifiers.js new file mode 100644 index 0000000000000000000000000000000000000000..33ec104d277b98ae2e4c887d7406475ca2ee9f80 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-modifiers.js @@ -0,0 +1,289 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkModifiers = checkModifiers; +const ts = __importStar(require("typescript")); +const getModifiers_1 = require("./getModifiers"); +const node_utils_1 = require("./node-utils"); +const SyntaxKind = ts.SyntaxKind; +// `ts.nodeIsMissing` +function nodeIsMissing(node) { + if (node == null) { + return true; + } + return (node.pos === node.end && + node.pos >= 0 && + node.kind !== SyntaxKind.EndOfFileToken); +} +// `ts.nodeIsPresent` +function nodeIsPresent(node) { + return !nodeIsMissing(node); +} +// `ts.hasAbstractModifier` +function hasAbstractModifier(node) { + return (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node); +} +// `ts.getThisParameter` +function getThisParameter(signature) { + if (signature.parameters.length && !ts.isJSDocSignature(signature)) { + const thisParameter = signature.parameters[0]; + if (parameterIsThisKeyword(thisParameter)) { + return thisParameter; + } + } + return null; +} +// `ts.parameterIsThisKeyword` +function parameterIsThisKeyword(parameter) { + return (0, node_utils_1.isThisIdentifier)(parameter.name); +} +// `ts.getContainingFunction` +function getContainingFunction(node) { + return ts.findAncestor(node.parent, ts.isFunctionLike); +} +// Rewrite version of `ts.nodeCanBeDecorated` +// Returns `true` for both `useLegacyDecorators: true` and `useLegacyDecorators: false` +function nodeCanBeDecorated(node) { + switch (node.kind) { + case SyntaxKind.ClassDeclaration: + return true; + case SyntaxKind.ClassExpression: + // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: true` + return true; + case SyntaxKind.PropertyDeclaration: { + const { parent } = node; + // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: true` + if (ts.isClassDeclaration(parent)) { + return true; + } + // `ts.nodeCanBeDecorated` uses this if `useLegacyDecorators: false` + // parent is already a ClassLike subtype; defensive check + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (ts.isClassLike(parent) && !hasAbstractModifier(node)) { + return true; + } + return false; + } + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + case SyntaxKind.MethodDeclaration: { + const { parent } = node; + // In `ts.nodeCanBeDecorated` + // when `useLegacyDecorators: true` uses `ts.isClassDeclaration` + // when `useLegacyDecorators: true` uses `ts.isClassLike` + return (Boolean(node.body) && + (ts.isClassDeclaration(parent) || ts.isClassLike(parent))); + } + case SyntaxKind.Parameter: { + // `ts.nodeCanBeDecorated` returns `false` if `useLegacyDecorators: false` + const { parent } = node; + const grandparent = parent.parent; + return (Boolean(parent) && + 'body' in parent && + Boolean(parent.body) && + (parent.kind === SyntaxKind.Constructor || + parent.kind === SyntaxKind.MethodDeclaration || + parent.kind === SyntaxKind.SetAccessor) && + getThisParameter(parent) !== node && + Boolean(grandparent) && + grandparent.kind === SyntaxKind.ClassDeclaration); + } + } + return false; +} +function nodeHasIllegalDecorators(node) { + return !!('illegalDecorators' in node && + node.illegalDecorators?.length); +} +function checkModifiers(node) { + // typescript<5.0.0 + if (nodeHasIllegalDecorators(node)) { + throw (0, node_utils_1.createError)(node.illegalDecorators[0], 'Decorators are not valid here.'); + } + for (const decorator of (0, getModifiers_1.getDecorators)(node, + /* includeIllegalDecorators */ true) ?? []) { + // `checkGrammarModifiers` function in typescript + if (!nodeCanBeDecorated(node)) { + if (ts.isMethodDeclaration(node) && !nodeIsPresent(node.body)) { + throw (0, node_utils_1.createError)(decorator, 'A decorator can only decorate a method implementation, not an overload.'); + } + else { + throw (0, node_utils_1.createError)(decorator, 'Decorators are not valid here.'); + } + } + } + const modifiers = (0, getModifiers_1.getModifiers)(node, /* includeIllegalModifiers */ true) ?? []; + for (const modifier of modifiers) { + if (modifier.kind !== SyntaxKind.ReadonlyKeyword) { + if (node.kind === SyntaxKind.PropertySignature || + node.kind === SyntaxKind.MethodSignature) { + throw (0, node_utils_1.createError)(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a type member`); + } + if (node.kind === SyntaxKind.IndexSignature && + (modifier.kind !== SyntaxKind.StaticKeyword || + !ts.isClassLike(node.parent))) { + throw (0, node_utils_1.createError)(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on an index signature`); + } + } + if (modifier.kind !== SyntaxKind.InKeyword && + modifier.kind !== SyntaxKind.OutKeyword && + modifier.kind !== SyntaxKind.ConstKeyword && + node.kind === SyntaxKind.TypeParameter) { + throw (0, node_utils_1.createError)(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a type parameter`); + } + if ((modifier.kind === SyntaxKind.InKeyword || + modifier.kind === SyntaxKind.OutKeyword) && + (node.kind !== SyntaxKind.TypeParameter || + !(ts.isInterfaceDeclaration(node.parent) || + ts.isClassLike(node.parent) || + ts.isTypeAliasDeclaration(node.parent)))) { + throw (0, node_utils_1.createError)(modifier, `'${ts.tokenToString(modifier.kind)}' modifier can only appear on a type parameter of a class, interface or type alias`); + } + if (modifier.kind === SyntaxKind.ReadonlyKeyword && + node.kind !== SyntaxKind.PropertyDeclaration && + node.kind !== SyntaxKind.PropertySignature && + node.kind !== SyntaxKind.IndexSignature && + node.kind !== SyntaxKind.Parameter) { + throw (0, node_utils_1.createError)(modifier, "'readonly' modifier can only appear on a property declaration or index signature."); + } + if (modifier.kind === SyntaxKind.DeclareKeyword && + ts.isClassLike(node.parent) && + !ts.isPropertyDeclaration(node)) { + throw (0, node_utils_1.createError)(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on class elements of this kind.`); + } + if (modifier.kind === SyntaxKind.DeclareKeyword && + ts.isVariableStatement(node)) { + const declarationKind = (0, node_utils_1.getDeclarationKind)(node.declarationList); + if (declarationKind === 'using' || declarationKind === 'await using') { + throw (0, node_utils_1.createError)(modifier, `'declare' modifier cannot appear on a '${declarationKind}' declaration.`); + } + } + if (modifier.kind === SyntaxKind.AbstractKeyword && + node.kind !== SyntaxKind.ClassDeclaration && + node.kind !== SyntaxKind.ConstructorType && + node.kind !== SyntaxKind.MethodDeclaration && + node.kind !== SyntaxKind.PropertyDeclaration && + node.kind !== SyntaxKind.GetAccessor && + node.kind !== SyntaxKind.SetAccessor) { + throw (0, node_utils_1.createError)(modifier, `'${ts.tokenToString(modifier.kind)}' modifier can only appear on a class, method, or property declaration.`); + } + if ((modifier.kind === SyntaxKind.StaticKeyword || + modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.PrivateKeyword) && + (node.parent.kind === SyntaxKind.ModuleBlock || + node.parent.kind === SyntaxKind.SourceFile)) { + throw (0, node_utils_1.createError)(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a module or namespace element.`); + } + if (modifier.kind === SyntaxKind.AccessorKeyword && + node.kind !== SyntaxKind.PropertyDeclaration) { + throw (0, node_utils_1.createError)(modifier, "'accessor' modifier can only appear on a property declaration."); + } + // `checkGrammarAsyncModifier` function in `typescript` + if (modifier.kind === SyntaxKind.AsyncKeyword && + node.kind !== SyntaxKind.MethodDeclaration && + node.kind !== SyntaxKind.FunctionDeclaration && + node.kind !== SyntaxKind.FunctionExpression && + node.kind !== SyntaxKind.ArrowFunction) { + throw (0, node_utils_1.createError)(modifier, "'async' modifier cannot be used here."); + } + // `checkGrammarModifiers` function in `typescript` + if (node.kind === SyntaxKind.Parameter && + (modifier.kind === SyntaxKind.StaticKeyword || + modifier.kind === SyntaxKind.ExportKeyword || + modifier.kind === SyntaxKind.DeclareKeyword || + modifier.kind === SyntaxKind.AsyncKeyword)) { + throw (0, node_utils_1.createError)(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot appear on a parameter.`); + } + // `checkGrammarModifiers` function in `typescript` + if (modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.PrivateKeyword) { + for (const anotherModifier of modifiers) { + if (anotherModifier !== modifier && + (anotherModifier.kind === SyntaxKind.PublicKeyword || + anotherModifier.kind === SyntaxKind.ProtectedKeyword || + anotherModifier.kind === SyntaxKind.PrivateKeyword)) { + throw (0, node_utils_1.createError)(anotherModifier, `Accessibility modifier already seen.`); + } + } + } + // `checkParameter` function in `typescript` + if (node.kind === SyntaxKind.Parameter && + // In `typescript` package, it's `ts.hasSyntacticModifier(node, ts.ModifierFlags.ParameterPropertyModifier)` + // https://github.com/typescript-eslint/typescript-eslint/pull/6615#discussion_r1136489935 + (modifier.kind === SyntaxKind.PublicKeyword || + modifier.kind === SyntaxKind.PrivateKeyword || + modifier.kind === SyntaxKind.ProtectedKeyword || + modifier.kind === SyntaxKind.ReadonlyKeyword || + modifier.kind === SyntaxKind.OverrideKeyword)) { + const func = getContainingFunction(node); + if (!(func?.kind === SyntaxKind.Constructor && nodeIsPresent(func.body))) { + throw (0, node_utils_1.createError)(modifier, 'A parameter property is only allowed in a constructor implementation.'); + } + const param = node; + if (param.dotDotDotToken) { + throw (0, node_utils_1.createError)(modifier, 'A parameter property cannot be a rest parameter.'); + } + if (param.name.kind === SyntaxKind.ArrayBindingPattern || + param.name.kind === SyntaxKind.ObjectBindingPattern) { + throw (0, node_utils_1.createError)(modifier, 'A parameter property may not be declared using a binding pattern.'); + } + } + checkObjectPropertyModifier(node, modifier); + } + // `ts.getModifiers()` can't access invalid modifiers on object properties + // Eg: `({declare a: 1})` + // See https://github.com/typescript-eslint/typescript-eslint/pull/11931#discussion_r2678961730 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- incorrect type + if (node.parent?.kind === SyntaxKind.ObjectLiteralExpression) { + // @ts-expect-error intentional to access deprecated `node.modifiers` + for (const modifier of node.modifiers ?? + []) { + if (ts.isDecorator(modifier) || modifiers.includes(modifier)) { + continue; + } + checkObjectPropertyModifier(node, modifier); + } + } +} +function checkObjectPropertyModifier(node, modifier) { + // From `checkGrammarObjectLiteralExpression` function in `typescript` + if ((modifier.kind !== SyntaxKind.AsyncKeyword || + node.kind !== SyntaxKind.MethodDeclaration) && + node.parent.kind === SyntaxKind.ObjectLiteralExpression) { + throw (0, node_utils_1.createError)(modifier, `'${ts.tokenToString(modifier.kind)}' modifier cannot be used here.`); + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-syntax-errors.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-syntax-errors.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..41813a2f22c11ce9e849cfaa2eb608a8afba1c26 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-syntax-errors.d.ts @@ -0,0 +1,3 @@ +import * as ts from 'typescript'; +import type { TSNode } from './ts-estree'; +export declare function checkSyntaxError(tsNode: ts.Node, parent: TSNode, allowPattern: boolean): void; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-syntax-errors.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-syntax-errors.js new file mode 100644 index 0000000000000000000000000000000000000000..9d40bd05f67a6daceee67eae3f6771b0e5372b5b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/check-syntax-errors.js @@ -0,0 +1,440 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkSyntaxError = checkSyntaxError; +const ts = __importStar(require("typescript")); +const check_modifiers_1 = require("./check-modifiers"); +const node_utils_1 = require("./node-utils"); +const SyntaxKind = ts.SyntaxKind; +function checkSyntaxError(tsNode, parent, allowPattern) { + (0, check_modifiers_1.checkModifiers)(tsNode); + const node = tsNode; + switch (node.kind) { + case SyntaxKind.SwitchStatement: + if (node.caseBlock.clauses.filter(switchCase => switchCase.kind === SyntaxKind.DefaultClause).length > 1) { + throw (0, node_utils_1.createError)(node, "A 'default' clause cannot appear more than once in a 'switch' statement."); + } + break; + case SyntaxKind.ThrowStatement: + if (node.expression.end === node.expression.pos) { + throw (0, node_utils_1.createError)(node, 'A throw statement must throw an expression.'); + } + break; + case SyntaxKind.CatchClause: + if (node.variableDeclaration?.initializer) { + throw (0, node_utils_1.createError)(node.variableDeclaration.initializer, 'Catch clause variable cannot have an initializer.'); + } + break; + case SyntaxKind.FunctionDeclaration: { + const isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node); + const isAsync = (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node); + const isGenerator = !!node.asteriskToken; + if (isDeclare) { + if (node.body) { + throw (0, node_utils_1.createError)(node, 'An implementation cannot be declared in ambient contexts.'); + } + else if (isAsync) { + throw (0, node_utils_1.createError)(node, "'async' modifier cannot be used in an ambient context."); + } + else if (isGenerator) { + throw (0, node_utils_1.createError)(node, 'Generators are not allowed in an ambient context.'); + } + } + else if (!node.body && isGenerator) { + throw (0, node_utils_1.createError)(node, 'A function signature cannot be declared as a generator.'); + } + break; + } + case SyntaxKind.VariableDeclaration: { + const hasExclamationToken = !!node.exclamationToken; + if (hasExclamationToken) { + if (node.initializer) { + throw (0, node_utils_1.createError)(node, 'Declarations with initializers cannot also have definite assignment assertions.'); + } + else if (node.name.kind !== SyntaxKind.Identifier || !node.type) { + throw (0, node_utils_1.createError)(node, 'Declarations with definite assignment assertions must also have type annotations.'); + } + } + if (node.parent.kind === SyntaxKind.VariableDeclarationList) { + const variableDeclarationList = node.parent; + const kind = (0, node_utils_1.getDeclarationKind)(variableDeclarationList); + if (kind === 'using' || kind === 'await using') { + if (variableDeclarationList.parent.kind === SyntaxKind.ForInStatement) { + throw (0, node_utils_1.createError)(variableDeclarationList, `The left-hand side of a 'for...in' statement cannot be a '${kind}' declaration.`); + } + if (variableDeclarationList.parent.kind === SyntaxKind.ForStatement || + variableDeclarationList.parent.kind === SyntaxKind.VariableStatement) { + if (!node.initializer) { + throw (0, node_utils_1.createError)(node, `'${kind}' declarations must be initialized.`); + } + if (node.name.kind !== SyntaxKind.Identifier) { + throw (0, node_utils_1.createError)(node.name, `'${kind}' declarations may not have binding patterns.`); + } + } + } + if (variableDeclarationList.parent.kind === SyntaxKind.VariableStatement) { + const variableStatement = variableDeclarationList.parent; + const hasDeclareKeyword = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, variableStatement); + // Definite assignment only allowed for non-declare let and var + if ((hasDeclareKeyword || + ['await using', 'const', 'using'].includes(kind)) && + hasExclamationToken) { + throw (0, node_utils_1.createError)(node, `A definite assignment assertion '!' is not permitted in this context.`); + } + if (hasDeclareKeyword && + node.initializer && + (['let', 'var'].includes(kind) || node.type)) { + throw (0, node_utils_1.createError)(node, `Initializers are not permitted in ambient contexts.`); + } + // Theoretically, only certain initializers are allowed for declare const, + // (TS1254: A 'const' initializer in an ambient context must be a string + // or numeric literal or literal enum reference.) but we just allow + // all expressions + // Note! No-declare does not mean the variable is not ambient, because + // it can be further nested in other declare contexts. Therefore we cannot + // check for const initializers. + } + } + break; + } + case SyntaxKind.VariableStatement: { + const declarations = node.declarationList.declarations; + if (!declarations.length) { + throw (0, node_utils_1.createError)(node, 'A variable declaration list must have at least one variable declarator.'); + } + break; + } + case SyntaxKind.PropertyAssignment: { + // eslint-disable-next-line @typescript-eslint/no-deprecated + const { exclamationToken, questionToken } = node; + if (questionToken) { + throw (0, node_utils_1.createError)(questionToken, 'A property assignment cannot have a question token.'); + } + if (exclamationToken) { + throw (0, node_utils_1.createError)(exclamationToken, 'A property assignment cannot have an exclamation token.'); + } + break; + } + case SyntaxKind.ShorthandPropertyAssignment: { + // eslint-disable-next-line @typescript-eslint/no-deprecated + const { exclamationToken, modifiers, questionToken } = node; + if (modifiers) { + throw (0, node_utils_1.createError)(modifiers[0], 'A shorthand property assignment cannot have modifiers.'); + } + if (questionToken) { + throw (0, node_utils_1.createError)(questionToken, 'A shorthand property assignment cannot have a question token.'); + } + if (exclamationToken) { + throw (0, node_utils_1.createError)(exclamationToken, 'A shorthand property assignment cannot have an exclamation token.'); + } + break; + } + case SyntaxKind.PropertyDeclaration: { + const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node); + if (isAbstract && node.initializer) { + throw (0, node_utils_1.createError)(node.initializer, `Abstract property cannot have an initializer.`); + } + if (node.name.kind === SyntaxKind.StringLiteral && + node.name.text === 'constructor') { + throw (0, node_utils_1.createError)(node.name, "Classes may not have a field named 'constructor'."); + } + break; + } + case SyntaxKind.TaggedTemplateExpression: + if (node.tag.flags & ts.NodeFlags.OptionalChain) { + throw (0, node_utils_1.createError)(node, 'Tagged template expressions are not permitted in an optional chain.'); + } + break; + case SyntaxKind.BinaryExpression: + if (node.operatorToken.kind !== SyntaxKind.InKeyword && + node.left.kind === SyntaxKind.PrivateIdentifier) { + throw (0, node_utils_1.createError)(node.left, "Private identifiers cannot appear on the right-hand-side of an 'in' expression."); + } + else if (node.right.kind === SyntaxKind.PrivateIdentifier) { + throw (0, node_utils_1.createError)(node.right, "Private identifiers are only allowed on the left-hand-side of an 'in' expression."); + } + break; + case SyntaxKind.MappedType: + if (node.members && node.members.length > 0) { + throw (0, node_utils_1.createError)(node.members[0], 'A mapped type may not declare properties or methods.'); + } + break; + case SyntaxKind.PropertySignature: { + // eslint-disable-next-line @typescript-eslint/no-deprecated + const { initializer } = node; + if (initializer) { + throw (0, node_utils_1.createError)(initializer, 'A property signature cannot have an initializer.'); + } + break; + } + case SyntaxKind.FunctionType: { + // eslint-disable-next-line @typescript-eslint/no-deprecated + const { modifiers } = node; + if (modifiers) { + throw (0, node_utils_1.createError)(modifiers[0], 'A function type cannot have modifiers.'); + } + break; + } + case SyntaxKind.EnumMember: { + const computed = node.name.kind === ts.SyntaxKind.ComputedPropertyName; + if (computed) { + throw (0, node_utils_1.createError)(node.name, 'Computed property names are not allowed in enums.'); + } + if (node.name.kind === SyntaxKind.NumericLiteral || + node.name.kind === SyntaxKind.BigIntLiteral) { + throw (0, node_utils_1.createError)(node.name, 'An enum member cannot have a numeric name.'); + } + break; + } + case SyntaxKind.ExternalModuleReference: + if (node.expression.kind !== SyntaxKind.StringLiteral) { + throw (0, node_utils_1.createError)(node.expression, 'String literal expected.'); + } + break; + case SyntaxKind.PrefixUnaryExpression: + case SyntaxKind.PostfixUnaryExpression: { + const operator = (0, node_utils_1.getTextForTokenKind)(node.operator); + /** + * ESTree uses UpdateExpression for ++/-- + */ + if ((operator === '++' || operator === '--') && + !(0, node_utils_1.isValidAssignmentTarget)(node.operand)) { + throw (0, node_utils_1.createError)(node.operand, 'Invalid left-hand side expression in unary operation'); + } + break; + } + case SyntaxKind.ImportDeclaration: { + const { importClause } = node; + if ( + // TODO swap to `phaseModifier` once we add support for `import defer` + // https://github.com/estree/estree/issues/328 + // eslint-disable-next-line @typescript-eslint/no-deprecated + importClause?.isTypeOnly && + importClause.name && + importClause.namedBindings) { + throw (0, node_utils_1.createError)(importClause, 'A type-only import can specify a default import or named bindings, but not both.'); + } + assertModuleSpecifier(node, false); + break; + } + case SyntaxKind.ExportDeclaration: + assertModuleSpecifier(node, node.exportClause?.kind === SyntaxKind.NamedExports); + break; + case SyntaxKind.ExportSpecifier: { + const local = node.propertyName ?? node.name; + if (local.kind === SyntaxKind.StringLiteral && + parent.kind === SyntaxKind.ExportDeclaration && + parent.moduleSpecifier?.kind !== SyntaxKind.StringLiteral) { + throw (0, node_utils_1.createError)(local, 'A string literal cannot be used as a local exported binding without `from`.'); + } + break; + } + case SyntaxKind.CallExpression: + if (node.expression.kind === SyntaxKind.ImportKeyword && + node.arguments.length !== 1 && + node.arguments.length !== 2) { + throw (0, node_utils_1.createError)(node.arguments.length > 1 ? node.arguments[2] : node, 'Dynamic import requires exactly one or two arguments.'); + } + break; + case SyntaxKind.ClassDeclaration: + if (!node.name && + (!(0, node_utils_1.hasModifier)(ts.SyntaxKind.ExportKeyword, node) || + !(0, node_utils_1.hasModifier)(ts.SyntaxKind.DefaultKeyword, node))) { + throw (0, node_utils_1.createError)(node, "A class declaration without the 'default' modifier must have a name."); + } + // intentional fallthrough + case SyntaxKind.ClassExpression: { + const heritageClauses = node.heritageClauses ?? []; + let seenExtendsClause = false; + let seenImplementsClause = false; + for (const heritageClause of heritageClauses) { + const { token, types } = heritageClause; + if (types.length === 0) { + throw (0, node_utils_1.createError)(heritageClause, `'${ts.tokenToString(token)}' list cannot be empty.`); + } + if (token === SyntaxKind.ExtendsKeyword) { + if (seenExtendsClause) { + throw (0, node_utils_1.createError)(heritageClause, "'extends' clause already seen."); + } + if (seenImplementsClause) { + throw (0, node_utils_1.createError)(heritageClause, "'extends' clause must precede 'implements' clause."); + } + if (types.length > 1) { + throw (0, node_utils_1.createError)(types[1], 'Classes can only extend a single class.'); + } + seenExtendsClause = true; + } + else { + // `implements` + if (seenImplementsClause) { + throw (0, node_utils_1.createError)(heritageClause, "'implements' clause already seen."); + } + for (const heritageType of heritageClause.types) { + if (!(0, node_utils_1.isEntityNameExpression)(heritageType.expression) || + ts.isOptionalChain(heritageType.expression)) { + throw (0, node_utils_1.createError)(heritageType, 'A class can only implement an identifier/qualified-name with optional type arguments.'); + } + } + seenImplementsClause = true; + } + } + break; + } + case SyntaxKind.InterfaceDeclaration: { + const interfaceHeritageClauses = node.heritageClauses ?? []; + let seenExtendsClause = false; + for (const heritageClause of interfaceHeritageClauses) { + const { token, types } = heritageClause; + if (token === SyntaxKind.ImplementsKeyword) { + throw (0, node_utils_1.createError)(heritageClause, "Interface declaration cannot have 'implements' clause."); + } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (token !== SyntaxKind.ExtendsKeyword) { + throw (0, node_utils_1.createError)(heritageClause, 'Unexpected token.'); + } + if (types.length === 0) { + throw (0, node_utils_1.createError)(heritageClause, `'${ts.tokenToString(token)}' list cannot be empty.`); + } + if (seenExtendsClause) { + throw (0, node_utils_1.createError)(heritageClause, "'extends' clause already seen."); + } + seenExtendsClause = true; + for (const heritageType of heritageClause.types) { + if (!(0, node_utils_1.isEntityNameExpression)(heritageType.expression) || + ts.isOptionalChain(heritageType.expression)) { + throw (0, node_utils_1.createError)(heritageType, 'Interface declaration can only extend an identifier/qualified name with optional type arguments.'); + } + } + } + break; + } + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + if (node.parent.kind === SyntaxKind.InterfaceDeclaration || + node.parent.kind === SyntaxKind.TypeLiteral) { + return; + } + // otherwise, it is a non-type accessor - intentional fallthrough + case SyntaxKind.MethodDeclaration: { + const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node); + if (isAbstract && node.body) { + throw (0, node_utils_1.createError)(node.name, node.kind === SyntaxKind.GetAccessor || + node.kind === SyntaxKind.SetAccessor + ? 'An abstract accessor cannot have an implementation.' + : `Method '${(0, node_utils_1.declarationNameToString)(node.name)}' cannot have an implementation because it is marked abstract.`); + } + break; + } + case SyntaxKind.ObjectLiteralExpression: { + if (!allowPattern) { + for (const property of node.properties) { + if ((property.kind === SyntaxKind.GetAccessor || + property.kind === SyntaxKind.SetAccessor || + property.kind === SyntaxKind.MethodDeclaration) && + !property.body) { + throw (0, node_utils_1.createError)(property.end - 1, "'{' expected.", node.getSourceFile()); + } + } + } + break; + } + case SyntaxKind.ImportEqualsDeclaration: + if (node.isTypeOnly && + node.moduleReference.kind !== SyntaxKind.ExternalModuleReference) { + throw (0, node_utils_1.createError)(node, "An import alias cannot use 'import type'"); + } + break; + case SyntaxKind.ModuleDeclaration: { + if (node.flags & ts.NodeFlags.GlobalAugmentation) { + const { body } = node; + if (body == null || body.kind === SyntaxKind.ModuleDeclaration) { + throw (0, node_utils_1.createError)(node.body ?? node, 'Expected a valid module body'); + } + const { name } = node; + if (name.kind !== ts.SyntaxKind.Identifier) { + throw (0, node_utils_1.createError)(name, 'global module augmentation must have an Identifier id'); + } + return; + } + if (ts.isStringLiteral(node.name)) { + return; + } + if (node.body == null) { + throw (0, node_utils_1.createError)(node, 'Expected a module body'); + } + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Fixme: confirm if it's possible + if (node.name.kind !== ts.SyntaxKind.Identifier) { + throw (0, node_utils_1.createError)(node.name, '`namespace`s must have an Identifier id'); + } + break; + } + case SyntaxKind.ForInStatement: + case SyntaxKind.ForOfStatement: { + checkForStatementDeclaration(node); + break; + } + // No default + } +} +function checkForStatementDeclaration(node) { + const { initializer, kind } = node; + const loop = kind === SyntaxKind.ForInStatement ? 'for...in' : 'for...of'; + if (ts.isVariableDeclarationList(initializer)) { + if (initializer.declarations.length !== 1) { + throw (0, node_utils_1.createError)(initializer, `Only a single variable declaration is allowed in a '${loop}' statement.`); + } + const declaration = initializer.declarations[0]; + if (declaration.initializer) { + throw (0, node_utils_1.createError)(declaration, `The variable declaration of a '${loop}' statement cannot have an initializer.`); + } + else if (declaration.type) { + throw (0, node_utils_1.createError)(declaration, `The variable declaration of a '${loop}' statement cannot have a type annotation.`); + } + } + else if (!(0, node_utils_1.isValidAssignmentTarget)(initializer) && + initializer.kind !== SyntaxKind.ObjectLiteralExpression && + initializer.kind !== SyntaxKind.ArrayLiteralExpression) { + throw (0, node_utils_1.createError)(initializer, `The left-hand side of a '${loop}' statement must be a variable or a property access.`); + } +} +function assertModuleSpecifier(node, allowNull) { + if (!allowNull && node.moduleSpecifier == null) { + throw (0, node_utils_1.createError)(node, 'Module specifier must be a string literal.'); + } + if (node.moduleSpecifier && + node.moduleSpecifier.kind !== SyntaxKind.StringLiteral) { + throw (0, node_utils_1.createError)(node.moduleSpecifier, 'Module specifier must be a string literal.'); + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4f3b3f5668f8a2c205b205fcf98e8a54913daccb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.d.ts @@ -0,0 +1,9 @@ +/** + * Clears all of the internal caches. + * Generally you shouldn't need or want to use this. + * Examples of intended uses: + * - In tests to reset parser state to keep tests isolated. + * - In custom lint tooling that iteratively lints one project at a time to prevent OOMs. + */ +export declare function clearCaches(): void; +export declare const clearProgramCache: typeof clearCaches; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.js new file mode 100644 index 0000000000000000000000000000000000000000..0f6a0d8fbd11597a189065c3994fbc385d6e5039 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/clear-caches.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clearProgramCache = void 0; +exports.clearCaches = clearCaches; +const getWatchProgramsForProjects_1 = require("./create-program/getWatchProgramsForProjects"); +const parser_1 = require("./parser"); +const candidateTSConfigRootDirs_1 = require("./parseSettings/candidateTSConfigRootDirs"); +const createParseSettings_1 = require("./parseSettings/createParseSettings"); +const resolveProjectList_1 = require("./parseSettings/resolveProjectList"); +/** + * Clears all of the internal caches. + * Generally you shouldn't need or want to use this. + * Examples of intended uses: + * - In tests to reset parser state to keep tests isolated. + * - In custom lint tooling that iteratively lints one project at a time to prevent OOMs. + */ +function clearCaches() { + (0, candidateTSConfigRootDirs_1.clearCandidateTSConfigRootDirs)(); + (0, parser_1.clearDefaultProjectMatchedFiles)(); + (0, parser_1.clearProgramCache)(); + (0, getWatchProgramsForProjects_1.clearWatchCaches)(); + (0, createParseSettings_1.clearTSConfigMatchCache)(); + (0, createParseSettings_1.clearTSServerProjectService)(); + (0, resolveProjectList_1.clearGlobCache)(); +} +// TODO - delete this in next major +exports.clearProgramCache = clearCaches; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..817cbfe6afaf1160875591df4cb8f670679b054b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.d.ts @@ -0,0 +1,9 @@ +import * as ts from 'typescript'; +import type { TSESTree } from './ts-estree'; +/** + * Convert all comments for the given AST. + * @param ast the AST object + * @returns the converted ESTreeComment + * @private + */ +export declare function convertComments(ast: ts.SourceFile): TSESTree.Comment[]; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js new file mode 100644 index 0000000000000000000000000000000000000000..16ce8274036d4879a5f37356bbb92be529904a6a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js @@ -0,0 +1,61 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.convertComments = convertComments; +const tsutils = __importStar(require("ts-api-utils")); +const ts = __importStar(require("typescript")); +const node_utils_1 = require("./node-utils"); +const ts_estree_1 = require("./ts-estree"); +/** + * Convert all comments for the given AST. + * @param ast the AST object + * @returns the converted ESTreeComment + * @private + */ +function convertComments(ast) { + return Array.from(tsutils.iterateComments(ast), ({ end, kind, pos, value }) => { + const type = kind === ts.SyntaxKind.SingleLineCommentTrivia + ? ts_estree_1.AST_TOKEN_TYPES.Line + : ts_estree_1.AST_TOKEN_TYPES.Block; + const range = [pos, end]; + const loc = (0, node_utils_1.getLocFor)(range, ast); + return { + type, + loc, + range, + value, + }; + }); +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7f20460727ffc0fa377bb6ba20c2382076cb6674 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert.d.ts @@ -0,0 +1,142 @@ +import * as ts from 'typescript'; +import type { TSError } from './node-utils'; +import type { ParserWeakMap, ParserWeakMapESTreeToTSNode } from './parser-options'; +import type { SemanticOrSyntacticError } from './semantic-or-syntactic-errors'; +import type { TSESTree, TSNode } from './ts-estree'; +export interface ConverterOptions { + allowInvalidAST?: boolean; + errorOnUnknownASTType?: boolean; + shouldPreserveNodeMaps?: boolean; + suppressDeprecatedPropertyWarnings?: boolean; +} +/** + * Extends and formats a given error object + * @param error the error object + * @returns converted error object + */ +export declare function convertError(error: SemanticOrSyntacticError | ts.DiagnosticWithLocation): TSError; +export interface ASTMaps { + esTreeNodeToTSNodeMap: ParserWeakMapESTreeToTSNode; + tsNodeToESTreeNodeMap: ParserWeakMap; +} +export declare class Converter { + #private; + private allowPattern; + private readonly ast; + private readonly esTreeNodeToTSNodeMap; + private readonly options; + private readonly tsNodeToESTreeNodeMap; + /** + * Converts a TypeScript node into an ESTree node + * @param ast the full TypeScript AST + * @param options additional options for the conversion + * @returns the converted ESTreeNode + */ + constructor(ast: ts.SourceFile, options?: ConverterOptions); + private convertBindingNameWithTypeAnnotation; + /** + * Coverts body Nodes and add a directive field to StringLiterals + * @param nodes of ts.Node + * @param parent parentNode + * @returns Array of body statements + */ + private convertBodyExpressions; + private convertChainExpression; + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + private convertChild; + /** + * Converts TypeScript node array into an ESTree node list. + * @param children the child `ts.NodeArray` or `ts.Node[]` + * @param parent parentNode + * @returns the converted ESTree node list + */ + private convertChildren; + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + private convertPattern; + /** + * Converts a child into a type annotation. This creates an intermediary + * TypeAnnotation node to match what Flow does. + * @param child The TypeScript AST node to convert. + * @param parent parentNode + * @returns The type annotation node. + */ + private convertTypeAnnotation; + /** + * Converts a ts.Node's typeArguments to TSTypeParameterInstantiation node + * @param typeArguments ts.NodeArray typeArguments + * @param node parent used to create this node + * @returns TypeParameterInstantiation node + */ + private convertTypeArguments; + /** + * Converts a ts.Node's typeParameters to TSTypeParameterDeclaration node + * @param typeParameters ts.Node typeParameters + * @returns TypeParameterDeclaration node + */ + private convertTypeParameters; + /** + * Converts an array of ts.Node parameters into an array of ESTreeNode params + * @param parameters An array of ts.Node params to be converted + * @returns an array of converted ESTreeNode params + */ + private convertParameters; + /** + * Converts a TypeScript node into an ESTree node. + * @param node the child ts.Node + * @param parent parentNode + * @param allowPattern flag to determine if patterns are allowed + * @returns the converted ESTree node + */ + private converter; + private convertImportAttributes; + private convertJSXIdentifier; + private convertJSXNamespaceOrIdentifier; + /** + * Converts a TypeScript JSX node.tagName into an ESTree node.name + * @param node the tagName object from a JSX ts.Node + * @returns the converted ESTree name object + */ + private convertJSXTagName; + private convertMethodSignature; + /** + * Uses the provided range location to adjust the location data of the given Node + * @param result The node that will have its location data mutated + * @param childRange The child node range used to expand location + */ + private fixParentLocation; + /** + * Converts a TypeScript node into an ESTree node. + * The core of the conversion logic: + * Identify and convert each relevant TypeScript SyntaxKind + * @returns the converted ESTree node + */ + private convertNode; + private createNode; + convertProgram(): TSESTree.Program; + /** + * For nodes that are copied directly from the TypeScript AST into + * ESTree mostly as-is. The only difference is the addition of a type + * property instead of a kind property. Recursively copies all children. + */ + private deeplyCopy; + /** + * Fixes the exports of the given ts.Node + * @returns the ESTreeNode with fixed exports + */ + private fixExports; + getASTMaps(): ASTMaps; + /** + * Register specific TypeScript node into map with first ESTree node provided + */ + private registerTSNodeInNodeMap; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert.js new file mode 100644 index 0000000000000000000000000000000000000000..b1df0d29fbdb5a25733e3c65b12414dd010f5086 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/convert.js @@ -0,0 +1,2394 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Converter = void 0; +exports.convertError = convertError; +// There's lots of funny stuff due to the typing of ts.Node +/* eslint-disable @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access */ +const ts = __importStar(require("typescript")); +const check_syntax_errors_1 = require("./check-syntax-errors"); +const getModifiers_1 = require("./getModifiers"); +const node_utils_1 = require("./node-utils"); +const ts_estree_1 = require("./ts-estree"); +const SyntaxKind = ts.SyntaxKind; +/** + * Extends and formats a given error object + * @param error the error object + * @returns converted error object + */ +function convertError(error) { + return (0, node_utils_1.createError)(error.start, ('message' in error && error.message) || error.messageText, error.file); +} +class Converter { + allowPattern = false; + ast; + esTreeNodeToTSNodeMap = new WeakMap(); + options; + tsNodeToESTreeNodeMap = new WeakMap(); + /** + * Converts a TypeScript node into an ESTree node + * @param ast the full TypeScript AST + * @param options additional options for the conversion + * @returns the converted ESTreeNode + */ + constructor(ast, options) { + this.ast = ast; + this.options = { ...options }; + } + #checkSyntaxError(node, parent) { + if (this.options.allowInvalidAST) { + return; + } + (0, check_syntax_errors_1.checkSyntaxError)(node, parent, this.allowPattern); + } + #isValidEscape(text) { + if (/\\[xu]/.test(text)) { + const hasInvalidUnicodeEscape = /\\u(?![0-9a-fA-F]{4}|{)/.test(text); + const hasInvalidHexEscape = /\\x(?![0-9a-fA-F]{2})/.test(text); + return !hasInvalidUnicodeEscape && !hasInvalidHexEscape; + } + return true; + } + #throwError(node, message) { + if (this.options.allowInvalidAST) { + return; + } + throw (0, node_utils_1.createError)(node, message, this.ast); + } + /** + * Creates a getter for a property under aliasKey that returns the value under + * valueKey. If suppressDeprecatedPropertyWarnings is not enabled, the + * getter also console warns about the deprecation. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/6469 + */ + #withDeprecatedAliasGetter(node, aliasKey, valueKey, suppressWarnings = false) { + let warned = suppressWarnings; + Object.defineProperty(node, aliasKey, { + configurable: true, + get: this.options.suppressDeprecatedPropertyWarnings + ? () => node[valueKey] + : () => { + if (!warned) { + process.emitWarning(`The '${aliasKey}' property is deprecated on ${node.type} nodes. Use '${valueKey}' instead. See https://tseslint.com/key-property-deprecated.`, 'DeprecationWarning'); + warned = true; + } + return node[valueKey]; + }, + set(value) { + Object.defineProperty(node, aliasKey, { + enumerable: true, + value, + writable: true, + }); + }, + }); + return node; + } + #withDeprecatedGetter(node, deprecatedKey, preferredKey, value) { + let warned = false; + Object.defineProperty(node, deprecatedKey, { + configurable: true, + get: this.options.suppressDeprecatedPropertyWarnings + ? () => value + : () => { + if (!warned) { + let message = `The '${deprecatedKey}' property is deprecated on ${node.type} nodes.`; + if (preferredKey) { + message += ` Use ${preferredKey} instead.`; + } + message += ' See https://tseslint.com/key-property-deprecated.'; + process.emitWarning(message, 'DeprecationWarning'); + warned = true; + } + return value; + }, + set(value) { + Object.defineProperty(node, deprecatedKey, { + enumerable: true, + value, + writable: true, + }); + }, + }); + return node; + } + convertBindingNameWithTypeAnnotation(name, tsType, parent) { + const id = this.convertPattern(name); + if (tsType) { + id.typeAnnotation = this.convertTypeAnnotation(tsType, parent); + this.fixParentLocation(id, id.typeAnnotation.range); + } + return id; + } + /** + * Coverts body Nodes and add a directive field to StringLiterals + * @param nodes of ts.Node + * @param parent parentNode + * @returns Array of body statements + */ + convertBodyExpressions(nodes, parent) { + let allowDirectives = (0, node_utils_1.canContainDirective)(parent); + return (nodes + .map(statement => { + const child = this.convertChild(statement); + if (allowDirectives) { + if (child?.expression && + ts.isExpressionStatement(statement) && + ts.isStringLiteral(statement.expression)) { + const raw = child.expression.raw; + child.directive = raw.slice(1, -1); + return child; // child can be null, but it's filtered below + } + allowDirectives = false; + } + return child; // child can be null, but it's filtered below + }) + // filter out unknown nodes for now + .filter(statement => statement)); + } + convertChainExpression(node, tsNode) { + const { child, isOptional } = (() => { + if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) { + return { child: node.object, isOptional: node.optional }; + } + if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) { + return { child: node.callee, isOptional: node.optional }; + } + return { child: node.expression, isOptional: false }; + })(); + const isChildUnwrappable = (0, node_utils_1.isChildUnwrappableOptionalChain)(tsNode, child); + if (!isChildUnwrappable && !isOptional) { + return node; + } + if (isChildUnwrappable && (0, node_utils_1.isChainExpression)(child)) { + // unwrap the chain expression child + const newChild = child.expression; + if (node.type === ts_estree_1.AST_NODE_TYPES.MemberExpression) { + node.object = newChild; + } + else if (node.type === ts_estree_1.AST_NODE_TYPES.CallExpression) { + node.callee = newChild; + } + else { + node.expression = newChild; + } + } + return this.createNode(tsNode, { + type: ts_estree_1.AST_NODE_TYPES.ChainExpression, + expression: node, + }); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertChild(child, parent) { + return this.converter(child, parent, false); + } + /** + * Converts TypeScript node array into an ESTree node list. + * @param children the child `ts.NodeArray` or `ts.Node[]` + * @param parent parentNode + * @returns the converted ESTree node list + */ + convertChildren(children, parent) { + return children.map(child => this.converter(child, parent, false)); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param child the child ts.Node + * @param parent parentNode + * @returns the converted ESTree node + */ + convertPattern(child, parent) { + return this.converter(child, parent, true); + } + /** + * Converts a child into a type annotation. This creates an intermediary + * TypeAnnotation node to match what Flow does. + * @param child The TypeScript AST node to convert. + * @param parent parentNode + * @returns The type annotation node. + */ + convertTypeAnnotation(child, parent) { + // in FunctionType and ConstructorType typeAnnotation has 2 characters `=>` and in other places is just colon + const offset = parent?.kind === SyntaxKind.FunctionType || + parent?.kind === SyntaxKind.ConstructorType + ? 2 + : 1; + const annotationStartCol = child.getFullStart() - offset; + const range = [annotationStartCol, child.end]; + const loc = (0, node_utils_1.getLocFor)(range, this.ast); + return { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAnnotation, + loc, + range, + typeAnnotation: this.convertChild(child), + }; + } + /** + * Converts a ts.Node's typeArguments to TSTypeParameterInstantiation node + * @param typeArguments ts.NodeArray typeArguments + * @param node parent used to create this node + * @returns TypeParameterInstantiation node + */ + convertTypeArguments(node) { + const { typeArguments } = node; + if (!typeArguments) { + return undefined; + } + const greaterThanToken = (0, node_utils_1.findNextToken)(typeArguments, this.ast, this.ast); + const range = [typeArguments.pos - 1, greaterThanToken.end]; + if (typeArguments.length === 0) { + this.#throwError(range, 'Type argument list cannot be empty.'); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterInstantiation, + range, + params: this.convertChildren(typeArguments), + }); + } + /** + * Converts a ts.Node's typeParameters to TSTypeParameterDeclaration node + * @param typeParameters ts.Node typeParameters + * @returns TypeParameterDeclaration node + */ + convertTypeParameters(node) { + const { typeParameters } = node; + if (!typeParameters) { + return undefined; + } + const greaterThanToken = (0, node_utils_1.findNextToken)(typeParameters, this.ast, this.ast); + const range = [ + typeParameters.pos - 1, + greaterThanToken.end, + ]; + if (typeParameters.length === 0) { + this.#throwError(range, 'Type parameter list cannot be empty.'); + } + return { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameterDeclaration, + loc: (0, node_utils_1.getLocFor)(range, this.ast), + range, + params: this.convertChildren(typeParameters), + }; + } + /** + * Converts an array of ts.Node parameters into an array of ESTreeNode params + * @param parameters An array of ts.Node params to be converted + * @returns an array of converted ESTreeNode params + */ + convertParameters(parameters) { + if (!parameters?.length) { + return []; + } + return parameters.map(param => { + const convertedParam = this.convertChild(param); + convertedParam.decorators = this.convertChildren((0, getModifiers_1.getDecorators)(param) ?? []); + return convertedParam; + }); + } + /** + * Converts a TypeScript node into an ESTree node. + * @param node the child ts.Node + * @param parent parentNode + * @param allowPattern flag to determine if patterns are allowed + * @returns the converted ESTree node + */ + converter(node, parent, allowPattern) { + /** + * Exit early for null and undefined + */ + if (!node) { + return null; + } + const pattern = this.allowPattern; + if (allowPattern != null) { + this.allowPattern = allowPattern; + } + const parentNode = (parent ?? node.parent); + this.#checkSyntaxError(node, parentNode); + const result = this.convertNode(node, parentNode); + this.registerTSNodeInNodeMap(node, result); + this.allowPattern = pattern; + return result; + } + convertImportAttributes(node) { + // eslint-disable-next-line @typescript-eslint/no-deprecated + const attributes = node.attributes ?? node.assertClause; + return this.convertChildren(attributes?.elements ?? []); + } + convertJSXIdentifier(node) { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: node.getText(), + }); + this.registerTSNodeInNodeMap(node, result); + return result; + } + convertJSXNamespaceOrIdentifier(node) { + // TypeScript@5.1 added in ts.JsxNamespacedName directly + // We prefer using that if it's relevant for this node type + if (node.kind === ts.SyntaxKind.JsxNamespacedName) { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXNamespacedName, + name: this.createNode(node.name, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: node.name.text, + }), + namespace: this.createNode(node.namespace, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + name: node.namespace.text, + }), + }); + this.registerTSNodeInNodeMap(node, result); + return result; + } + // TypeScript@<5.1 has to manually parse the JSX attributes + const text = node.getText(); + const colonIndex = text.indexOf(':'); + // this is intentional we can ignore conversion if `:` is in first character + if (colonIndex > 0) { + const range = (0, node_utils_1.getRange)(node, this.ast); + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXNamespacedName, + range, + name: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + range: [range[0] + colonIndex + 1, range[1]], + name: text.slice(colonIndex + 1), + }), + namespace: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXIdentifier, + range: [range[0], range[0] + colonIndex], + name: text.slice(0, colonIndex), + }), + }); + this.registerTSNodeInNodeMap(node, result); + return result; + } + return this.convertJSXIdentifier(node); + } + /** + * Converts a TypeScript JSX node.tagName into an ESTree node.name + * @param node the tagName object from a JSX ts.Node + * @returns the converted ESTree name object + */ + convertJSXTagName(node, parent) { + let result; + switch (node.kind) { + case SyntaxKind.PropertyAccessExpression: + if (node.name.kind === SyntaxKind.PrivateIdentifier) { + // This is one of the few times where TS explicitly errors, and doesn't even gracefully handle the syntax. + // So we shouldn't ever get into this state to begin with. + this.#throwError(node.name, 'Non-private identifier expected.'); + } + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXMemberExpression, + object: this.convertJSXTagName(node.expression, parent), + property: this.convertJSXIdentifier(node.name), + }); + break; + case SyntaxKind.ThisKeyword: + case SyntaxKind.Identifier: + default: + return this.convertJSXNamespaceOrIdentifier(node); + } + this.registerTSNodeInNodeMap(node, result); + return result; + } + convertMethodSignature(node) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSMethodSignature, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + key: this.convertChild(node.name), + kind: (() => { + switch (node.kind) { + case SyntaxKind.GetAccessor: + return 'get'; + case SyntaxKind.SetAccessor: + return 'set'; + case SyntaxKind.MethodSignature: + return 'method'; + } + })(), + optional: (0, node_utils_1.isOptional)(node), + params: this.convertParameters(node.parameters), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeParameters: this.convertTypeParameters(node), + }); + } + /** + * Uses the provided range location to adjust the location data of the given Node + * @param result The node that will have its location data mutated + * @param childRange The child node range used to expand location + */ + fixParentLocation(result, childRange) { + if (childRange[0] < result.range[0]) { + result.range[0] = childRange[0]; + result.loc.start = (0, node_utils_1.getLineAndCharacterFor)(result.range[0], this.ast); + } + if (childRange[1] > result.range[1]) { + result.range[1] = childRange[1]; + result.loc.end = (0, node_utils_1.getLineAndCharacterFor)(result.range[1], this.ast); + } + } + /** + * Converts a TypeScript node into an ESTree node. + * The core of the conversion logic: + * Identify and convert each relevant TypeScript SyntaxKind + * @returns the converted ESTree node + */ + convertNode(node, parent) { + switch (node.kind) { + case SyntaxKind.SourceFile: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Program, + range: [node.getStart(this.ast), node.endOfFileToken.end], + body: this.convertBodyExpressions(node.statements, node), + comments: undefined, + sourceType: node.externalModuleIndicator ? 'module' : 'script', + tokens: undefined, + }); + } + case SyntaxKind.Block: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.BlockStatement, + body: this.convertBodyExpressions(node.statements, node), + }); + } + case SyntaxKind.Identifier: { + if ((0, node_utils_1.isThisInTypeQuery)(node)) { + // special case for `typeof this.foo` - TS emits an Identifier for `this` + // but we want to treat it as a ThisExpression for consistency + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThisExpression, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + decorators: [], + name: node.text, + optional: false, + typeAnnotation: undefined, + }); + } + case SyntaxKind.PrivateIdentifier: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.PrivateIdentifier, + // typescript includes the `#` in the text + name: node.text.slice(1), + }); + } + case SyntaxKind.WithStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.WithStatement, + body: this.convertChild(node.statement), + object: this.convertChild(node.expression), + }); + // Control Flow + case SyntaxKind.ReturnStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ReturnStatement, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.LabeledStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.LabeledStatement, + body: this.convertChild(node.statement), + label: this.convertChild(node.label), + }); + case SyntaxKind.ContinueStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ContinueStatement, + label: this.convertChild(node.label), + }); + case SyntaxKind.BreakStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.BreakStatement, + label: this.convertChild(node.label), + }); + // Choice + case SyntaxKind.IfStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.IfStatement, + alternate: this.convertChild(node.elseStatement), + consequent: this.convertChild(node.thenStatement), + test: this.convertChild(node.expression), + }); + case SyntaxKind.SwitchStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SwitchStatement, + cases: this.convertChildren(node.caseBlock.clauses), + discriminant: this.convertChild(node.expression), + }); + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SwitchCase, + // expression is present in case only + consequent: this.convertChildren(node.statements), + test: node.kind === SyntaxKind.CaseClause + ? this.convertChild(node.expression) + : null, + }); + // Exceptions + case SyntaxKind.ThrowStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThrowStatement, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.TryStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TryStatement, + block: this.convertChild(node.tryBlock), + finalizer: this.convertChild(node.finallyBlock), + handler: this.convertChild(node.catchClause), + }); + case SyntaxKind.CatchClause: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.CatchClause, + body: this.convertChild(node.block), + param: node.variableDeclaration + ? this.convertBindingNameWithTypeAnnotation(node.variableDeclaration.name, node.variableDeclaration.type) + : null, + }); + // Loops + case SyntaxKind.WhileStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.WhileStatement, + body: this.convertChild(node.statement), + test: this.convertChild(node.expression), + }); + /** + * Unlike other parsers, TypeScript calls a "DoWhileStatement" + * a "DoStatement" + */ + case SyntaxKind.DoStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.DoWhileStatement, + body: this.convertChild(node.statement), + test: this.convertChild(node.expression), + }); + case SyntaxKind.ForStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForStatement, + body: this.convertChild(node.statement), + init: this.convertChild(node.initializer), + test: this.convertChild(node.condition), + update: this.convertChild(node.incrementor), + }); + case SyntaxKind.ForInStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForInStatement, + body: this.convertChild(node.statement), + left: this.convertPattern(node.initializer), + right: this.convertChild(node.expression), + }); + case SyntaxKind.ForOfStatement: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ForOfStatement, + await: node.awaitModifier?.kind === SyntaxKind.AwaitKeyword, + body: this.convertChild(node.statement), + left: this.convertPattern(node.initializer), + right: this.convertChild(node.expression), + }); + } + // Declarations + case SyntaxKind.FunctionDeclaration: { + const isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node); + const isAsync = (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node); + const isGenerator = !!node.asteriskToken; + const result = this.createNode(node, { + // declare implies no body due to the invariant above + type: !node.body + ? ts_estree_1.AST_NODE_TYPES.TSDeclareFunction + : ts_estree_1.AST_NODE_TYPES.FunctionDeclaration, + async: isAsync, + body: this.convertChild(node.body) || undefined, + declare: isDeclare, + expression: false, + generator: isGenerator, + id: this.convertChild(node.name), + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: this.convertTypeParameters(node), + }); + return this.fixExports(node, result); + } + case SyntaxKind.VariableDeclaration: { + const hasExclamationToken = !!node.exclamationToken; + const init = this.convertChild(node.initializer); + const id = this.convertBindingNameWithTypeAnnotation(node.name, node.type, node); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclarator, + definite: hasExclamationToken, + id, + init, + }); + } + case SyntaxKind.VariableStatement: { + const declarations = node.declarationList.declarations; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration, + declarations: this.convertChildren(declarations), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + kind: (0, node_utils_1.getDeclarationKind)(node.declarationList), + }); + /** + * Semantically, decorators are not allowed on variable declarations, + * Pre 4.8 TS would include them in the AST, so we did as well. + * However as of 4.8 TS no longer includes it (as it is, well, invalid). + * + * So for consistency across versions, we no longer include it either. + */ + return this.fixExports(node, result); + } + // mostly for for-of, for-in + case SyntaxKind.VariableDeclarationList: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.VariableDeclaration, + declarations: this.convertChildren(node.declarations), + declare: false, + kind: (0, node_utils_1.getDeclarationKind)(node), + }); + } + // Expressions + case SyntaxKind.ExpressionStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExpressionStatement, + directive: undefined, + expression: this.convertChild(node.expression), + }); + case SyntaxKind.ThisKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ThisExpression, + }); + case SyntaxKind.ArrayLiteralExpression: { + // TypeScript uses ArrayLiteralExpression in destructuring assignment, too + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayPattern, + decorators: [], + elements: node.elements.map(el => this.convertPattern(el)), + optional: false, + typeAnnotation: undefined, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayExpression, + elements: this.convertChildren(node.elements), + }); + } + case SyntaxKind.ObjectLiteralExpression: { + // TypeScript uses ObjectLiteralExpression in destructuring assignment, too + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectPattern, + decorators: [], + optional: false, + properties: node.properties.map(el => this.convertPattern(el)), + typeAnnotation: undefined, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectExpression, + properties: this.convertChildren(node.properties), + }); + } + case SyntaxKind.PropertyAssignment: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: (0, node_utils_1.isComputedProperty)(node.name), + key: this.convertChild(node.name), + kind: 'init', + method: false, + optional: false, + shorthand: false, + value: this.converter(node.initializer, node, this.allowPattern), + }); + } + case SyntaxKind.ShorthandPropertyAssignment: { + if (node.objectAssignmentInitializer) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: false, + key: this.convertChild(node.name), + kind: 'init', + method: false, + optional: false, + shorthand: true, + value: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: this.convertPattern(node.name), + optional: false, + right: this.convertChild(node.objectAssignmentInitializer), + typeAnnotation: undefined, + }), + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: false, + key: this.convertChild(node.name), + kind: 'init', + method: false, + optional: false, + shorthand: true, + value: this.convertChild(node.name), + }); + } + case SyntaxKind.ComputedPropertyName: + return this.convertChild(node.expression); + case SyntaxKind.PropertyDeclaration: { + const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node); + const isAccessor = (0, node_utils_1.hasModifier)(SyntaxKind.AccessorKeyword, node); + const type = (() => { + if (isAccessor) { + if (isAbstract) { + return ts_estree_1.AST_NODE_TYPES.TSAbstractAccessorProperty; + } + return ts_estree_1.AST_NODE_TYPES.AccessorProperty; + } + if (isAbstract) { + return ts_estree_1.AST_NODE_TYPES.TSAbstractPropertyDefinition; + } + return ts_estree_1.AST_NODE_TYPES.PropertyDefinition; + })(); + const key = this.convertChild(node.name); + return this.createNode(node, { + type, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + decorators: this.convertChildren((0, getModifiers_1.getDecorators)(node) ?? []), + definite: !!node.exclamationToken, + key, + optional: (key.type === ts_estree_1.AST_NODE_TYPES.Literal || + node.name.kind === SyntaxKind.Identifier || + node.name.kind === SyntaxKind.ComputedPropertyName || + node.name.kind === SyntaxKind.PrivateIdentifier) && + !!node.questionToken, + override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node), + value: isAbstract ? null : this.convertChild(node.initializer), + }); + } + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: { + if (node.parent.kind === SyntaxKind.InterfaceDeclaration || + node.parent.kind === SyntaxKind.TypeLiteral) { + return this.convertMethodSignature(node); + } + } + // otherwise, it is a non-type accessor - intentional fallthrough + case SyntaxKind.MethodDeclaration: { + const method = this.createNode(node, { + type: !node.body + ? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression + : ts_estree_1.AST_NODE_TYPES.FunctionExpression, + range: [node.parameters.pos - 1, node.end], + async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node), + body: this.convertChild(node.body), + declare: false, + expression: false, // ESTreeNode as ESTreeNode here + generator: !!node.asteriskToken, + id: null, + params: [], + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: this.convertTypeParameters(node), + }); + if (method.typeParameters) { + this.fixParentLocation(method, method.typeParameters.range); + } + let result; + if (parent.kind === SyntaxKind.ObjectLiteralExpression) { + method.params = this.convertChildren(node.parameters); + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: (0, node_utils_1.isComputedProperty)(node.name), + key: this.convertChild(node.name), + kind: 'init', + method: node.kind === SyntaxKind.MethodDeclaration, + optional: !!node.questionToken, + shorthand: false, + value: method, + }); + } + else { + // class + const isAbstract = (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node); + /** + * Unlike in object literal methods, class method params can have decorators + */ + method.params = this.convertParameters(node.parameters); + /** + * TypeScript class methods can be defined as "abstract" + */ + const methodDefinitionType = isAbstract + ? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition + : ts_estree_1.AST_NODE_TYPES.MethodDefinition; + result = this.createNode(node, { + type: methodDefinitionType, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + decorators: this.convertChildren((0, getModifiers_1.getDecorators)(node) ?? []), + key: this.convertChild(node.name), + kind: 'method', + optional: !!node.questionToken, + override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + value: method, + }); + } + if (node.kind === SyntaxKind.GetAccessor) { + result.kind = 'get'; + } + else if (node.kind === SyntaxKind.SetAccessor) { + result.kind = 'set'; + } + else if (!result.static && + node.name.kind === SyntaxKind.StringLiteral && + node.name.text === 'constructor' && + result.type !== ts_estree_1.AST_NODE_TYPES.Property) { + result.kind = 'constructor'; + } + return result; + } + // TypeScript uses this even for static methods named "constructor" + case SyntaxKind.Constructor: { + const lastModifier = (0, node_utils_1.getLastModifier)(node); + const constructorToken = (lastModifier && (0, node_utils_1.findNextToken)(lastModifier, node, this.ast)) ?? + node.getFirstToken(); + const constructor = this.createNode(node, { + type: !node.body + ? ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression + : ts_estree_1.AST_NODE_TYPES.FunctionExpression, + range: [node.parameters.pos - 1, node.end], + async: false, + body: this.convertChild(node.body), + declare: false, + expression: false, // is not present in ESTreeNode + generator: false, + id: null, + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: this.convertTypeParameters(node), + }); + if (constructor.typeParameters) { + this.fixParentLocation(constructor, constructor.typeParameters.range); + } + const constructorKey = constructorToken.kind === SyntaxKind.StringLiteral + ? this.createNode(constructorToken, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: constructorToken.getText(), + value: 'constructor', + }) + : this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + range: [ + constructorToken.getStart(this.ast), + constructorToken.end, + ], + decorators: [], + name: 'constructor', + optional: false, + typeAnnotation: undefined, + }); + const isStatic = (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node); + return this.createNode(node, { + type: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node) + ? ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition + : ts_estree_1.AST_NODE_TYPES.MethodDefinition, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: false, + decorators: [], + key: constructorKey, + kind: isStatic ? 'method' : 'constructor', + optional: false, + override: false, + static: isStatic, + value: constructor, + }); + } + case SyntaxKind.FunctionExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.FunctionExpression, + async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node), + body: this.convertChild(node.body), + declare: false, + expression: false, + generator: !!node.asteriskToken, + id: this.convertChild(node.name), + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: this.convertTypeParameters(node), + }); + } + case SyntaxKind.SuperKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Super, + }); + case SyntaxKind.ArrayBindingPattern: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrayPattern, + decorators: [], + elements: node.elements.map(el => this.convertPattern(el)), + optional: false, + typeAnnotation: undefined, + }); + // occurs with missing array elements like [,] + case SyntaxKind.OmittedExpression: + return null; + case SyntaxKind.ObjectBindingPattern: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectPattern, + decorators: [], + optional: false, + properties: node.elements.map(el => this.convertPattern(el)), + typeAnnotation: undefined, + }); + case SyntaxKind.BindingElement: { + if (parent.kind === SyntaxKind.ArrayBindingPattern) { + const arrayItem = this.convertChild(node.name, parent); + if (node.initializer) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: arrayItem, + optional: false, + right: this.convertChild(node.initializer), + typeAnnotation: undefined, + }); + } + if (node.dotDotDotToken) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: arrayItem, + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + return arrayItem; + } + let result; + if (node.dotDotDotToken) { + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertChild(node.propertyName ?? node.name), + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + else { + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: node.propertyName?.kind === SyntaxKind.ComputedPropertyName, + key: this.convertChild(node.propertyName ?? node.name), + kind: 'init', + method: false, + optional: false, + shorthand: !node.propertyName, + value: this.convertChild(node.name), + }); + } + if (node.initializer) { + result.value = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + range: [node.name.getStart(this.ast), node.initializer.end], + decorators: [], + left: this.convertChild(node.name), + optional: false, + right: this.convertChild(node.initializer), + typeAnnotation: undefined, + }); + } + return result; + } + case SyntaxKind.ArrowFunction: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression, + async: (0, node_utils_1.hasModifier)(SyntaxKind.AsyncKeyword, node), + body: this.convertChild(node.body), + expression: node.body.kind !== SyntaxKind.Block, + generator: false, + id: null, + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: this.convertTypeParameters(node), + }); + } + case SyntaxKind.YieldExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.YieldExpression, + argument: this.convertChild(node.expression), + delegate: !!node.asteriskToken, + }); + case SyntaxKind.AwaitExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AwaitExpression, + argument: this.convertChild(node.expression), + }); + // Template Literals + case SyntaxKind.NoSubstitutionTemplateLiteral: { + const rawText = this.ast.text.slice(node.getStart(this.ast) + 1, node.end - 1); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral, + expressions: [], + quasis: [ + this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateElement, + tail: true, + value: { + cooked: node.parent.kind === SyntaxKind.TaggedTemplateExpression && + !this.#isValidEscape(rawText) + ? null + : node.text, + raw: rawText, + }, + }), + ], + }); + } + case SyntaxKind.TemplateExpression: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateLiteral, + expressions: [], + quasis: [this.convertChild(node.head)], + }); + node.templateSpans.forEach(templateSpan => { + result.expressions.push(this.convertChild(templateSpan.expression)); + result.quasis.push(this.convertChild(templateSpan.literal)); + }); + return result; + } + case SyntaxKind.TaggedTemplateExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TaggedTemplateExpression, + quasi: this.convertChild(node.template), + tag: this.convertChild(node.tag), + typeArguments: this.convertTypeArguments(node), + }); + } + case SyntaxKind.TemplateHead: + case SyntaxKind.TemplateMiddle: + case SyntaxKind.TemplateTail: { + const tail = node.kind === SyntaxKind.TemplateTail; + const rawText = this.ast.text.slice(node.getStart(this.ast) + 1, node.end - (tail ? 1 : 2)); + const isTagged = node.kind === SyntaxKind.TemplateHead + ? node.parent.parent.kind === SyntaxKind.TaggedTemplateExpression + : node.parent.parent.parent.kind === + SyntaxKind.TaggedTemplateExpression; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TemplateElement, + tail, + value: { + cooked: isTagged && !this.#isValidEscape(rawText) ? null : node.text, + raw: rawText, + }, + }); + } + // Patterns + case SyntaxKind.SpreadAssignment: + case SyntaxKind.SpreadElement: { + if (this.allowPattern) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertPattern(node.expression), + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SpreadElement, + argument: this.convertChild(node.expression), + }); + } + case SyntaxKind.Parameter: { + let parameter; + let result; + if (node.dotDotDotToken) { + parameter = result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.RestElement, + argument: this.convertChild(node.name), + decorators: [], + optional: false, + typeAnnotation: undefined, + value: undefined, + }); + } + else if (node.initializer) { + parameter = this.convertChild(node.name); + result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + range: [node.name.getStart(this.ast), node.initializer.end], + decorators: [], + left: parameter, + optional: false, + right: this.convertChild(node.initializer), + typeAnnotation: undefined, + }); + const modifiers = (0, getModifiers_1.getModifiers)(node); + if (modifiers) { + // AssignmentPattern should not contain modifiers in range + result.range[0] = parameter.range[0]; + result.loc = (0, node_utils_1.getLocFor)(result.range, this.ast); + } + } + else { + parameter = result = this.convertChild(node.name, parent); + } + if (node.type) { + parameter.typeAnnotation = this.convertTypeAnnotation(node.type, node); + this.fixParentLocation(parameter, parameter.typeAnnotation.range); + } + if (node.questionToken) { + if (node.questionToken.end > parameter.range[1]) { + parameter.range[1] = node.questionToken.end; + parameter.loc.end = (0, node_utils_1.getLineAndCharacterFor)(parameter.range[1], this.ast); + } + parameter.optional = true; + } + const modifiers = (0, getModifiers_1.getModifiers)(node); + if (modifiers) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSParameterProperty, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + decorators: [], + override: (0, node_utils_1.hasModifier)(SyntaxKind.OverrideKeyword, node), + parameter: result, + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + }); + } + return result; + } + // Classes + case SyntaxKind.ClassDeclaration: + case SyntaxKind.ClassExpression: { + const classNodeType = node.kind === SyntaxKind.ClassDeclaration + ? ts_estree_1.AST_NODE_TYPES.ClassDeclaration + : ts_estree_1.AST_NODE_TYPES.ClassExpression; + const extendsClause = node.heritageClauses?.find(heritageClause => heritageClause.token === SyntaxKind.ExtendsKeyword); + const implementsClause = node.heritageClauses?.find(heritageClause => heritageClause.token === SyntaxKind.ImplementsKeyword); + const result = this.createNode(node, { + type: classNodeType, + abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node), + body: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ClassBody, + range: [node.members.pos - 1, node.end], + body: this.convertChildren(node.members.filter(node_utils_1.isESTreeClassMember)), + }), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + decorators: this.convertChildren((0, getModifiers_1.getDecorators)(node) ?? []), + id: this.convertChild(node.name), + implements: this.convertChildren(implementsClause?.types ?? []), + superClass: extendsClause?.types[0] + ? this.convertChild(extendsClause.types[0].expression) + : null, + superTypeArguments: undefined, + typeParameters: this.convertTypeParameters(node), + }); + if (extendsClause?.types[0]?.typeArguments) { + result.superTypeArguments = this.convertTypeArguments(extendsClause.types[0]); + } + return this.fixExports(node, result); + } + // Modules + case SyntaxKind.ModuleBlock: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSModuleBlock, + body: this.convertBodyExpressions(node.statements, node), + }); + case SyntaxKind.ImportDeclaration: { + const result = this.createNode(node, this.#withDeprecatedAliasGetter({ + type: ts_estree_1.AST_NODE_TYPES.ImportDeclaration, + attributes: this.convertImportAttributes(node), + importKind: 'value', + source: this.convertChild(node.moduleSpecifier), + specifiers: [], + }, 'assertions', 'attributes', true)); + if (node.importClause) { + // TODO(bradzacher) swap to `phaseModifier` once we add support for `import defer` + // https://github.com/estree/estree/issues/328 + // eslint-disable-next-line @typescript-eslint/no-deprecated + if (node.importClause.isTypeOnly) { + result.importKind = 'type'; + } + if (node.importClause.name) { + result.specifiers.push(this.convertChild(node.importClause)); + } + if (node.importClause.namedBindings) { + switch (node.importClause.namedBindings.kind) { + case SyntaxKind.NamespaceImport: + result.specifiers.push(this.convertChild(node.importClause.namedBindings)); + break; + case SyntaxKind.NamedImports: + result.specifiers.push(...this.convertChildren(node.importClause.namedBindings.elements)); + break; + } + } + } + return result; + } + case SyntaxKind.NamespaceImport: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportNamespaceSpecifier, + local: this.convertChild(node.name), + }); + case SyntaxKind.ImportSpecifier: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportSpecifier, + imported: this.convertChild(node.propertyName ?? node.name), + importKind: node.isTypeOnly ? 'type' : 'value', + local: this.convertChild(node.name), + }); + case SyntaxKind.ImportClause: { + const local = this.convertChild(node.name); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportDefaultSpecifier, + range: local.range, + local, + }); + } + case SyntaxKind.ExportDeclaration: { + if (node.exportClause?.kind === SyntaxKind.NamedExports) { + return this.createNode(node, this.#withDeprecatedAliasGetter({ + type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration, + attributes: this.convertImportAttributes(node), + declaration: null, + exportKind: node.isTypeOnly ? 'type' : 'value', + source: this.convertChild(node.moduleSpecifier), + specifiers: this.convertChildren(node.exportClause.elements, node), + }, 'assertions', 'attributes', true)); + } + return this.createNode(node, this.#withDeprecatedAliasGetter({ + type: ts_estree_1.AST_NODE_TYPES.ExportAllDeclaration, + attributes: this.convertImportAttributes(node), + exported: node.exportClause?.kind === SyntaxKind.NamespaceExport + ? this.convertChild(node.exportClause.name) + : null, + exportKind: node.isTypeOnly ? 'type' : 'value', + source: this.convertChild(node.moduleSpecifier), + }, 'assertions', 'attributes', true)); + } + case SyntaxKind.ExportSpecifier: { + const local = node.propertyName ?? node.name; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportSpecifier, + exported: this.convertChild(node.name), + exportKind: node.isTypeOnly ? 'type' : 'value', + local: this.convertChild(local), + }); + } + case SyntaxKind.ExportAssignment: + if (node.isExportEquals) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSExportAssignment, + expression: this.convertChild(node.expression), + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration, + declaration: this.convertChild(node.expression), + exportKind: 'value', + }); + // Unary Operations + case SyntaxKind.PrefixUnaryExpression: + case SyntaxKind.PostfixUnaryExpression: { + const operator = (0, node_utils_1.getTextForTokenKind)(node.operator); + /** + * ESTree uses UpdateExpression for ++/-- + */ + if (operator === '++' || operator === '--') { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UpdateExpression, + argument: this.convertChild(node.operand), + operator, + prefix: node.kind === SyntaxKind.PrefixUnaryExpression, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + argument: this.convertChild(node.operand), + operator, + prefix: node.kind === SyntaxKind.PrefixUnaryExpression, + }); + } + case SyntaxKind.DeleteExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + argument: this.convertChild(node.expression), + operator: 'delete', + prefix: true, + }); + case SyntaxKind.VoidExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + argument: this.convertChild(node.expression), + operator: 'void', + prefix: true, + }); + case SyntaxKind.TypeOfExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.UnaryExpression, + argument: this.convertChild(node.expression), + operator: 'typeof', + prefix: true, + }); + case SyntaxKind.TypeOperator: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeOperator, + operator: (0, node_utils_1.getTextForTokenKind)(node.operator), + typeAnnotation: this.convertChild(node.type), + }); + // Binary Operations + case SyntaxKind.BinaryExpression: { + // TypeScript uses BinaryExpression for sequences as well + if ((0, node_utils_1.isComma)(node.operatorToken)) { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.SequenceExpression, + expressions: [], + }); + const left = this.convertChild(node.left); + if (left.type === ts_estree_1.AST_NODE_TYPES.SequenceExpression && + node.left.kind !== SyntaxKind.ParenthesizedExpression) { + result.expressions.push(...left.expressions); + } + else { + result.expressions.push(left); + } + result.expressions.push(this.convertChild(node.right)); + return result; + } + const expressionType = (0, node_utils_1.getBinaryExpressionType)(node.operatorToken); + if (this.allowPattern && + expressionType.type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.AssignmentPattern, + decorators: [], + left: this.convertPattern(node.left, node), + optional: false, + right: this.convertChild(node.right), + typeAnnotation: undefined, + }); + } + return this.createNode(node, { + ...expressionType, + left: this.converter(node.left, node, expressionType.type === ts_estree_1.AST_NODE_TYPES.AssignmentExpression), + right: this.convertChild(node.right), + }); + } + case SyntaxKind.PropertyAccessExpression: { + const object = this.convertChild(node.expression); + const property = this.convertChild(node.name); + const computed = false; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MemberExpression, + computed, + object, + optional: node.questionDotToken != null, + property, + }); + return this.convertChainExpression(result, node); + } + case SyntaxKind.ElementAccessExpression: { + const object = this.convertChild(node.expression); + const property = this.convertChild(node.argumentExpression); + const computed = true; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MemberExpression, + computed, + object, + optional: node.questionDotToken != null, + property, + }); + return this.convertChainExpression(result, node); + } + case SyntaxKind.CallExpression: { + if (node.expression.kind === SyntaxKind.ImportKeyword) { + return this.createNode(node, this.#withDeprecatedAliasGetter({ + type: ts_estree_1.AST_NODE_TYPES.ImportExpression, + options: node.arguments[1] + ? this.convertChild(node.arguments[1]) + : null, + source: this.convertChild(node.arguments[0]), + }, 'attributes', 'options', true)); + } + const callee = this.convertChild(node.expression); + const args = this.convertChildren(node.arguments); + const typeArguments = this.convertTypeArguments(node); + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.CallExpression, + arguments: args, + callee, + optional: node.questionDotToken != null, + typeArguments, + }); + return this.convertChainExpression(result, node); + } + case SyntaxKind.NewExpression: { + const typeArguments = this.convertTypeArguments(node); + // NOTE - NewExpression cannot have an optional chain in it + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.NewExpression, + arguments: this.convertChildren(node.arguments ?? []), + callee: this.convertChild(node.expression), + typeArguments, + }); + } + case SyntaxKind.ConditionalExpression: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ConditionalExpression, + alternate: this.convertChild(node.whenFalse), + consequent: this.convertChild(node.whenTrue), + test: this.convertChild(node.condition), + }); + case SyntaxKind.MetaProperty: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.MetaProperty, + meta: this.createNode( + // TODO: do we really want to convert it to Token? + node.getFirstToken(), { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + decorators: [], + name: (0, node_utils_1.getTextForTokenKind)(node.keywordToken), + optional: false, + typeAnnotation: undefined, + }), + property: this.convertChild(node.name), + }); + } + case SyntaxKind.Decorator: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Decorator, + expression: this.convertChild(node.expression), + }); + } + // Literals + case SyntaxKind.StringLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: node.getText(), + value: parent.kind === SyntaxKind.JsxAttribute + ? (0, node_utils_1.unescapeStringLiteralText)(node.text) + : node.text, + }); + } + case SyntaxKind.NumericLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: node.getText(), + value: Number(node.text), + }); + } + case SyntaxKind.BigIntLiteral: { + const range = (0, node_utils_1.getRange)(node, this.ast); + const rawValue = this.ast.text.slice(range[0], range[1]); + const bigint = rawValue + // remove suffix `n` + .slice(0, -1) + // `BigInt` doesn't accept numeric separator + // and `bigint` property should not include numeric separator + .replaceAll('_', ''); + const value = typeof BigInt !== 'undefined' ? BigInt(bigint) : null; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + range, + bigint: value == null ? bigint : String(value), + raw: rawValue, + value, + }); + } + case SyntaxKind.RegularExpressionLiteral: { + const pattern = node.text.slice(1, node.text.lastIndexOf('/')); + const flags = node.text.slice(node.text.lastIndexOf('/') + 1); + let regex = null; + try { + regex = new RegExp(pattern, flags); + } + catch { + // Intentionally blank, so regex stays null + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: node.text, + regex: { + flags, + pattern, + }, + value: regex, + }); + } + case SyntaxKind.TrueKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: 'true', + value: true, + }); + case SyntaxKind.FalseKeyword: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: 'false', + value: false, + }); + case SyntaxKind.NullKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Literal, + raw: 'null', + value: null, + }); + } + case SyntaxKind.EmptyStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.EmptyStatement, + }); + case SyntaxKind.DebuggerStatement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.DebuggerStatement, + }); + // JSX + case SyntaxKind.JsxElement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXElement, + children: this.convertChildren(node.children), + closingElement: this.convertChild(node.closingElement), + openingElement: this.convertChild(node.openingElement), + }); + case SyntaxKind.JsxFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXFragment, + children: this.convertChildren(node.children), + closingFragment: this.convertChild(node.closingFragment), + openingFragment: this.convertChild(node.openingFragment), + }); + case SyntaxKind.JsxSelfClosingElement: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXElement, + /** + * Convert SyntaxKind.JsxSelfClosingElement to SyntaxKind.JsxOpeningElement, + * TypeScript does not seem to have the idea of openingElement when tag is self-closing + */ + children: [], + closingElement: null, + openingElement: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement, + range: (0, node_utils_1.getRange)(node, this.ast), + attributes: this.convertChildren(node.attributes.properties), + name: this.convertJSXTagName(node.tagName, node), + selfClosing: true, + typeArguments: this.convertTypeArguments(node), + }), + }); + } + case SyntaxKind.JsxOpeningElement: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningElement, + attributes: this.convertChildren(node.attributes.properties), + name: this.convertJSXTagName(node.tagName, node), + selfClosing: false, + typeArguments: this.convertTypeArguments(node), + }); + } + case SyntaxKind.JsxClosingElement: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXClosingElement, + name: this.convertJSXTagName(node.tagName, node), + }); + case SyntaxKind.JsxOpeningFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXOpeningFragment, + }); + case SyntaxKind.JsxClosingFragment: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXClosingFragment, + }); + case SyntaxKind.JsxExpression: { + const expression = node.expression + ? this.convertChild(node.expression) + : this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXEmptyExpression, + range: [node.getStart(this.ast) + 1, node.getEnd() - 1], + }); + if (node.dotDotDotToken) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXSpreadChild, + expression, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXExpressionContainer, + expression, + }); + } + case SyntaxKind.JsxAttribute: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXAttribute, + name: this.convertJSXNamespaceOrIdentifier(node.name), + value: this.convertChild(node.initializer), + }); + } + case SyntaxKind.JsxText: { + const start = node.getFullStart(); + const end = node.getEnd(); + const text = this.ast.text.slice(start, end); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXText, + range: [start, end], + raw: text, + value: (0, node_utils_1.unescapeStringLiteralText)(text), + }); + } + case SyntaxKind.JsxSpreadAttribute: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.JSXSpreadAttribute, + argument: this.convertChild(node.expression), + }); + case SyntaxKind.QualifiedName: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSQualifiedName, + left: this.convertChild(node.left), + right: this.convertChild(node.right), + }); + } + // TypeScript specific + case SyntaxKind.TypeReference: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeReference, + typeArguments: this.convertTypeArguments(node), + typeName: this.convertChild(node.typeName), + }); + case SyntaxKind.TypeParameter: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeParameter, + const: (0, node_utils_1.hasModifier)(SyntaxKind.ConstKeyword, node), + constraint: node.constraint && this.convertChild(node.constraint), + default: node.default ? this.convertChild(node.default) : undefined, + in: (0, node_utils_1.hasModifier)(SyntaxKind.InKeyword, node), + name: this.convertChild(node.name), + out: (0, node_utils_1.hasModifier)(SyntaxKind.OutKeyword, node), + }); + } + case SyntaxKind.ThisType: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSThisType, + }); + case SyntaxKind.AnyKeyword: + case SyntaxKind.BigIntKeyword: + case SyntaxKind.BooleanKeyword: + case SyntaxKind.NeverKeyword: + case SyntaxKind.NumberKeyword: + case SyntaxKind.ObjectKeyword: + case SyntaxKind.StringKeyword: + case SyntaxKind.SymbolKeyword: + case SyntaxKind.UnknownKeyword: + case SyntaxKind.VoidKeyword: + case SyntaxKind.UndefinedKeyword: + case SyntaxKind.IntrinsicKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES[`TS${SyntaxKind[node.kind]}`], + }); + } + case SyntaxKind.NonNullExpression: { + const nnExpr = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNonNullExpression, + expression: this.convertChild(node.expression), + }); + return this.convertChainExpression(nnExpr, node); + } + case SyntaxKind.TypeLiteral: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeLiteral, + members: this.convertChildren(node.members), + }); + } + case SyntaxKind.ArrayType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSArrayType, + elementType: this.convertChild(node.elementType), + }); + } + case SyntaxKind.IndexedAccessType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIndexedAccessType, + indexType: this.convertChild(node.indexType), + objectType: this.convertChild(node.objectType), + }); + } + case SyntaxKind.ConditionalType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSConditionalType, + checkType: this.convertChild(node.checkType), + extendsType: this.convertChild(node.extendsType), + falseType: this.convertChild(node.falseType), + trueType: this.convertChild(node.trueType), + }); + } + case SyntaxKind.TypeQuery: + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery, + exprName: this.convertChild(node.exprName), + typeArguments: this.convertTypeArguments(node), + }); + case SyntaxKind.MappedType: { + return this.createNode(node, this.#withDeprecatedGetter({ + type: ts_estree_1.AST_NODE_TYPES.TSMappedType, + constraint: this.convertChild(node.typeParameter.constraint), + key: this.convertChild(node.typeParameter.name), + nameType: this.convertChild(node.nameType) ?? null, + optional: node.questionToken + ? node.questionToken.kind === SyntaxKind.QuestionToken || + (0, node_utils_1.getTextForTokenKind)(node.questionToken.kind) + : false, + readonly: node.readonlyToken + ? node.readonlyToken.kind === SyntaxKind.ReadonlyKeyword || + (0, node_utils_1.getTextForTokenKind)(node.readonlyToken.kind) + : undefined, + typeAnnotation: node.type && this.convertChild(node.type), + }, 'typeParameter', "'constraint' and 'key'", this.convertChild(node.typeParameter))); + } + case SyntaxKind.ParenthesizedExpression: + return this.convertChild(node.expression, parent); + case SyntaxKind.TypeAliasDeclaration: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration, + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + id: this.convertChild(node.name), + typeAnnotation: this.convertChild(node.type), + typeParameters: this.convertTypeParameters(node), + }); + return this.fixExports(node, result); + } + case SyntaxKind.MethodSignature: { + return this.convertMethodSignature(node); + } + case SyntaxKind.PropertySignature: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSPropertySignature, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + computed: (0, node_utils_1.isComputedProperty)(node.name), + key: this.convertChild(node.name), + optional: (0, node_utils_1.isOptional)(node), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node), + }); + } + case SyntaxKind.IndexSignature: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIndexSignature, + accessibility: (0, node_utils_1.getTSNodeAccessibility)(node), + parameters: this.convertChildren(node.parameters), + readonly: (0, node_utils_1.hasModifier)(SyntaxKind.ReadonlyKeyword, node), + static: (0, node_utils_1.hasModifier)(SyntaxKind.StaticKeyword, node), + typeAnnotation: node.type && this.convertTypeAnnotation(node.type, node), + }); + } + case SyntaxKind.ConstructorType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSConstructorType, + abstract: (0, node_utils_1.hasModifier)(SyntaxKind.AbstractKeyword, node), + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: this.convertTypeParameters(node), + }); + } + case SyntaxKind.FunctionType: + case SyntaxKind.ConstructSignature: + case SyntaxKind.CallSignature: { + const type = node.kind === SyntaxKind.ConstructSignature + ? ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration + : node.kind === SyntaxKind.CallSignature + ? ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration + : ts_estree_1.AST_NODE_TYPES.TSFunctionType; + return this.createNode(node, { + type, + params: this.convertParameters(node.parameters), + returnType: node.type && this.convertTypeAnnotation(node.type, node), + typeParameters: this.convertTypeParameters(node), + }); + } + case SyntaxKind.ExpressionWithTypeArguments: { + const parentKind = parent.kind; + const type = parentKind === SyntaxKind.InterfaceDeclaration + ? ts_estree_1.AST_NODE_TYPES.TSInterfaceHeritage + : parentKind === SyntaxKind.HeritageClause + ? ts_estree_1.AST_NODE_TYPES.TSClassImplements + : ts_estree_1.AST_NODE_TYPES.TSInstantiationExpression; + return this.createNode(node, { + type, + expression: this.convertChild(node.expression), + typeArguments: this.convertTypeArguments(node), + }); + } + case SyntaxKind.InterfaceDeclaration: { + const interfaceExtends = node.heritageClauses?.flatMap(heritageClause => + // `InterfaceDeclaration` can only have `extends`, + // already checked in `check-syntax-errors.ts`, + // However, `allowInvalidAST` allow to bypass the syntax check, + // We'll just ignore clauses after other keywords + heritageClause.token === SyntaxKind.ExtendsKeyword + ? heritageClause.types.map(heritageType => this.convertChild(heritageType, node)) + : []) ?? []; + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration, + body: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInterfaceBody, + range: [node.members.pos - 1, node.end], + body: this.convertChildren(node.members), + }), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + extends: interfaceExtends, + id: this.convertChild(node.name), + typeParameters: this.convertTypeParameters(node), + }); + return this.fixExports(node, result); + } + case SyntaxKind.TypePredicate: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypePredicate, + asserts: node.assertsModifier != null, + parameterName: this.convertChild(node.parameterName), + typeAnnotation: null, + }); + /** + * Specific fix for type-guard location data + */ + if (node.type) { + result.typeAnnotation = this.convertTypeAnnotation(node.type, node); + result.typeAnnotation.loc = result.typeAnnotation.typeAnnotation.loc; + result.typeAnnotation.range = + result.typeAnnotation.typeAnnotation.range; + } + return result; + } + case SyntaxKind.ImportType: { + const range = (0, node_utils_1.getRange)(node, this.ast); + if (node.isTypeOf) { + const token = (0, node_utils_1.findNextToken)(node.getFirstToken(), node, this.ast); + range[0] = token.getStart(this.ast); + } + let options = null; + if (node.attributes) { + const value = this.createNode(node.attributes, { + type: ts_estree_1.AST_NODE_TYPES.ObjectExpression, + properties: node.attributes.elements.map(importAttribute => this.createNode(importAttribute, { + type: ts_estree_1.AST_NODE_TYPES.Property, + computed: false, + key: this.convertChild(importAttribute.name), + kind: 'init', + method: false, + optional: false, + shorthand: false, + value: this.convertChild(importAttribute.value), + })), + }); + const commaToken = (0, node_utils_1.findNextToken)(node.argument, node, this.ast); + const openBraceToken = (0, node_utils_1.findNextToken)(commaToken, node, this.ast); + const tokenAfterAttributes = (0, node_utils_1.findNextToken)(node.attributes, node, this.ast); + // Since TS 5.9, there could be a trailing comma, i.e. `{ with: { ... }, }` + const closeBraceToken = tokenAfterAttributes.kind === ts.SyntaxKind.CommaToken + ? (0, node_utils_1.findNextToken)(tokenAfterAttributes, node, this.ast) + : tokenAfterAttributes; + const withOrAssertToken = (0, node_utils_1.findNextToken)(openBraceToken, node, this.ast); + const withOrAssertTokenRange = (0, node_utils_1.getRange)(withOrAssertToken, this.ast); + const withOrAssertName = withOrAssertToken.kind === ts.SyntaxKind.AssertKeyword + ? 'assert' + : 'with'; + options = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ObjectExpression, + range: [openBraceToken.getStart(this.ast), closeBraceToken.end], + properties: [ + this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Property, + range: [withOrAssertTokenRange[0], node.attributes.end], + computed: false, + key: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + range: withOrAssertTokenRange, + decorators: [], + name: withOrAssertName, + optional: false, + typeAnnotation: undefined, + }), + kind: 'init', + method: false, + optional: false, + shorthand: false, + value, + }), + ], + }); + } + const argument = this.convertChild(node.argument); + const source = argument.literal; + const result = this.createNode(node, this.#withDeprecatedGetter({ + type: ts_estree_1.AST_NODE_TYPES.TSImportType, + range, + options, + qualifier: this.convertChild(node.qualifier), + source, + typeArguments: this.convertTypeArguments(node) ?? null, + }, 'argument', 'source', argument)); + if (node.isTypeOf) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeQuery, + exprName: result, + typeArguments: undefined, + }); + } + return result; + } + case SyntaxKind.EnumDeclaration: { + const members = this.convertChildren(node.members); + const result = this.createNode(node, this.#withDeprecatedGetter({ + type: ts_estree_1.AST_NODE_TYPES.TSEnumDeclaration, + body: this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSEnumBody, + range: [node.members.pos - 1, node.end], + members, + }), + const: (0, node_utils_1.hasModifier)(SyntaxKind.ConstKeyword, node), + declare: (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node), + id: this.convertChild(node.name), + }, 'members', `'body.members'`, this.convertChildren(node.members))); + return this.fixExports(node, result); + } + case SyntaxKind.EnumMember: { + const computed = node.name.kind === ts.SyntaxKind.ComputedPropertyName; + return this.createNode(node, this.#withDeprecatedGetter({ + type: ts_estree_1.AST_NODE_TYPES.TSEnumMember, + id: this.convertChild(node.name), + initializer: node.initializer && this.convertChild(node.initializer), + }, 'computed', undefined, computed)); + } + case SyntaxKind.ModuleDeclaration: { + let isDeclare = (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node); + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSModuleDeclaration, + ...(() => { + if (node.flags & ts.NodeFlags.GlobalAugmentation) { + return { + body: this.convertChild(node.body), + declare: false, + global: false, + id: this.convertChild(node.name), + kind: 'global', + }; + } + if (ts.isStringLiteral(node.name)) { + const body = this.convertChild(node.body); + return { + kind: 'module', + ...(body != null ? { body } : {}), + declare: false, + global: false, + id: this.convertChild(node.name), + }; + } + // Nested module declarations are stored in TypeScript as nested tree nodes. + // We "unravel" them here by making our own nested TSQualifiedName, + // with the innermost node's body as the actual node body. + let name = this.createNode(node.name, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + range: [node.name.getStart(this.ast), node.name.getEnd()], + decorators: [], + name: node.name.text, + optional: false, + typeAnnotation: undefined, + }); + while (node.body && + ts.isModuleDeclaration(node.body) && + node.body.name) { + node = node.body; + isDeclare ||= (0, node_utils_1.hasModifier)(SyntaxKind.DeclareKeyword, node); + const nextName = node.name; + const right = this.createNode(nextName, { + type: ts_estree_1.AST_NODE_TYPES.Identifier, + range: [nextName.getStart(this.ast), nextName.getEnd()], + decorators: [], + name: nextName.text, + optional: false, + typeAnnotation: undefined, + }); + name = this.createNode(nextName, { + type: ts_estree_1.AST_NODE_TYPES.TSQualifiedName, + range: [name.range[0], right.range[1]], + left: name, + right, + }); + } + return { + body: this.convertChild(node.body), + declare: false, + global: false, + id: name, + kind: node.flags & ts.NodeFlags.Namespace ? 'namespace' : 'module', + }; + })(), + }); + result.declare = isDeclare; + if (node.flags & ts.NodeFlags.GlobalAugmentation) { + // eslint-disable-next-line @typescript-eslint/no-deprecated + result.global = true; + } + return this.fixExports(node, result); + } + // TypeScript specific types + case SyntaxKind.ParenthesizedType: { + return this.convertChild(node.type); + } + case SyntaxKind.UnionType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSUnionType, + types: this.convertChildren(node.types), + }); + } + case SyntaxKind.IntersectionType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSIntersectionType, + types: this.convertChildren(node.types), + }); + } + case SyntaxKind.AsExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSAsExpression, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertChild(node.type), + }); + } + case SyntaxKind.InferType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSInferType, + typeParameter: this.convertChild(node.typeParameter), + }); + } + case SyntaxKind.LiteralType: { + if (node.literal.kind === SyntaxKind.NullKeyword) { + // 4.0 started nesting null types inside a LiteralType node + // but our AST is designed around the old way of null being a keyword + return this.createNode(node.literal, { + type: ts_estree_1.AST_NODE_TYPES.TSNullKeyword, + }); + } + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSLiteralType, + literal: this.convertChild(node.literal), + }); + } + case SyntaxKind.TypeAssertionExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTypeAssertion, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertChild(node.type), + }); + } + case SyntaxKind.ImportEqualsDeclaration: { + return this.fixExports(node, this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSImportEqualsDeclaration, + id: this.convertChild(node.name), + importKind: node.isTypeOnly ? 'type' : 'value', + moduleReference: this.convertChild(node.moduleReference), + })); + } + case SyntaxKind.ExternalModuleReference: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSExternalModuleReference, + expression: this.convertChild(node.expression), + }); + } + case SyntaxKind.NamespaceExportDeclaration: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNamespaceExportDeclaration, + id: this.convertChild(node.name), + }); + } + case SyntaxKind.AbstractKeyword: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSAbstractKeyword, + }); + } + // Tuple + case SyntaxKind.TupleType: { + const elementTypes = this.convertChildren(node.elements); + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTupleType, + elementTypes, + }); + } + case SyntaxKind.NamedTupleMember: { + const member = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSNamedTupleMember, + elementType: this.convertChild(node.type, node), + label: this.convertChild(node.name, node), + optional: node.questionToken != null, + }); + if (node.dotDotDotToken) { + // adjust the start to account for the "..." + member.range[0] = member.label.range[0]; + member.loc.start = member.label.loc.start; + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSRestType, + typeAnnotation: member, + }); + } + return member; + } + case SyntaxKind.OptionalType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSOptionalType, + typeAnnotation: this.convertChild(node.type), + }); + } + case SyntaxKind.RestType: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSRestType, + typeAnnotation: this.convertChild(node.type), + }); + } + // Template Literal Types + case SyntaxKind.TemplateLiteralType: { + const result = this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSTemplateLiteralType, + quasis: [this.convertChild(node.head)], + types: [], + }); + node.templateSpans.forEach(templateSpan => { + result.types.push(this.convertChild(templateSpan.type)); + result.quasis.push(this.convertChild(templateSpan.literal)); + }); + return result; + } + case SyntaxKind.ClassStaticBlockDeclaration: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.StaticBlock, + body: this.convertBodyExpressions(node.body.statements, node), + }); + } + // eslint-disable-next-line @typescript-eslint/no-deprecated + case SyntaxKind.AssertEntry: + case SyntaxKind.ImportAttribute: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ImportAttribute, + key: this.convertChild(node.name), + value: this.convertChild(node.value), + }); + } + case SyntaxKind.SatisfiesExpression: { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.TSSatisfiesExpression, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertChild(node.type), + }); + } + default: + return this.deeplyCopy(node); + } + } + createNode(node, data) { + const result = data; + result.range ??= (0, node_utils_1.getRange)(node, this.ast); + result.loc ??= (0, node_utils_1.getLocFor)(result.range, this.ast); + if (result && this.options.shouldPreserveNodeMaps) { + this.esTreeNodeToTSNodeMap.set(result, node); + } + return result; + } + convertProgram() { + return this.converter(this.ast); + } + /** + * For nodes that are copied directly from the TypeScript AST into + * ESTree mostly as-is. The only difference is the addition of a type + * property instead of a kind property. Recursively copies all children. + */ + deeplyCopy(node) { + if (node.kind === ts.SyntaxKind.JSDocFunctionType) { + this.#throwError(node, 'JSDoc types can only be used inside documentation comments.'); + } + const customType = `TS${SyntaxKind[node.kind]}`; + /** + * If the "errorOnUnknownASTType" option is set to true, throw an error, + * otherwise fallback to just including the unknown type as-is. + */ + if (this.options.errorOnUnknownASTType && !ts_estree_1.AST_NODE_TYPES[customType]) { + throw new Error(`Unknown AST_NODE_TYPE: "${customType}"`); + } + const result = this.createNode(node, { + type: customType, + }); + if ('type' in node) { + result.typeAnnotation = + node.type && 'kind' in node.type && ts.isTypeNode(node.type) + ? this.convertTypeAnnotation(node.type, node) + : null; + } + if ('typeArguments' in node) { + result.typeArguments = + node.typeArguments && 'pos' in node.typeArguments + ? this.convertTypeArguments(node) + : null; + } + if ('typeParameters' in node) { + result.typeParameters = + node.typeParameters && 'pos' in node.typeParameters + ? // @ts-expect-error -- Fix me + this.convertTypeParameters(node) + : null; + } + const decorators = (0, getModifiers_1.getDecorators)(node); + if (decorators?.length) { + result.decorators = this.convertChildren(decorators); + } + // keys we never want to clone from the base typescript node as they + // introduce garbage into our AST + const KEYS_TO_NOT_COPY = new Set([ + '_children', + 'decorators', + 'end', + 'flags', + 'heritageClauses', + 'illegalDecorators', + 'jsDoc', + 'kind', + 'locals', + 'localSymbol', + 'modifierFlagsCache', + 'modifiers', + 'nextContainer', + 'parent', + 'pos', + 'symbol', + 'transformFlags', + 'type', + 'typeArguments', + 'typeParameters', + ]); + Object.entries(node) + .filter(([key]) => !KEYS_TO_NOT_COPY.has(key)) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + result[key] = this.convertChildren(value); + } + else if (value && typeof value === 'object' && value.kind) { + // need to check node[key].kind to ensure we don't try to convert a symbol + result[key] = this.convertChild(value); + } + else { + result[key] = value; + } + }); + return result; + } + /** + * Fixes the exports of the given ts.Node + * @returns the ESTreeNode with fixed exports + */ + fixExports(node, result) { + const isNamespaceNode = ts.isModuleDeclaration(node) && !ts.isStringLiteral(node.name); + const modifiers = isNamespaceNode + ? (0, node_utils_1.getNamespaceModifiers)(node) + : (0, getModifiers_1.getModifiers)(node); + if (modifiers?.[0].kind === SyntaxKind.ExportKeyword) { + /** + * Make sure that original node is registered instead of export + */ + this.registerTSNodeInNodeMap(node, result); + const exportKeyword = modifiers[0]; + const nextModifier = modifiers[1]; + const declarationIsDefault = nextModifier?.kind === SyntaxKind.DefaultKeyword; + const varToken = declarationIsDefault + ? (0, node_utils_1.findNextToken)(nextModifier, this.ast, this.ast) + : (0, node_utils_1.findNextToken)(exportKeyword, this.ast, this.ast); + result.range[0] = varToken.getStart(this.ast); + result.loc = (0, node_utils_1.getLocFor)(result.range, this.ast); + if (declarationIsDefault) { + return this.createNode(node, { + type: ts_estree_1.AST_NODE_TYPES.ExportDefaultDeclaration, + range: [exportKeyword.getStart(this.ast), result.range[1]], + declaration: result, + exportKind: 'value', + }); + } + const isType = result.type === ts_estree_1.AST_NODE_TYPES.TSInterfaceDeclaration || + result.type === ts_estree_1.AST_NODE_TYPES.TSTypeAliasDeclaration; + const isDeclare = 'declare' in result && result.declare; + return this.createNode(node, + // @ts-expect-error - TODO, narrow the types here + this.#withDeprecatedAliasGetter({ + type: ts_estree_1.AST_NODE_TYPES.ExportNamedDeclaration, + range: [exportKeyword.getStart(this.ast), result.range[1]], + attributes: [], + declaration: result, + exportKind: isType || isDeclare ? 'type' : 'value', + source: null, + specifiers: [], + }, 'assertions', 'attributes', true)); + } + return result; + } + getASTMaps() { + return { + esTreeNodeToTSNodeMap: this.esTreeNodeToTSNodeMap, + tsNodeToESTreeNodeMap: this.tsNodeToESTreeNodeMap, + }; + } + /** + * Register specific TypeScript node into map with first ESTree node provided + */ + registerTSNodeInNodeMap(node, result) { + if (result && + this.options.shouldPreserveNodeMaps && + !this.tsNodeToESTreeNodeMap.has(node)) { + this.tsNodeToESTreeNodeMap.set(node, result); + } + } +} +exports.Converter = Converter; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..84a724980626b5264f73e3e0c547e9497f475928 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.d.ts @@ -0,0 +1,12 @@ +import type * as ts from 'typescript'; +interface DirectoryStructureHost { + readDirectory?(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; +} +interface CachedDirectoryStructureHost extends DirectoryStructureHost { + readDirectory(path: string, extensions?: readonly string[], exclude?: readonly string[], include?: readonly string[], depth?: number): string[]; +} +export interface WatchCompilerHostOfConfigFile extends ts.WatchCompilerHostOfConfigFile { + extraFileExtensions?: readonly ts.FileExtensionInfo[]; + onCachedDirectoryStructureHostCreate(host: CachedDirectoryStructureHost): void; +} +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js new file mode 100644 index 0000000000000000000000000000000000000000..3cbc8982d884b1e6cd0297b8d4f834f9264ae9d4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/WatchCompilerHostOfConfigFile.js @@ -0,0 +1,5 @@ +"use strict"; +// These types are internal to TS. +// They have been trimmed down to only include the relevant bits +// We use some special internal TS apis to help us do our parsing flexibly +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c35be835a20c983ace195e12fafaf88806877996 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.d.ts @@ -0,0 +1,6 @@ +import type { ParseSettings } from '../parseSettings'; +import type { ASTAndDefiniteProgram } from './shared'; +/** + * @returns Returns a new source file and program corresponding to the linted code + */ +export declare function createIsolatedProgram(parseSettings: ParseSettings): ASTAndDefiniteProgram; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js new file mode 100644 index 0000000000000000000000000000000000000000..85fb0b02880b715bee493180d1705324faa9ec1b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createIsolatedProgram.js @@ -0,0 +1,96 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createIsolatedProgram = createIsolatedProgram; +const debug_1 = __importDefault(require("debug")); +const ts = __importStar(require("typescript")); +const getScriptKind_1 = require("./getScriptKind"); +const shared_1 = require("./shared"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:createIsolatedProgram'); +/** + * @returns Returns a new source file and program corresponding to the linted code + */ +function createIsolatedProgram(parseSettings) { + log('Getting isolated program in %s mode for: %s', parseSettings.jsx ? 'TSX' : 'TS', parseSettings.filePath); + const compilerHost = { + fileExists() { + return true; + }, + getCanonicalFileName() { + return parseSettings.filePath; + }, + getCurrentDirectory() { + return ''; + }, + getDefaultLibFileName() { + return 'lib.d.ts'; + }, + getDirectories() { + return []; + }, + // TODO: Support Windows CRLF + getNewLine() { + return '\n'; + }, + getSourceFile(filename) { + return ts.createSourceFile(filename, parseSettings.codeFullText, ts.ScriptTarget.Latest, + /* setParentNodes */ true, (0, getScriptKind_1.getScriptKind)(parseSettings.filePath, parseSettings.jsx)); + }, + readFile() { + return undefined; + }, + useCaseSensitiveFileNames() { + return true; + }, + writeFile() { + return null; + }, + }; + const program = ts.createProgram([parseSettings.filePath], { + jsDocParsingMode: parseSettings.jsDocParsingMode, + jsx: parseSettings.jsx ? ts.JsxEmit.Preserve : undefined, + noResolve: true, + target: ts.ScriptTarget.Latest, + ...(0, shared_1.createDefaultCompilerOptionsFromExtra)(parseSettings), + }, compilerHost); + const ast = program.getSourceFile(parseSettings.filePath); + if (!ast) { + throw new Error('Expected an ast to be returned for the single-file isolated program.'); + } + return { ast, program }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a43aef11158b1fe791639e83cdebfde040588e39 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.d.ts @@ -0,0 +1,8 @@ +import type * as ts from 'typescript'; +import type { ParseSettings } from '../parseSettings'; +import type { ASTAndDefiniteProgram } from './shared'; +/** + * @param parseSettings Internal settings for parsing the file + * @returns If found, the source file corresponding to the code and the containing program + */ +export declare function createProjectProgram(parseSettings: ParseSettings, programsForProjects: readonly ts.Program[]): ASTAndDefiniteProgram; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js new file mode 100644 index 0000000000000000000000000000000000000000..584e98b48554ed4ffba963040997cf675eaa0e4d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgram.js @@ -0,0 +1,23 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createProjectProgram = createProjectProgram; +const debug_1 = __importDefault(require("debug")); +const node_utils_1 = require("../node-utils"); +const createProjectProgramError_1 = require("./createProjectProgramError"); +const shared_1 = require("./shared"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:createProjectProgram'); +/** + * @param parseSettings Internal settings for parsing the file + * @returns If found, the source file corresponding to the code and the containing program + */ +function createProjectProgram(parseSettings, programsForProjects) { + log('Creating project program for: %s', parseSettings.filePath); + const astAndProgram = (0, node_utils_1.firstDefined)(programsForProjects, currentProgram => (0, shared_1.getAstFromProgram)(currentProgram, parseSettings.filePath)); + if (!astAndProgram) { + throw new Error((0, createProjectProgramError_1.createProjectProgramError)(parseSettings, programsForProjects).join('\n')); + } + return astAndProgram; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4f201765652649880a1d7ab651ab916e8f68619 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.d.ts @@ -0,0 +1,3 @@ +import type * as ts from 'typescript'; +import type { ParseSettings } from '../parseSettings'; +export declare function createProjectProgramError(parseSettings: ParseSettings, programsForProjects: readonly ts.Program[]): string[]; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.js new file mode 100644 index 0000000000000000000000000000000000000000..37b590934847d24175e06ca645d77afba65e4167 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createProjectProgramError.js @@ -0,0 +1,74 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createProjectProgramError = createProjectProgramError; +const node_path_1 = __importDefault(require("node:path")); +const describeFilePath_1 = require("./describeFilePath"); +const shared_1 = require("./shared"); +function createProjectProgramError(parseSettings, programsForProjects) { + const describedFilePath = (0, describeFilePath_1.describeFilePath)(parseSettings.filePath, parseSettings.tsconfigRootDir); + return [ + getErrorStart(describedFilePath, parseSettings), + ...getErrorDetails(describedFilePath, parseSettings, programsForProjects), + ]; +} +function getErrorStart(describedFilePath, parseSettings) { + const relativeProjects = [...parseSettings.projects.values()].map(projectFile => (0, describeFilePath_1.describeFilePath)(projectFile, parseSettings.tsconfigRootDir)); + const describedPrograms = relativeProjects.length === 1 + ? ` ${relativeProjects[0]}` + : `\n${relativeProjects.map(project => `- ${project}`).join('\n')}`; + return `ESLint was configured to run on \`${describedFilePath}\` using \`parserOptions.project\`:${describedPrograms}`; +} +function getErrorDetails(describedFilePath, parseSettings, programsForProjects) { + if (programsForProjects.length === 1 && + programsForProjects[0].getProjectReferences()?.length) { + return [ + `That TSConfig uses project "references" and doesn't include \`${describedFilePath}\` directly, which is not supported by \`parserOptions.project\`.`, + `Either:`, + `- Switch to \`parserOptions.projectService\``, + `- Use an ESLint-specific TSConfig`, + `See the typescript-eslint docs for more info: https://tseslint.com/are-project-references-supported`, + ]; + } + const { extraFileExtensions } = parseSettings; + const details = []; + for (const extraExtension of extraFileExtensions) { + if (!extraExtension.startsWith('.')) { + details.push(`Found unexpected extension \`${extraExtension}\` specified with the \`parserOptions.extraFileExtensions\` option. Did you mean \`.${extraExtension}\`?`); + } + if (shared_1.DEFAULT_EXTRA_FILE_EXTENSIONS.has(extraExtension)) { + details.push(`You unnecessarily included the extension \`${extraExtension}\` with the \`parserOptions.extraFileExtensions\` option. This extension is already handled by the parser by default.`); + } + } + const fileExtension = node_path_1.default.extname(parseSettings.filePath); + if (!shared_1.DEFAULT_EXTRA_FILE_EXTENSIONS.has(fileExtension)) { + const nonStandardExt = `The extension for the file (\`${fileExtension}\`) is non-standard`; + if (extraFileExtensions.length > 0) { + if (!extraFileExtensions.includes(fileExtension)) { + return [ + ...details, + `${nonStandardExt}. It should be added to your existing \`parserOptions.extraFileExtensions\`.`, + ]; + } + } + else { + return [ + ...details, + `${nonStandardExt}. You should add \`parserOptions.extraFileExtensions\` to your config.`, + ]; + } + } + const [describedInclusions, describedSpecifiers] = parseSettings.projects.size === 1 + ? ['that TSConfig does not', 'that TSConfig'] + : ['none of those TSConfigs', 'one of those TSConfigs']; + return [ + ...details, + `However, ${describedInclusions} include this file. Either:`, + `- Change ESLint's list of included files to not include this file`, + `- Change ${describedSpecifiers} to include this file`, + `- Create a new TSConfig that includes this file and include it in your parserOptions.project`, + `See the typescript-eslint docs for more info: https://tseslint.com/none-of-those-tsconfigs-include-this-file`, + ]; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..90e9dbb5b029a66ae6dea17714e9f3fffc25a4af --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.d.ts @@ -0,0 +1,5 @@ +import * as ts from 'typescript'; +import type { ParseSettings } from '../parseSettings'; +import type { ASTAndNoProgram } from './shared'; +export declare function createSourceFile(parseSettings: ParseSettings): ts.SourceFile; +export declare function createNoProgram(parseSettings: ParseSettings): ASTAndNoProgram; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js new file mode 100644 index 0000000000000000000000000000000000000000..2ec864697d868c61b45176f2855cae3ff62ad0e1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/createSourceFile.js @@ -0,0 +1,62 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createSourceFile = createSourceFile; +exports.createNoProgram = createNoProgram; +const debug_1 = __importDefault(require("debug")); +const ts = __importStar(require("typescript")); +const source_files_1 = require("../source-files"); +const getScriptKind_1 = require("./getScriptKind"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:createSourceFile'); +function createSourceFile(parseSettings) { + log('Getting AST without type information in %s mode for: %s', parseSettings.jsx ? 'TSX' : 'TS', parseSettings.filePath); + return (0, source_files_1.isSourceFile)(parseSettings.code) + ? parseSettings.code + : ts.createSourceFile(parseSettings.filePath, parseSettings.codeFullText, { + jsDocParsingMode: parseSettings.jsDocParsingMode, + languageVersion: ts.ScriptTarget.Latest, + setExternalModuleIndicator: parseSettings.setExternalModuleIndicator, + }, + /* setParentNodes */ true, (0, getScriptKind_1.getScriptKind)(parseSettings.filePath, parseSettings.jsx)); +} +function createNoProgram(parseSettings) { + return { + ast: createSourceFile(parseSettings), + program: null, + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4146cd3bb617016b59716f2d75409ef448511dce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.d.ts @@ -0,0 +1 @@ +export declare function describeFilePath(filePath: string, tsconfigRootDir: string): string; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js new file mode 100644 index 0000000000000000000000000000000000000000..f84ab502b783185432cb8234bc134c7a64384c0f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/describeFilePath.js @@ -0,0 +1,30 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.describeFilePath = describeFilePath; +const node_path_1 = __importDefault(require("node:path")); +function describeFilePath(filePath, tsconfigRootDir) { + // If the TSConfig root dir is a parent of the filePath, use + // `` as a prefix for the path. + const relative = node_path_1.default.relative(tsconfigRootDir, filePath); + if (relative && !relative.startsWith('..') && !node_path_1.default.isAbsolute(relative)) { + return `/${relative}`; + } + // Root-like Mac/Linux (~/*, ~*) or Windows (C:/*, /) paths that aren't + // relative to the TSConfig root dir should be fully described. + // This avoids strings like /../../../../repo/file.ts. + // https://github.com/typescript-eslint/typescript-eslint/issues/6289 + if (/^[(\w+:)\\/~]/.test(filePath)) { + return filePath; + } + // Similarly, if the relative path would contain a lot of ../.., then + // ignore it and print the file path directly. + if (/\.\.[/\\]\.\./.test(relative)) { + return filePath; + } + // Lastly, since we've eliminated all special cases, we know the cleanest + // path to print is probably the prefixed relative one. + return `/${relative}`; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..331cee7700ecdb29905b5c6570e38d101619d161 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.d.ts @@ -0,0 +1,3 @@ +import * as ts from 'typescript'; +export declare function getScriptKind(filePath: string, jsx: boolean): ts.ScriptKind; +export declare function getLanguageVariant(scriptKind: ts.ScriptKind): ts.LanguageVariant; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js new file mode 100644 index 0000000000000000000000000000000000000000..6c948b5b42b0d37fd642c705138d5385d59d7fca --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getScriptKind.js @@ -0,0 +1,80 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getScriptKind = getScriptKind; +exports.getLanguageVariant = getLanguageVariant; +const node_path_1 = __importDefault(require("node:path")); +const ts = __importStar(require("typescript")); +function getScriptKind(filePath, jsx) { + const extension = node_path_1.default.extname(filePath).toLowerCase(); + // note - we only respect the user's jsx setting for unknown extensions + // this is so that we always match TS's internal script kind logic, preventing + // weird errors due to a mismatch. + // https://github.com/microsoft/TypeScript/blob/da00ba67ed1182ad334f7c713b8254fba174aeba/src/compiler/utilities.ts#L6948-L6968 + switch (extension) { + case ts.Extension.Cjs: + case ts.Extension.Js: + case ts.Extension.Mjs: + return ts.ScriptKind.JS; + case ts.Extension.Cts: + case ts.Extension.Mts: + case ts.Extension.Ts: + return ts.ScriptKind.TS; + case ts.Extension.Json: + return ts.ScriptKind.JSON; + case ts.Extension.Jsx: + return ts.ScriptKind.JSX; + case ts.Extension.Tsx: + return ts.ScriptKind.TSX; + default: + // unknown extension, force typescript to ignore the file extension, and respect the user's setting + return jsx ? ts.ScriptKind.TSX : ts.ScriptKind.TS; + } +} +function getLanguageVariant(scriptKind) { + // https://github.com/microsoft/TypeScript/blob/d6e483b8dabd8fd37c00954c3f2184bb7f1eb90c/src/compiler/utilities.ts#L6281-L6285 + switch (scriptKind) { + case ts.ScriptKind.JS: + case ts.ScriptKind.JSON: + case ts.ScriptKind.JSX: + case ts.ScriptKind.TSX: + return ts.LanguageVariant.JSX; + default: + return ts.LanguageVariant.Standard; + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ed7c16f12c6e281bd6bac71c2c6b4ac026f1e320 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.d.ts @@ -0,0 +1,13 @@ +import * as ts from 'typescript'; +import type { ParseSettings } from '../parseSettings'; +/** + * Clear all of the parser caches. + * This should only be used in testing to ensure the parser is clean between tests. + */ +export declare function clearWatchCaches(): void; +/** + * Calculate project environments using options provided by consumer and paths from config + * @param parseSettings Internal settings for parsing the file + * @returns The programs corresponding to the supplied tsconfig paths + */ +export declare function getWatchProgramsForProjects(parseSettings: ParseSettings): ts.Program[]; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js new file mode 100644 index 0000000000000000000000000000000000000000..1979990e0ff5d53ea9263675d0538c4fbb9e9f6c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/getWatchProgramsForProjects.js @@ -0,0 +1,380 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clearWatchCaches = clearWatchCaches; +exports.getWatchProgramsForProjects = getWatchProgramsForProjects; +const debug_1 = __importDefault(require("debug")); +const node_fs_1 = __importDefault(require("node:fs")); +const ts = __importStar(require("typescript")); +const source_files_1 = require("../source-files"); +const shared_1 = require("./shared"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:getWatchProgramsForProjects'); +/** + * Maps tsconfig paths to their corresponding file contents and resulting watches + */ +const knownWatchProgramMap = new Map(); +/** + * Maps file/folder paths to their set of corresponding watch callbacks + * There may be more than one per file/folder if a file/folder is shared between projects + */ +const fileWatchCallbackTrackingMap = new Map(); +const folderWatchCallbackTrackingMap = new Map(); +/** + * Stores the list of known files for each program + */ +const programFileListCache = new Map(); +/** + * Caches the last modified time of the tsconfig files + */ +const tsconfigLastModifiedTimestampCache = new Map(); +const parsedFilesSeenHash = new Map(); +/** + * Clear all of the parser caches. + * This should only be used in testing to ensure the parser is clean between tests. + */ +function clearWatchCaches() { + knownWatchProgramMap.clear(); + fileWatchCallbackTrackingMap.clear(); + folderWatchCallbackTrackingMap.clear(); + parsedFilesSeenHash.clear(); + programFileListCache.clear(); + tsconfigLastModifiedTimestampCache.clear(); +} +function saveWatchCallback(trackingMap) { + return (fileName, callback) => { + const normalizedFileName = (0, shared_1.getCanonicalFileName)(fileName); + const watchers = (() => { + let watchers = trackingMap.get(normalizedFileName); + if (!watchers) { + watchers = new Set(); + trackingMap.set(normalizedFileName, watchers); + } + return watchers; + })(); + watchers.add(callback); + return { + close: () => { + watchers.delete(callback); + }, + }; + }; +} +/** + * Holds information about the file currently being linted + */ +const currentLintOperationState = { + code: '', + filePath: '', +}; +/** + * Appropriately report issues found when reading a config file + * @param diagnostic The diagnostic raised when creating a program + */ +function diagnosticReporter(diagnostic) { + throw new Error(ts.flattenDiagnosticMessageText(diagnostic.messageText, ts.sys.newLine)); +} +function updateCachedFileList(tsconfigPath, program) { + const fileList = new Set(program.getRootFileNames().map(f => (0, shared_1.getCanonicalFileName)(f))); + programFileListCache.set(tsconfigPath, fileList); + return fileList; +} +/** + * Calculate project environments using options provided by consumer and paths from config + * @param parseSettings Internal settings for parsing the file + * @returns The programs corresponding to the supplied tsconfig paths + */ +function getWatchProgramsForProjects(parseSettings) { + const filePath = (0, shared_1.getCanonicalFileName)(parseSettings.filePath); + const results = []; + // preserve reference to code and file being linted + currentLintOperationState.code = parseSettings.code; + currentLintOperationState.filePath = filePath; + // Update file version if necessary + const fileWatchCallbacks = fileWatchCallbackTrackingMap.get(filePath); + const codeHash = (0, shared_1.createHash)((0, source_files_1.getCodeText)(parseSettings.code)); + if (parsedFilesSeenHash.get(filePath) !== codeHash && + fileWatchCallbacks && + fileWatchCallbacks.size > 0) { + fileWatchCallbacks.forEach(cb => cb(filePath, ts.FileWatcherEventKind.Changed)); + } + const currentProjectsFromSettings = new Map(parseSettings.projects); + /* + * before we go into the process of attempting to find and update every program + * see if we know of a program that contains this file + */ + for (const [tsconfigPath, existingWatch] of knownWatchProgramMap.entries()) { + if (!currentProjectsFromSettings.has(tsconfigPath)) { + // the current parser run doesn't specify this tsconfig in parserOptions.project + // so we don't want to consider it for caching purposes. + // + // if we did consider it we might return a program for a project + // that wasn't specified in the current parser run (which is obv bad!). + continue; + } + let fileList = programFileListCache.get(tsconfigPath); + let updatedProgram = null; + if (!fileList) { + updatedProgram = existingWatch.getProgram().getProgram(); + fileList = updateCachedFileList(tsconfigPath, updatedProgram); + } + if (fileList.has(filePath)) { + log('Found existing program for file. %s', filePath); + updatedProgram ??= existingWatch.getProgram().getProgram(); + // sets parent pointers in source files + updatedProgram.getTypeChecker(); + return [updatedProgram]; + } + } + log('File did not belong to any existing programs, moving to create/update. %s', filePath); + /* + * We don't know of a program that contains the file, this means that either: + * - the required program hasn't been created yet, or + * - the file is new/renamed, and the program hasn't been updated. + */ + for (const tsconfigPath of parseSettings.projects) { + const existingWatch = knownWatchProgramMap.get(tsconfigPath[0]); + if (existingWatch) { + const updatedProgram = maybeInvalidateProgram(existingWatch, filePath, tsconfigPath[0]); + if (!updatedProgram) { + continue; + } + // sets parent pointers in source files + updatedProgram.getTypeChecker(); + // cache and check the file list + const fileList = updateCachedFileList(tsconfigPath[0], updatedProgram); + if (fileList.has(filePath)) { + log('Found updated program for file. %s', filePath); + // we can return early because we know this program contains the file + return [updatedProgram]; + } + results.push(updatedProgram); + continue; + } + const programWatch = createWatchProgram(tsconfigPath[1], parseSettings); + knownWatchProgramMap.set(tsconfigPath[0], programWatch); + const program = programWatch.getProgram().getProgram(); + // sets parent pointers in source files + program.getTypeChecker(); + // cache and check the file list + const fileList = updateCachedFileList(tsconfigPath[0], program); + if (fileList.has(filePath)) { + log('Found program for file. %s', filePath); + // we can return early because we know this program contains the file + return [program]; + } + results.push(program); + } + return results; +} +function createWatchProgram(tsconfigPath, parseSettings) { + log('Creating watch program for %s.', tsconfigPath); + // create compiler host + const watchCompilerHost = ts.createWatchCompilerHost(tsconfigPath, (0, shared_1.createDefaultCompilerOptionsFromExtra)(parseSettings), ts.sys, ts.createAbstractBuilder, diagnosticReporter, + // TODO: file issue on TypeScript to suggest making optional? + // eslint-disable-next-line @typescript-eslint/no-empty-function + /*reportWatchStatus*/ () => { }); + watchCompilerHost.jsDocParsingMode = parseSettings.jsDocParsingMode; + // ensure readFile reads the code being linted instead of the copy on disk + const oldReadFile = watchCompilerHost.readFile; + watchCompilerHost.readFile = (filePathIn, encoding) => { + const filePath = (0, shared_1.getCanonicalFileName)(filePathIn); + const fileContent = filePath === currentLintOperationState.filePath + ? (0, source_files_1.getCodeText)(currentLintOperationState.code) + : oldReadFile(filePath, encoding); + if (fileContent != null) { + parsedFilesSeenHash.set(filePath, (0, shared_1.createHash)(fileContent)); + } + return fileContent; + }; + // ensure process reports error on failure instead of exiting process immediately + watchCompilerHost.onUnRecoverableConfigFileDiagnostic = diagnosticReporter; + // ensure process doesn't emit programs + watchCompilerHost.afterProgramCreate = (program) => { + // report error if there are any errors in the config file + const configFileDiagnostics = program + .getConfigFileParsingDiagnostics() + .filter(diag => diag.category === ts.DiagnosticCategory.Error && diag.code !== 18003); + if (configFileDiagnostics.length > 0) { + diagnosticReporter(configFileDiagnostics[0]); + } + }; + /* + * From the CLI, the file watchers won't matter, as the files will be parsed once and then forgotten. + * When running from an IDE, these watchers will let us tell typescript about changes. + * + * ESLint IDE plugins will send us unfinished file content as the user types (before it's saved to disk). + * We use the file watchers to tell typescript about this latest file content. + * + * When files are created (or renamed), we won't know about them because we have no filesystem watchers attached. + * We use the folder watchers to tell typescript it needs to go and find new files in the project folders. + */ + watchCompilerHost.watchFile = saveWatchCallback(fileWatchCallbackTrackingMap); + watchCompilerHost.watchDirectory = saveWatchCallback(folderWatchCallbackTrackingMap); + // allow files with custom extensions to be included in program (uses internal ts api) + const oldOnDirectoryStructureHostCreate = watchCompilerHost.onCachedDirectoryStructureHostCreate; + watchCompilerHost.onCachedDirectoryStructureHostCreate = (host) => { + const oldReadDirectory = host.readDirectory; + host.readDirectory = (path, extensions, exclude, include, depth) => oldReadDirectory(path, !extensions + ? undefined + : [...extensions, ...parseSettings.extraFileExtensions], exclude, include, depth); + oldOnDirectoryStructureHostCreate(host); + }; + // This works only on 3.9 + watchCompilerHost.extraFileExtensions = parseSettings.extraFileExtensions.map(extension => ({ + extension, + isMixedContent: true, + scriptKind: ts.ScriptKind.Deferred, + })); + watchCompilerHost.trace = log; + // Since we don't want to asynchronously update program we want to disable timeout methods + // So any changes in the program will be delayed and updated when getProgram is called on watch + watchCompilerHost.setTimeout = undefined; + watchCompilerHost.clearTimeout = undefined; + return ts.createWatchProgram(watchCompilerHost); +} +function hasTSConfigChanged(tsconfigPath) { + const stat = node_fs_1.default.statSync(tsconfigPath); + const lastModifiedAt = stat.mtimeMs; + const cachedLastModifiedAt = tsconfigLastModifiedTimestampCache.get(tsconfigPath); + tsconfigLastModifiedTimestampCache.set(tsconfigPath, lastModifiedAt); + if (cachedLastModifiedAt == null) { + return false; + } + return Math.abs(cachedLastModifiedAt - lastModifiedAt) > Number.EPSILON; +} +function maybeInvalidateProgram(existingWatch, filePath, tsconfigPath) { + /* + * By calling watchProgram.getProgram(), it will trigger a resync of the program based on + * whatever new file content we've given it from our input. + */ + let updatedProgram = existingWatch.getProgram().getProgram(); + // In case this change causes problems in larger real world codebases + // Provide an escape hatch so people don't _have_ to revert to an older version + if (process.env.TSESTREE_NO_INVALIDATION === 'true') { + return updatedProgram; + } + if (hasTSConfigChanged(tsconfigPath)) { + /* + * If the stat of the tsconfig has changed, that could mean the include/exclude/files lists has changed + * We need to make sure typescript knows this so it can update appropriately + */ + log('tsconfig has changed - triggering program update. %s', tsconfigPath); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + fileWatchCallbackTrackingMap + .get(tsconfigPath) + .forEach(cb => cb(tsconfigPath, ts.FileWatcherEventKind.Changed)); + // tsconfig change means that the file list more than likely changed, so clear the cache + programFileListCache.delete(tsconfigPath); + } + let sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + /* + * Missing source file means our program's folder structure might be out of date. + * So we need to tell typescript it needs to update the correct folder. + */ + log('File was not found in program - triggering folder update. %s', filePath); + // Find the correct directory callback by climbing the folder tree + const currentDir = (0, shared_1.canonicalDirname)(filePath); + let current = null; + let next = currentDir; + let hasCallback = false; + while (current !== next) { + current = next; + const folderWatchCallbacks = folderWatchCallbackTrackingMap.get(current); + if (folderWatchCallbacks) { + for (const cb of folderWatchCallbacks) { + if (currentDir !== current) { + cb(currentDir, ts.FileWatcherEventKind.Changed); + } + cb(current, ts.FileWatcherEventKind.Changed); + } + hasCallback = true; + } + next = (0, shared_1.canonicalDirname)(current); + } + if (!hasCallback) { + /* + * No callback means the paths don't matchup - so no point returning any program + * this will signal to the caller to skip this program + */ + log('No callback found for file, not part of this program. %s', filePath); + return null; + } + // directory update means that the file list more than likely changed, so clear the cache + programFileListCache.delete(tsconfigPath); + // force the immediate resync + updatedProgram = existingWatch.getProgram().getProgram(); + sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + /* + * At this point we're in one of two states: + * - The file isn't supposed to be in this program due to exclusions + * - The file is new, and was renamed from an old, included filename + * + * For the latter case, we need to tell typescript that the old filename is now deleted + */ + log('File was still not found in program after directory update - checking file deletions. %s', filePath); + const rootFilenames = updatedProgram.getRootFileNames(); + // use find because we only need to "delete" one file to cause typescript to do a full resync + const deletedFile = rootFilenames.find(file => !node_fs_1.default.existsSync(file)); + if (!deletedFile) { + // There are no deleted files, so it must be the former case of the file not belonging to this program + return null; + } + const fileWatchCallbacks = fileWatchCallbackTrackingMap.get((0, shared_1.getCanonicalFileName)(deletedFile)); + if (!fileWatchCallbacks) { + // shouldn't happen, but just in case + log('Could not find watch callbacks for root file. %s', deletedFile); + return updatedProgram; + } + log('Marking file as deleted. %s', deletedFile); + fileWatchCallbacks.forEach(cb => cb(deletedFile, ts.FileWatcherEventKind.Deleted)); + // deleted files means that the file list _has_ changed, so clear the cache + programFileListCache.delete(tsconfigPath); + updatedProgram = existingWatch.getProgram().getProgram(); + sourceFile = updatedProgram.getSourceFile(filePath); + if (sourceFile) { + return updatedProgram; + } + log('File was still not found in program after deletion check, assuming it is not part of this program. %s', filePath); + return null; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..30fd61ed1fa6872389d208589da76ce4a975d74d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.d.ts @@ -0,0 +1,27 @@ +import type { Program } from 'typescript'; +import * as ts from 'typescript'; +import type { ParseSettings } from '../parseSettings'; +export interface ASTAndNoProgram { + ast: ts.SourceFile; + program: null; +} +export interface ASTAndDefiniteProgram { + ast: ts.SourceFile; + program: ts.Program; +} +export type ASTAndProgram = ASTAndDefiniteProgram | ASTAndNoProgram; +export declare const DEFAULT_EXTRA_FILE_EXTENSIONS: Set; +export declare function createDefaultCompilerOptionsFromExtra(parseSettings: ParseSettings): ts.CompilerOptions; +export type CanonicalPath = { + __brand: unknown; +} & string; +export declare function getCanonicalFileName(filePath: string): CanonicalPath; +export declare function ensureAbsolutePath(p: string, tsconfigRootDir: string): string; +export declare function canonicalDirname(p: CanonicalPath): CanonicalPath; +export declare function getAstFromProgram(currentProgram: Program, filePath: string): ASTAndDefiniteProgram | undefined; +/** + * Hash content for compare content. + * @param content hashed contend + * @returns hashed result + */ +export declare function createHash(content: string): string; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js new file mode 100644 index 0000000000000000000000000000000000000000..cbbd59c7ed8d5d9cfc26353b09f67247e0505f43 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/shared.js @@ -0,0 +1,130 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_EXTRA_FILE_EXTENSIONS = void 0; +exports.createDefaultCompilerOptionsFromExtra = createDefaultCompilerOptionsFromExtra; +exports.getCanonicalFileName = getCanonicalFileName; +exports.ensureAbsolutePath = ensureAbsolutePath; +exports.canonicalDirname = canonicalDirname; +exports.getAstFromProgram = getAstFromProgram; +exports.createHash = createHash; +const tsconfig_utils_1 = require("@typescript-eslint/tsconfig-utils"); +const node_path_1 = __importDefault(require("node:path")); +const ts = __importStar(require("typescript")); +/** + * Default compiler options for program generation + */ +const DEFAULT_COMPILER_OPTIONS = { + ...tsconfig_utils_1.CORE_COMPILER_OPTIONS, + allowJs: true, + allowNonTsExtensions: true, + checkJs: true, +}; +exports.DEFAULT_EXTRA_FILE_EXTENSIONS = new Set([ + ts.Extension.Cjs, + ts.Extension.Cts, + ts.Extension.Js, + ts.Extension.Jsx, + ts.Extension.Mjs, + ts.Extension.Mts, + ts.Extension.Ts, + ts.Extension.Tsx, +]); +function createDefaultCompilerOptionsFromExtra(parseSettings) { + if (parseSettings.debugLevel.has('typescript')) { + return { + ...DEFAULT_COMPILER_OPTIONS, + extendedDiagnostics: true, + }; + } + return DEFAULT_COMPILER_OPTIONS; +} +// typescript doesn't provide a ts.sys implementation for browser environments +const useCaseSensitiveFileNames = +// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/internal/eqeq-nullish +ts.sys !== undefined ? ts.sys.useCaseSensitiveFileNames : true; +const correctPathCasing = useCaseSensitiveFileNames + ? (filePath) => filePath + : (filePath) => filePath.toLowerCase(); +function getCanonicalFileName(filePath) { + let normalized = node_path_1.default.normalize(filePath); + if (normalized.endsWith(node_path_1.default.sep)) { + normalized = normalized.slice(0, -1); + } + return correctPathCasing(normalized); +} +function ensureAbsolutePath(p, tsconfigRootDir) { + return node_path_1.default.resolve(tsconfigRootDir, p); +} +function canonicalDirname(p) { + return node_path_1.default.dirname(p); +} +const DEFINITION_EXTENSIONS = [ + ts.Extension.Dts, + ts.Extension.Dcts, + ts.Extension.Dmts, +]; +function getExtension(fileName) { + if (!fileName) { + return null; + } + return (DEFINITION_EXTENSIONS.find(definitionExt => fileName.endsWith(definitionExt)) ?? node_path_1.default.extname(fileName)); +} +function getAstFromProgram(currentProgram, filePath) { + const ast = currentProgram.getSourceFile(filePath); + // working around https://github.com/typescript-eslint/typescript-eslint/issues/1573 + const expectedExt = getExtension(filePath); + const returnedExt = getExtension(ast?.fileName); + if (expectedExt !== returnedExt) { + return undefined; + } + return ast && { ast, program: currentProgram }; +} +/** + * Hash content for compare content. + * @param content hashed contend + * @returns hashed result + */ +function createHash(content) { + // No ts.sys in browser environments. + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (ts.sys?.createHash) { + return ts.sys.createHash(content); + } + return content; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ce8f3984a84077cb2da50c2a116dc0027507e9fc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.d.ts @@ -0,0 +1,11 @@ +import * as ts from 'typescript'; +import type { ParseSettings } from '../parseSettings'; +import type { ASTAndDefiniteProgram } from './shared'; +export declare function useProvidedPrograms(programInstances: Iterable, parseSettings: ParseSettings): ASTAndDefiniteProgram; +/** + * Utility offered by parser to help consumers construct their own program instance. + * + * @param configFile the path to the tsconfig.json file, relative to `projectDirectory` + * @param projectDirectory the project directory to use as the CWD, defaults to `process.cwd()` + */ +export declare function createProgramFromConfigFile(configFile: string, projectDirectory?: string): ts.Program; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js new file mode 100644 index 0000000000000000000000000000000000000000..7369ed9eb7c89bdbf1a17eab9943dfb7d2f2173b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/useProvidedPrograms.js @@ -0,0 +1,81 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useProvidedPrograms = useProvidedPrograms; +exports.createProgramFromConfigFile = createProgramFromConfigFile; +const tsconfig_utils_1 = require("@typescript-eslint/tsconfig-utils"); +const debug_1 = __importDefault(require("debug")); +const path = __importStar(require("node:path")); +const ts = __importStar(require("typescript")); +const shared_1 = require("./shared"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:create-program:useProvidedPrograms'); +function useProvidedPrograms(programInstances, parseSettings) { + log('Retrieving ast for %s from provided program instance(s)', parseSettings.filePath); + let astAndProgram; + for (const programInstance of programInstances) { + astAndProgram = (0, shared_1.getAstFromProgram)(programInstance, parseSettings.filePath); + // Stop at the first applicable program instance + if (astAndProgram) { + break; + } + } + if (astAndProgram) { + astAndProgram.program.getTypeChecker(); // ensure parent pointers are set in source files + return astAndProgram; + } + const relativeFilePath = path.relative(parseSettings.tsconfigRootDir, parseSettings.filePath); + const [typeSource, typeSources] = parseSettings.projects.size > 0 + ? ['project', 'project(s)'] + : ['programs', 'program instance(s)']; + const errorLines = [ + `"parserOptions.${typeSource}" has been provided for @typescript-eslint/parser.`, + `The file was not found in any of the provided ${typeSources}: ${relativeFilePath}`, + ]; + throw new Error(errorLines.join('\n')); +} +/** + * Utility offered by parser to help consumers construct their own program instance. + * + * @param configFile the path to the tsconfig.json file, relative to `projectDirectory` + * @param projectDirectory the project directory to use as the CWD, defaults to `process.cwd()` + */ +function createProgramFromConfigFile(configFile, projectDirectory) { + const parsed = (0, tsconfig_utils_1.getParsedConfigFile)(ts, configFile, projectDirectory); + const host = ts.createCompilerHost(parsed.options, true); + return ts.createProgram(parsed.fileNames, parsed.options, host); +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..781de9aa042722e57ce80e7e95e73f91f53b0b99 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.d.ts @@ -0,0 +1,2 @@ +export declare const DEFAULT_PROJECT_FILES_ERROR_EXPLANATION = "\n\nHaving many files run with the default project is known to cause performance issues and slow down linting.\n\nSee https://tseslint.com/allowdefaultproject-glob-too-wide\n"; +export declare function validateDefaultProjectForFilesGlob(allowDefaultProject: string[] | undefined): void; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.js new file mode 100644 index 0000000000000000000000000000000000000000..9186f5d2a85b21bc29c9993df7703757821ed656 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/create-program/validateDefaultProjectForFilesGlob.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION = void 0; +exports.validateDefaultProjectForFilesGlob = validateDefaultProjectForFilesGlob; +exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION = ` + +Having many files run with the default project is known to cause performance issues and slow down linting. + +See https://tseslint.com/allowdefaultproject-glob-too-wide +`; +function validateDefaultProjectForFilesGlob(allowDefaultProject) { + if (!allowDefaultProject?.length) { + return; + } + for (const glob of allowDefaultProject) { + if (glob === '*') { + throw new Error(`allowDefaultProject contains the overly wide '*'.${exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION}`); + } + if (glob.includes('**')) { + throw new Error(`allowDefaultProject glob '${glob}' contains a disallowed '**'.${exports.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION}`); + } + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..685ef30d8e6052b757eb4fd1edbe6f3b9a7183c4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.d.ts @@ -0,0 +1,4 @@ +import type * as ts from 'typescript'; +import type { ASTMaps } from './convert'; +import type { ParserServices } from './parser-options'; +export declare function createParserServices(astMaps: ASTMaps, program: ts.Program | null): ParserServices; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.js new file mode 100644 index 0000000000000000000000000000000000000000..a926ae285bac903cab40611f03e5090bffe15391 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/createParserServices.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createParserServices = createParserServices; +function createParserServices(astMaps, program) { + if (!program) { + return { + emitDecoratorMetadata: undefined, + experimentalDecorators: undefined, + isolatedDeclarations: undefined, + program, + // we always return the node maps because + // (a) they don't require type info and + // (b) they can be useful when using some of TS's internal non-type-aware AST utils + ...astMaps, + }; + } + const checker = program.getTypeChecker(); + const compilerOptions = program.getCompilerOptions(); + return { + program, + // not set in the config is the same as off + emitDecoratorMetadata: compilerOptions.emitDecoratorMetadata ?? false, + experimentalDecorators: compilerOptions.experimentalDecorators ?? false, + isolatedDeclarations: compilerOptions.isolatedDeclarations ?? false, + ...astMaps, + getContextualType: node => checker.getContextualType(astMaps.esTreeNodeToTSNodeMap.get(node)), + getResolvedSignature: node => checker.getResolvedSignature(astMaps.esTreeNodeToTSNodeMap.get(node)), + getSymbolAtLocation: node => checker.getSymbolAtLocation(astMaps.esTreeNodeToTSNodeMap.get(node)), + getTypeAtLocation: node => checker.getTypeAtLocation(astMaps.esTreeNodeToTSNodeMap.get(node)), + getTypeFromTypeNode: node => checker.getTypeFromTypeNode(astMaps.esTreeNodeToTSNodeMap.get(node)), + getTypeOfSymbolAtLocation: (symbol, node) => checker.getTypeOfSymbolAtLocation(symbol, astMaps.esTreeNodeToTSNodeMap.get(node)), + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..481dfaa02595c697cae122af4cfee58cee14677d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.d.ts @@ -0,0 +1,3 @@ +import * as ts from 'typescript'; +export declare function getModifiers(node: ts.Node | null | undefined, includeIllegalModifiers?: boolean): ts.Modifier[] | undefined; +export declare function getDecorators(node: ts.Node | null | undefined, includeIllegalDecorators?: boolean): ts.Decorator[] | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js new file mode 100644 index 0000000000000000000000000000000000000000..4c164059f648cfc69638c0a9bcf81bc2ce41cea6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/getModifiers.js @@ -0,0 +1,74 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getModifiers = getModifiers; +exports.getDecorators = getDecorators; +const ts = __importStar(require("typescript")); +const version_check_1 = require("./version-check"); +const isAtLeast48 = version_check_1.typescriptVersionIsAtLeast['4.8']; +function getModifiers(node, includeIllegalModifiers = false) { + if (node == null) { + return undefined; + } + if (isAtLeast48) { + // eslint-disable-next-line @typescript-eslint/no-deprecated -- this is safe as it's guarded + if (includeIllegalModifiers || ts.canHaveModifiers(node)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated -- this is safe as it's guarded + const modifiers = ts.getModifiers(node); + return modifiers ? [...modifiers] : undefined; + } + return undefined; + } + return ( + // @ts-expect-error intentional fallback for older TS versions + node.modifiers?.filter((m) => !ts.isDecorator(m))); +} +function getDecorators(node, includeIllegalDecorators = false) { + if (node == null) { + return undefined; + } + if (isAtLeast48) { + // eslint-disable-next-line @typescript-eslint/no-deprecated -- this is safe as it's guarded + if (includeIllegalDecorators || ts.canHaveDecorators(node)) { + // eslint-disable-next-line @typescript-eslint/no-deprecated -- this is safe as it's guarded + const decorators = ts.getDecorators(node); + return decorators ? [...decorators] : undefined; + } + return undefined; + } + return ( + // @ts-expect-error intentional fallback for older TS versions + node.decorators?.filter(ts.isDecorator)); +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9a294fac880e5e3f436b1d0a0288e08bdbe57196 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/index.d.ts @@ -0,0 +1,14 @@ +export * from './clear-caches'; +export * from './create-program/getScriptKind'; +export { getCanonicalFileName } from './create-program/shared'; +export { createProgramFromConfigFile as createProgram } from './create-program/useProvidedPrograms'; +export * from './getModifiers'; +export { TSError } from './node-utils'; +export { type AST, parse, parseAndGenerateServices, type ParseAndGenerateServicesResult, } from './parser'; +export type { ParserServices, ParserServicesWithoutTypeInformation, ParserServicesWithTypeInformation, TSESTreeOptions, } from './parser-options'; +export { addCandidateTSConfigRootDir, clearCandidateTSConfigRootDirs, } from './parseSettings/candidateTSConfigRootDirs'; +export { simpleTraverse } from './simple-traverse'; +export * from './ts-estree'; +export { typescriptVersionIsAtLeast } from './version-check'; +export { version } from './version'; +export { withoutProjectParserOptions } from './withoutProjectParserOptions'; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/index.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..124f1ebcecc71e3c988452157416c6919160e842 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/index.js @@ -0,0 +1,41 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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.withoutProjectParserOptions = exports.version = exports.typescriptVersionIsAtLeast = exports.simpleTraverse = exports.clearCandidateTSConfigRootDirs = exports.addCandidateTSConfigRootDir = exports.parseAndGenerateServices = exports.parse = exports.TSError = exports.createProgram = exports.getCanonicalFileName = void 0; +__exportStar(require("./clear-caches"), exports); +__exportStar(require("./create-program/getScriptKind"), exports); +var shared_1 = require("./create-program/shared"); +Object.defineProperty(exports, "getCanonicalFileName", { enumerable: true, get: function () { return shared_1.getCanonicalFileName; } }); +var useProvidedPrograms_1 = require("./create-program/useProvidedPrograms"); +Object.defineProperty(exports, "createProgram", { enumerable: true, get: function () { return useProvidedPrograms_1.createProgramFromConfigFile; } }); +__exportStar(require("./getModifiers"), exports); +var node_utils_1 = require("./node-utils"); +Object.defineProperty(exports, "TSError", { enumerable: true, get: function () { return node_utils_1.TSError; } }); +var parser_1 = require("./parser"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parser_1.parse; } }); +Object.defineProperty(exports, "parseAndGenerateServices", { enumerable: true, get: function () { return parser_1.parseAndGenerateServices; } }); +var candidateTSConfigRootDirs_1 = require("./parseSettings/candidateTSConfigRootDirs"); +Object.defineProperty(exports, "addCandidateTSConfigRootDir", { enumerable: true, get: function () { return candidateTSConfigRootDirs_1.addCandidateTSConfigRootDir; } }); +Object.defineProperty(exports, "clearCandidateTSConfigRootDirs", { enumerable: true, get: function () { return candidateTSConfigRootDirs_1.clearCandidateTSConfigRootDirs; } }); +var simple_traverse_1 = require("./simple-traverse"); +Object.defineProperty(exports, "simpleTraverse", { enumerable: true, get: function () { return simple_traverse_1.simpleTraverse; } }); +__exportStar(require("./ts-estree"), exports); +var version_check_1 = require("./version-check"); +Object.defineProperty(exports, "typescriptVersionIsAtLeast", { enumerable: true, get: function () { return version_check_1.typescriptVersionIsAtLeast; } }); +var version_1 = require("./version"); +Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_1.version; } }); +var withoutProjectParserOptions_1 = require("./withoutProjectParserOptions"); +Object.defineProperty(exports, "withoutProjectParserOptions", { enumerable: true, get: function () { return withoutProjectParserOptions_1.withoutProjectParserOptions; } }); diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c60e67e3c85f706dfa829e9f9de3b84d2b934bf4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.d.ts @@ -0,0 +1 @@ +export declare const xhtmlEntities: Record; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js new file mode 100644 index 0000000000000000000000000000000000000000..8fc299b281000a53a86dc0d0b63e2bee10ceedad --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/jsx/xhtml-entities.js @@ -0,0 +1,258 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.xhtmlEntities = void 0; +exports.xhtmlEntities = { + Aacute: '\u00C1', + aacute: '\u00E1', + Acirc: '\u00C2', + acirc: '\u00E2', + acute: '\u00B4', + AElig: '\u00C6', + aelig: '\u00E6', + Agrave: '\u00C0', + agrave: '\u00E0', + alefsym: '\u2135', + Alpha: '\u0391', + alpha: '\u03B1', + amp: '&', + and: '\u2227', + ang: '\u2220', + apos: '\u0027', + Aring: '\u00C5', + aring: '\u00E5', + asymp: '\u2248', + Atilde: '\u00C3', + atilde: '\u00E3', + Auml: '\u00C4', + auml: '\u00E4', + bdquo: '\u201E', + Beta: '\u0392', + beta: '\u03B2', + brvbar: '\u00A6', + bull: '\u2022', + cap: '\u2229', + Ccedil: '\u00C7', + ccedil: '\u00E7', + cedil: '\u00B8', + cent: '\u00A2', + Chi: '\u03A7', + chi: '\u03C7', + circ: '\u02C6', + clubs: '\u2663', + cong: '\u2245', + copy: '\u00A9', + crarr: '\u21B5', + cup: '\u222A', + curren: '\u00A4', + dagger: '\u2020', + Dagger: '\u2021', + darr: '\u2193', + dArr: '\u21D3', + deg: '\u00B0', + Delta: '\u0394', + delta: '\u03B4', + diams: '\u2666', + divide: '\u00F7', + Eacute: '\u00C9', + eacute: '\u00E9', + Ecirc: '\u00CA', + ecirc: '\u00EA', + Egrave: '\u00C8', + egrave: '\u00E8', + empty: '\u2205', + emsp: '\u2003', + ensp: '\u2002', + Epsilon: '\u0395', + epsilon: '\u03B5', + equiv: '\u2261', + Eta: '\u0397', + eta: '\u03B7', + ETH: '\u00D0', + eth: '\u00F0', + Euml: '\u00CB', + euml: '\u00EB', + euro: '\u20AC', + exist: '\u2203', + fnof: '\u0192', + forall: '\u2200', + frac12: '\u00BD', + frac14: '\u00BC', + frac34: '\u00BE', + frasl: '\u2044', + Gamma: '\u0393', + gamma: '\u03B3', + ge: '\u2265', + gt: '>', + harr: '\u2194', + hArr: '\u21D4', + hearts: '\u2665', + hellip: '\u2026', + Iacute: '\u00CD', + iacute: '\u00ED', + Icirc: '\u00CE', + icirc: '\u00EE', + iexcl: '\u00A1', + Igrave: '\u00CC', + igrave: '\u00EC', + image: '\u2111', + infin: '\u221E', + int: '\u222B', + Iota: '\u0399', + iota: '\u03B9', + iquest: '\u00BF', + isin: '\u2208', + Iuml: '\u00CF', + iuml: '\u00EF', + Kappa: '\u039A', + kappa: '\u03BA', + Lambda: '\u039B', + lambda: '\u03BB', + lang: '\u2329', + laquo: '\u00AB', + larr: '\u2190', + lArr: '\u21D0', + lceil: '\u2308', + ldquo: '\u201C', + le: '\u2264', + lfloor: '\u230A', + lowast: '\u2217', + loz: '\u25CA', + lrm: '\u200E', + lsaquo: '\u2039', + lsquo: '\u2018', + lt: '<', + macr: '\u00AF', + mdash: '\u2014', + micro: '\u00B5', + middot: '\u00B7', + minus: '\u2212', + Mu: '\u039C', + mu: '\u03BC', + nabla: '\u2207', + nbsp: '\u00A0', + ndash: '\u2013', + ne: '\u2260', + ni: '\u220B', + not: '\u00AC', + notin: '\u2209', + nsub: '\u2284', + Ntilde: '\u00D1', + ntilde: '\u00F1', + Nu: '\u039D', + nu: '\u03BD', + Oacute: '\u00D3', + oacute: '\u00F3', + Ocirc: '\u00D4', + ocirc: '\u00F4', + OElig: '\u0152', + oelig: '\u0153', + Ograve: '\u00D2', + ograve: '\u00F2', + oline: '\u203E', + Omega: '\u03A9', + omega: '\u03C9', + Omicron: '\u039F', + omicron: '\u03BF', + oplus: '\u2295', + or: '\u2228', + ordf: '\u00AA', + ordm: '\u00BA', + Oslash: '\u00D8', + oslash: '\u00F8', + Otilde: '\u00D5', + otilde: '\u00F5', + otimes: '\u2297', + Ouml: '\u00D6', + ouml: '\u00F6', + para: '\u00B6', + part: '\u2202', + permil: '\u2030', + perp: '\u22A5', + Phi: '\u03A6', + phi: '\u03C6', + Pi: '\u03A0', + pi: '\u03C0', + piv: '\u03D6', + plusmn: '\u00B1', + pound: '\u00A3', + prime: '\u2032', + Prime: '\u2033', + prod: '\u220F', + prop: '\u221D', + Psi: '\u03A8', + psi: '\u03C8', + quot: '\u0022', + radic: '\u221A', + rang: '\u232A', + raquo: '\u00BB', + rarr: '\u2192', + rArr: '\u21D2', + rceil: '\u2309', + rdquo: '\u201D', + real: '\u211C', + reg: '\u00AE', + rfloor: '\u230B', + Rho: '\u03A1', + rho: '\u03C1', + rlm: '\u200F', + rsaquo: '\u203A', + rsquo: '\u2019', + sbquo: '\u201A', + Scaron: '\u0160', + scaron: '\u0161', + sdot: '\u22C5', + sect: '\u00A7', + shy: '\u00AD', + Sigma: '\u03A3', + sigma: '\u03C3', + sigmaf: '\u03C2', + sim: '\u223C', + spades: '\u2660', + sub: '\u2282', + sube: '\u2286', + sum: '\u2211', + sup: '\u2283', + sup1: '\u00B9', + sup2: '\u00B2', + sup3: '\u00B3', + supe: '\u2287', + szlig: '\u00DF', + Tau: '\u03A4', + tau: '\u03C4', + there4: '\u2234', + Theta: '\u0398', + theta: '\u03B8', + thetasym: '\u03D1', + thinsp: '\u2009', + THORN: '\u00DE', + thorn: '\u00FE', + tilde: '\u02DC', + times: '\u00D7', + trade: '\u2122', + Uacute: '\u00DA', + uacute: '\u00FA', + uarr: '\u2191', + uArr: '\u21D1', + Ucirc: '\u00DB', + ucirc: '\u00FB', + Ugrave: '\u00D9', + ugrave: '\u00F9', + uml: '\u00A8', + upsih: '\u03D2', + Upsilon: '\u03A5', + upsilon: '\u03C5', + Uuml: '\u00DC', + uuml: '\u00FC', + weierp: '\u2118', + Xi: '\u039E', + xi: '\u03BE', + Yacute: '\u00DD', + yacute: '\u00FD', + yen: '\u00A5', + yuml: '\u00FF', + Yuml: '\u0178', + Zeta: '\u0396', + zeta: '\u03B6', + zwj: '\u200D', + zwnj: '\u200C', +}; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..60f7f40e02a6d65e6c556accc05c041bc0005ef6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.d.ts @@ -0,0 +1,189 @@ +import * as ts from 'typescript'; +import type { TSESTree } from './ts-estree'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from './ts-estree'; +declare const SyntaxKind: typeof ts.SyntaxKind; +type LogicalOperatorKind = ts.SyntaxKind.AmpersandAmpersandToken | ts.SyntaxKind.BarBarToken | ts.SyntaxKind.QuestionQuestionToken; +interface TokenToText extends TSESTree.PunctuatorTokenToText, TSESTree.BinaryOperatorToText { + [SyntaxKind.ImportKeyword]: 'import'; + [SyntaxKind.KeyOfKeyword]: 'keyof'; + [SyntaxKind.NewKeyword]: 'new'; + [SyntaxKind.ReadonlyKeyword]: 'readonly'; + [SyntaxKind.UniqueKeyword]: 'unique'; +} +type AssignmentOperatorKind = keyof TSESTree.AssignmentOperatorToText; +type BinaryOperatorKind = keyof TSESTree.BinaryOperatorToText; +type DeclarationKind = TSESTree.VariableDeclaration['kind']; +/** + * Returns true if the given ts.Token is a logical operator + */ +export declare function isLogicalOperator(operator: ts.BinaryOperatorToken): operator is ts.Token; +export declare function isESTreeBinaryOperator(operator: ts.BinaryOperatorToken): operator is ts.Token; +type TokenForTokenKind = T extends keyof TokenToText ? TokenToText[T] : string | undefined; +/** + * Returns the string form of the given TSToken SyntaxKind + */ +export declare function getTextForTokenKind(kind: T): TokenForTokenKind; +/** + * Returns true if the given ts.Node is a valid ESTree class member + */ +export declare function isESTreeClassMember(node: ts.Node): boolean; +/** + * Checks if a ts.Node has a modifier + */ +export declare function hasModifier(modifierKind: ts.KeywordSyntaxKind, node: ts.Node): boolean; +/** + * Get last last modifier in ast + * @returns returns last modifier if present or null + */ +export declare function getLastModifier(node: ts.Node): ts.Modifier | null; +/** + * Returns true if the given ts.Token is a comma + */ +export declare function isComma(token: ts.Node): token is ts.Token; +/** + * Returns true if the given ts.Node is a comment + */ +export declare function isComment(node: ts.Node): boolean; +/** + * Returns the binary expression type of the given ts.Token + */ +export declare function getBinaryExpressionType(operator: ts.BinaryOperatorToken): { + operator: TokenForTokenKind; + type: AST_NODE_TYPES.AssignmentExpression; +} | { + operator: TokenForTokenKind; + type: AST_NODE_TYPES.BinaryExpression; +} | { + operator: TokenForTokenKind; + type: AST_NODE_TYPES.LogicalExpression; +}; +/** + * Returns line and column data for the given positions + */ +export declare function getLineAndCharacterFor(pos: number, ast: ts.SourceFile): TSESTree.Position; +/** + * Returns line and column data for the given start and end positions, + * for the given AST + */ +export declare function getLocFor(range: TSESTree.Range, ast: ts.SourceFile): TSESTree.SourceLocation; +/** + * Check whatever node can contain directive + */ +export declare function canContainDirective(node: ts.Block | ts.ClassStaticBlockDeclaration | ts.ModuleBlock | ts.SourceFile): boolean; +/** + * Returns range for the given ts.Node + */ +export declare function getRange(node: Pick, ast: ts.SourceFile): [number, number]; +/** + * Returns true if a given ts.Node is a JSX token + */ +export declare function isJSXToken(node: ts.Node): boolean; +/** + * Returns the declaration kind of the given ts.Node + */ +export declare function getDeclarationKind(node: ts.VariableDeclarationList): DeclarationKind; +/** + * Gets a ts.Node's accessibility level + */ +export declare function getTSNodeAccessibility(node: ts.Node): 'private' | 'protected' | 'public' | undefined; +/** + * Finds the next token based on the previous one and its parent + * Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren + */ +export declare function findNextToken(previousToken: ts.TextRange, parent: ts.Node, ast: ts.SourceFile): ts.Node | undefined; +/** + * Find the first matching ancestor based on the given predicate function. + * @param node The current ts.Node + * @param predicate The predicate function to apply to each checked ancestor + * @returns a matching parent ts.Node + */ +export declare function findFirstMatchingAncestor(node: ts.Node, predicate: (node: ts.Node) => boolean): ts.Node | undefined; +/** + * Returns true if a given ts.Node has a JSX token within its hierarchy + */ +export declare function hasJSXAncestor(node: ts.Node): boolean; +/** + * Unescape the text content of string literals, e.g. & -> & + * @param text The escaped string literal text. + * @returns The unescaped string literal text. + */ +export declare function unescapeStringLiteralText(text: string): string; +/** + * Returns true if a given ts.Node is a computed property + */ +export declare function isComputedProperty(node: ts.Node): node is ts.ComputedPropertyName; +/** + * Returns true if a given ts.Node is optional (has QuestionToken) + * @param node ts.Node to be checked + */ +export declare function isOptional(node: { + questionToken?: ts.QuestionToken; +}): boolean; +/** + * Returns true if the node is an optional chain node + */ +export declare function isChainExpression(node: TSESTree.Node): node is TSESTree.ChainExpression; +/** + * Returns true of the child of property access expression is an optional chain + */ +export declare function isChildUnwrappableOptionalChain(node: ts.CallExpression | ts.ElementAccessExpression | ts.NonNullExpression | ts.PropertyAccessExpression, child: TSESTree.Node): boolean; +/** + * Returns the type of a given ts.Token + */ +export declare function getTokenType(token: ts.Identifier | ts.Token): Exclude; +/** + * Extends and formats a given ts.Token, for a given AST + */ +export declare function convertToken(token: ts.Token, ast: ts.SourceFile): TSESTree.Token; +/** + * Converts all tokens for the given AST + * @param ast the AST object + * @returns the converted Tokens + */ +export declare function convertTokens(ast: ts.SourceFile): TSESTree.Token[]; +export declare class TSError extends Error { + readonly fileName: string; + readonly location: { + end: { + column: number; + line: number; + offset: number; + }; + start: { + column: number; + line: number; + offset: number; + }; + }; + name: string; + constructor(message: string, fileName: string, location: { + end: { + column: number; + line: number; + offset: number; + }; + start: { + column: number; + line: number; + offset: number; + }; + }); + get index(): number; + get lineNumber(): number; + get column(): number; +} +export declare function createError(node: ts.Node, message: string): TSError; +export declare function createError(node: number | ts.Node | TSESTree.Range, message: string, sourceFile: ts.SourceFile): TSError; +export declare function nodeHasTokens(n: ts.Node, ast: ts.SourceFile): boolean; +/** + * Like `forEach`, but suitable for use with numbers and strings (which may be falsy). + */ +export declare function firstDefined(array: readonly T[] | undefined, callback: (element: T, index: number) => U | undefined): U | undefined; +export declare function identifierIsThisKeyword(id: ts.Identifier): boolean; +export declare function isThisIdentifier(node: ts.Node | undefined): node is ts.Identifier; +export declare function isThisInTypeQuery(node: ts.Node): boolean; +export declare function isValidAssignmentTarget(node: ts.Node): boolean; +export declare function getNamespaceModifiers(node: ts.ModuleDeclaration): ts.Modifier[] | undefined; +export declare function declarationNameToString(node: ts.Node): string; +export declare function isEntityNameExpression(node: ts.Node): node is ts.EntityNameExpression; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js new file mode 100644 index 0000000000000000000000000000000000000000..68330202066ad7750e56d38f385450cbb2645fb4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/node-utils.js @@ -0,0 +1,673 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TSError = void 0; +exports.isLogicalOperator = isLogicalOperator; +exports.isESTreeBinaryOperator = isESTreeBinaryOperator; +exports.getTextForTokenKind = getTextForTokenKind; +exports.isESTreeClassMember = isESTreeClassMember; +exports.hasModifier = hasModifier; +exports.getLastModifier = getLastModifier; +exports.isComma = isComma; +exports.isComment = isComment; +exports.getBinaryExpressionType = getBinaryExpressionType; +exports.getLineAndCharacterFor = getLineAndCharacterFor; +exports.getLocFor = getLocFor; +exports.canContainDirective = canContainDirective; +exports.getRange = getRange; +exports.isJSXToken = isJSXToken; +exports.getDeclarationKind = getDeclarationKind; +exports.getTSNodeAccessibility = getTSNodeAccessibility; +exports.findNextToken = findNextToken; +exports.findFirstMatchingAncestor = findFirstMatchingAncestor; +exports.hasJSXAncestor = hasJSXAncestor; +exports.unescapeStringLiteralText = unescapeStringLiteralText; +exports.isComputedProperty = isComputedProperty; +exports.isOptional = isOptional; +exports.isChainExpression = isChainExpression; +exports.isChildUnwrappableOptionalChain = isChildUnwrappableOptionalChain; +exports.getTokenType = getTokenType; +exports.convertToken = convertToken; +exports.convertTokens = convertTokens; +exports.createError = createError; +exports.nodeHasTokens = nodeHasTokens; +exports.firstDefined = firstDefined; +exports.identifierIsThisKeyword = identifierIsThisKeyword; +exports.isThisIdentifier = isThisIdentifier; +exports.isThisInTypeQuery = isThisInTypeQuery; +exports.isValidAssignmentTarget = isValidAssignmentTarget; +exports.getNamespaceModifiers = getNamespaceModifiers; +exports.declarationNameToString = declarationNameToString; +exports.isEntityNameExpression = isEntityNameExpression; +const ts = __importStar(require("typescript")); +const getModifiers_1 = require("./getModifiers"); +const xhtml_entities_1 = require("./jsx/xhtml-entities"); +const ts_estree_1 = require("./ts-estree"); +const version_check_1 = require("./version-check"); +const isAtLeast50 = version_check_1.typescriptVersionIsAtLeast['5.0']; +const SyntaxKind = ts.SyntaxKind; +const LOGICAL_OPERATORS = new Set([ + SyntaxKind.AmpersandAmpersandToken, + SyntaxKind.BarBarToken, + SyntaxKind.QuestionQuestionToken, +]); +const ASSIGNMENT_OPERATORS = new Set([ + ts.SyntaxKind.AmpersandAmpersandEqualsToken, + ts.SyntaxKind.AmpersandEqualsToken, + ts.SyntaxKind.AsteriskAsteriskEqualsToken, + ts.SyntaxKind.AsteriskEqualsToken, + ts.SyntaxKind.BarBarEqualsToken, + ts.SyntaxKind.BarEqualsToken, + ts.SyntaxKind.CaretEqualsToken, + ts.SyntaxKind.EqualsToken, + ts.SyntaxKind.GreaterThanGreaterThanEqualsToken, + ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken, + ts.SyntaxKind.LessThanLessThanEqualsToken, + ts.SyntaxKind.MinusEqualsToken, + ts.SyntaxKind.PercentEqualsToken, + ts.SyntaxKind.PlusEqualsToken, + ts.SyntaxKind.QuestionQuestionEqualsToken, + ts.SyntaxKind.SlashEqualsToken, +]); +const BINARY_OPERATORS = new Set([ + SyntaxKind.AmpersandAmpersandToken, + SyntaxKind.AmpersandToken, + SyntaxKind.AsteriskAsteriskToken, + SyntaxKind.AsteriskToken, + SyntaxKind.BarBarToken, + SyntaxKind.BarToken, + SyntaxKind.CaretToken, + SyntaxKind.EqualsEqualsEqualsToken, + SyntaxKind.EqualsEqualsToken, + SyntaxKind.ExclamationEqualsEqualsToken, + SyntaxKind.ExclamationEqualsToken, + SyntaxKind.GreaterThanEqualsToken, + SyntaxKind.GreaterThanGreaterThanGreaterThanToken, + SyntaxKind.GreaterThanGreaterThanToken, + SyntaxKind.GreaterThanToken, + SyntaxKind.InKeyword, + SyntaxKind.InstanceOfKeyword, + SyntaxKind.LessThanEqualsToken, + SyntaxKind.LessThanLessThanToken, + SyntaxKind.LessThanToken, + SyntaxKind.MinusToken, + SyntaxKind.PercentToken, + SyntaxKind.PlusToken, + SyntaxKind.SlashToken, +]); +/** + * Returns true if the given ts.Token is the assignment operator + */ +function isAssignmentOperator(operator) { + return ASSIGNMENT_OPERATORS.has(operator.kind); +} +/** + * Returns true if the given ts.Token is a logical operator + */ +function isLogicalOperator(operator) { + return LOGICAL_OPERATORS.has(operator.kind); +} +function isESTreeBinaryOperator(operator) { + return BINARY_OPERATORS.has(operator.kind); +} +/** + * Returns the string form of the given TSToken SyntaxKind + */ +function getTextForTokenKind(kind) { + return ts.tokenToString(kind); +} +/** + * Returns true if the given ts.Node is a valid ESTree class member + */ +function isESTreeClassMember(node) { + return node.kind !== SyntaxKind.SemicolonClassElement; +} +/** + * Checks if a ts.Node has a modifier + */ +function hasModifier(modifierKind, node) { + const modifiers = (0, getModifiers_1.getModifiers)(node); + return modifiers?.some(modifier => modifier.kind === modifierKind) === true; +} +/** + * Get last last modifier in ast + * @returns returns last modifier if present or null + */ +function getLastModifier(node) { + const modifiers = (0, getModifiers_1.getModifiers)(node); + if (modifiers == null) { + return null; + } + return modifiers[modifiers.length - 1] ?? null; +} +/** + * Returns true if the given ts.Token is a comma + */ +function isComma(token) { + return token.kind === SyntaxKind.CommaToken; +} +/** + * Returns true if the given ts.Node is a comment + */ +function isComment(node) { + return (node.kind === SyntaxKind.SingleLineCommentTrivia || + node.kind === SyntaxKind.MultiLineCommentTrivia); +} +/** + * Returns true if the given ts.Node is a JSDoc comment + */ +function isJSDocComment(node) { + // eslint-disable-next-line @typescript-eslint/no-deprecated -- SyntaxKind.JSDoc was only added in TS4.7 so we can't use it yet + return node.kind === SyntaxKind.JSDocComment; +} +/** + * Returns the binary expression type of the given ts.Token + */ +function getBinaryExpressionType(operator) { + if (isAssignmentOperator(operator)) { + return { + type: ts_estree_1.AST_NODE_TYPES.AssignmentExpression, + operator: getTextForTokenKind(operator.kind), + }; + } + if (isLogicalOperator(operator)) { + return { + type: ts_estree_1.AST_NODE_TYPES.LogicalExpression, + operator: getTextForTokenKind(operator.kind), + }; + } + if (isESTreeBinaryOperator(operator)) { + return { + type: ts_estree_1.AST_NODE_TYPES.BinaryExpression, + operator: getTextForTokenKind(operator.kind), + }; + } + throw new Error(`Unexpected binary operator ${ts.tokenToString(operator.kind)}`); +} +/** + * Returns line and column data for the given positions + */ +function getLineAndCharacterFor(pos, ast) { + const loc = ast.getLineAndCharacterOfPosition(pos); + return { + column: loc.character, + line: loc.line + 1, + }; +} +/** + * Returns line and column data for the given start and end positions, + * for the given AST + */ +function getLocFor(range, ast) { + const [start, end] = range.map(pos => getLineAndCharacterFor(pos, ast)); + return { end, start }; +} +/** + * Check whatever node can contain directive + */ +function canContainDirective(node) { + if (node.kind === ts.SyntaxKind.Block) { + switch (node.parent.kind) { + case ts.SyntaxKind.Constructor: + case ts.SyntaxKind.GetAccessor: + case ts.SyntaxKind.SetAccessor: + case ts.SyntaxKind.ArrowFunction: + case ts.SyntaxKind.FunctionExpression: + case ts.SyntaxKind.FunctionDeclaration: + case ts.SyntaxKind.MethodDeclaration: + return true; + default: + return false; + } + } + return true; +} +/** + * Returns range for the given ts.Node + */ +function getRange(node, ast) { + return [node.getStart(ast), node.getEnd()]; +} +/** + * Returns true if a given ts.Node is a token + */ +function isToken(node) { + return (node.kind >= SyntaxKind.FirstToken && node.kind <= SyntaxKind.LastToken); +} +/** + * Returns true if a given ts.Node is a JSX token + */ +function isJSXToken(node) { + return (node.kind >= SyntaxKind.JsxElement && node.kind <= SyntaxKind.JsxAttribute); +} +/** + * Returns the declaration kind of the given ts.Node + */ +function getDeclarationKind(node) { + if (node.flags & ts.NodeFlags.Let) { + return 'let'; + } + // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison + if ((node.flags & ts.NodeFlags.AwaitUsing) === ts.NodeFlags.AwaitUsing) { + return 'await using'; + } + if (node.flags & ts.NodeFlags.Const) { + return 'const'; + } + if (node.flags & ts.NodeFlags.Using) { + return 'using'; + } + return 'var'; +} +/** + * Gets a ts.Node's accessibility level + */ +function getTSNodeAccessibility(node) { + const modifiers = (0, getModifiers_1.getModifiers)(node); + if (modifiers == null) { + return undefined; + } + for (const modifier of modifiers) { + switch (modifier.kind) { + case SyntaxKind.PublicKeyword: + return 'public'; + case SyntaxKind.ProtectedKeyword: + return 'protected'; + case SyntaxKind.PrivateKeyword: + return 'private'; + default: + break; + } + } + return undefined; +} +/** + * Finds the next token based on the previous one and its parent + * Had to copy this from TS instead of using TS's version because theirs doesn't pass the ast to getChildren + */ +function findNextToken(previousToken, parent, ast) { + return find(parent); + function find(n) { + if (ts.isToken(n) && n.pos === previousToken.end) { + // this is token that starts at the end of previous token - return it + return n; + } + return firstDefined(n.getChildren(ast), (child) => { + const shouldDiveInChildNode = + // previous token is enclosed somewhere in the child + (child.pos <= previousToken.pos && child.end > previousToken.end) || + // previous token ends exactly at the beginning of child + child.pos === previousToken.end; + return shouldDiveInChildNode && nodeHasTokens(child, ast) + ? find(child) + : undefined; + }); + } +} +/** + * Find the first matching ancestor based on the given predicate function. + * @param node The current ts.Node + * @param predicate The predicate function to apply to each checked ancestor + * @returns a matching parent ts.Node + */ +function findFirstMatchingAncestor(node, predicate) { + let current = node; + while (current) { + if (predicate(current)) { + return current; + } + current = current.parent; + } + return undefined; +} +/** + * Returns true if a given ts.Node has a JSX token within its hierarchy + */ +function hasJSXAncestor(node) { + return !!findFirstMatchingAncestor(node, isJSXToken); +} +/** + * Unescape the text content of string literals, e.g. & -> & + * @param text The escaped string literal text. + * @returns The unescaped string literal text. + */ +function unescapeStringLiteralText(text) { + return text.replaceAll(/&(?:#\d+|#x[\da-fA-F]+|[0-9a-zA-Z]+);/g, entity => { + const item = entity.slice(1, -1); + if (item[0] === '#') { + const codePoint = item[1] === 'x' + ? parseInt(item.slice(2), 16) + : parseInt(item.slice(1), 10); + return codePoint > 0x10ffff // RangeError: Invalid code point + ? entity + : String.fromCodePoint(codePoint); + } + return xhtml_entities_1.xhtmlEntities[item] || entity; + }); +} +/** + * Returns true if a given ts.Node is a computed property + */ +function isComputedProperty(node) { + return node.kind === SyntaxKind.ComputedPropertyName; +} +/** + * Returns true if a given ts.Node is optional (has QuestionToken) + * @param node ts.Node to be checked + */ +function isOptional(node) { + return !!node.questionToken; +} +/** + * Returns true if the node is an optional chain node + */ +function isChainExpression(node) { + return node.type === ts_estree_1.AST_NODE_TYPES.ChainExpression; +} +/** + * Returns true of the child of property access expression is an optional chain + */ +function isChildUnwrappableOptionalChain(node, child) { + return (isChainExpression(child) && + // (x?.y).z is semantically different, and as such .z is no longer optional + node.expression.kind !== ts.SyntaxKind.ParenthesizedExpression); +} +/** + * Returns the type of a given ts.Token + */ +function getTokenType(token) { + if (token.kind === SyntaxKind.NullKeyword) { + return ts_estree_1.AST_TOKEN_TYPES.Null; + } + if (token.kind >= SyntaxKind.FirstKeyword && + token.kind <= SyntaxKind.LastFutureReservedWord) { + if (token.kind === SyntaxKind.FalseKeyword || + token.kind === SyntaxKind.TrueKeyword) { + return ts_estree_1.AST_TOKEN_TYPES.Boolean; + } + return ts_estree_1.AST_TOKEN_TYPES.Keyword; + } + if (token.kind >= SyntaxKind.FirstPunctuation && + token.kind <= SyntaxKind.LastPunctuation) { + return ts_estree_1.AST_TOKEN_TYPES.Punctuator; + } + if (token.kind >= SyntaxKind.NoSubstitutionTemplateLiteral && + token.kind <= SyntaxKind.TemplateTail) { + return ts_estree_1.AST_TOKEN_TYPES.Template; + } + switch (token.kind) { + case SyntaxKind.NumericLiteral: + case SyntaxKind.BigIntLiteral: + return ts_estree_1.AST_TOKEN_TYPES.Numeric; + case SyntaxKind.PrivateIdentifier: + return ts_estree_1.AST_TOKEN_TYPES.PrivateIdentifier; + case SyntaxKind.JsxText: + return ts_estree_1.AST_TOKEN_TYPES.JSXText; + case SyntaxKind.StringLiteral: + // A TypeScript-StringLiteral token with a TypeScript-JsxAttribute or TypeScript-JsxElement parent, + // must actually be an ESTree-JSXText token + if (token.parent.kind === SyntaxKind.JsxAttribute || + token.parent.kind === SyntaxKind.JsxElement) { + return ts_estree_1.AST_TOKEN_TYPES.JSXText; + } + return ts_estree_1.AST_TOKEN_TYPES.String; + case SyntaxKind.RegularExpressionLiteral: + return ts_estree_1.AST_TOKEN_TYPES.RegularExpression; + case SyntaxKind.Identifier: + case SyntaxKind.ConstructorKeyword: + case SyntaxKind.GetKeyword: + case SyntaxKind.SetKeyword: + // intentional fallthrough + default: + } + // Some JSX tokens have to be determined based on their parent + if (token.kind === SyntaxKind.Identifier) { + if (isJSXToken(token.parent)) { + return ts_estree_1.AST_TOKEN_TYPES.JSXIdentifier; + } + if (token.parent.kind === SyntaxKind.PropertyAccessExpression && + hasJSXAncestor(token)) { + return ts_estree_1.AST_TOKEN_TYPES.JSXIdentifier; + } + } + return ts_estree_1.AST_TOKEN_TYPES.Identifier; +} +/** + * Extends and formats a given ts.Token, for a given AST + */ +function convertToken(token, ast) { + const start = token.kind === SyntaxKind.JsxText + ? token.getFullStart() + : token.getStart(ast); + const end = token.getEnd(); + const value = ast.text.slice(start, end); + const tokenType = getTokenType(token); + const range = [start, end]; + const loc = getLocFor(range, ast); + if (tokenType === ts_estree_1.AST_TOKEN_TYPES.RegularExpression) { + return { + type: tokenType, + loc, + range, + regex: { + flags: value.slice(value.lastIndexOf('/') + 1), + pattern: value.slice(1, value.lastIndexOf('/')), + }, + value, + }; + } + if (tokenType === ts_estree_1.AST_TOKEN_TYPES.PrivateIdentifier) { + return { + type: tokenType, + loc, + range, + value: value.slice(1), + }; + } + // @ts-expect-error TS is complaining about `value` not being the correct + // type but it is + return { + type: tokenType, + loc, + range, + value, + }; +} +/** + * Converts all tokens for the given AST + * @param ast the AST object + * @returns the converted Tokens + */ +function convertTokens(ast) { + const result = []; + /** + * @param node the ts.Node + */ + function walk(node) { + // TypeScript generates tokens for types in JSDoc blocks. Comment tokens + // and their children should not be walked or added to the resulting tokens list. + if (isComment(node) || isJSDocComment(node)) { + return; + } + if (isToken(node) && node.kind !== SyntaxKind.EndOfFileToken) { + result.push(convertToken(node, ast)); + } + else { + node.getChildren(ast).forEach(walk); + } + } + walk(ast); + return result; +} +class TSError extends Error { + fileName; + location; + name = 'TSError'; + constructor(message, fileName, location) { + super(message); + this.fileName = fileName; + this.location = location; + } + // For old version of ESLint https://github.com/typescript-eslint/typescript-eslint/pull/6556#discussion_r1123237311 + get index() { + return this.location.start.offset; + } + // https://github.com/eslint/eslint/blob/b09a512107249a4eb19ef5a37b0bd672266eafdb/lib/linter/linter.js#L853 + get lineNumber() { + return this.location.start.line; + } + // https://github.com/eslint/eslint/blob/b09a512107249a4eb19ef5a37b0bd672266eafdb/lib/linter/linter.js#L854 + get column() { + return this.location.start.column; + } +} +exports.TSError = TSError; +function createError(node, message, sourceFile) { + let startIndex; + let endIndex; + if (Array.isArray(node)) { + [startIndex, endIndex] = node; + } + else if (typeof node === 'number') { + startIndex = endIndex = node; + } + else { + sourceFile ??= node.getSourceFile(); + startIndex = node.getStart(sourceFile); + endIndex = node.getEnd(); + } + if (!sourceFile) { + throw new Error('`sourceFile` is required.'); + } + const [start, end] = [startIndex, endIndex].map(offset => { + const { character: column, line } = sourceFile.getLineAndCharacterOfPosition(offset); + return { column, line: line + 1, offset }; + }); + return new TSError(message, sourceFile.fileName, { end, start }); +} +function nodeHasTokens(n, ast) { + // If we have a token or node that has a non-zero width, it must have tokens. + // Note: getWidth() does not take trivia into account. + return n.kind === SyntaxKind.EndOfFileToken + ? !!n.jsDoc + : n.getWidth(ast) !== 0; +} +/** + * Like `forEach`, but suitable for use with numbers and strings (which may be falsy). + */ +function firstDefined(array, callback) { + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + if (array === undefined) { + return undefined; + } + for (let i = 0; i < array.length; i++) { + const result = callback(array[i], i); + // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish + if (result !== undefined) { + return result; + } + } + return undefined; +} +function identifierIsThisKeyword(id) { + return ((isAtLeast50 + ? ts.identifierToKeywordKind(id) + : // @ts-expect-error -- intentional fallback for older TS versions <=4.9 + id.originalKeywordKind) === SyntaxKind.ThisKeyword); +} +function isThisIdentifier(node) { + return (!!node && + node.kind === SyntaxKind.Identifier && + identifierIsThisKeyword(node)); +} +function isThisInTypeQuery(node) { + if (!isThisIdentifier(node)) { + return false; + } + while (ts.isQualifiedName(node.parent) && node.parent.left === node) { + node = node.parent; + } + return node.parent.kind === SyntaxKind.TypeQuery; +} +function isValidAssignmentTarget(node) { + switch (node.kind) { + case SyntaxKind.Identifier: + return true; + case SyntaxKind.PropertyAccessExpression: + case SyntaxKind.ElementAccessExpression: + if (node.flags & ts.NodeFlags.OptionalChain) { + return false; + } + return true; + case SyntaxKind.ParenthesizedExpression: + case SyntaxKind.TypeAssertionExpression: + case SyntaxKind.AsExpression: + case SyntaxKind.SatisfiesExpression: + case SyntaxKind.ExpressionWithTypeArguments: + case SyntaxKind.NonNullExpression: + return isValidAssignmentTarget(node.expression); + default: + return false; + } +} +function getNamespaceModifiers(node) { + // For following nested namespaces, use modifiers given to the topmost namespace + // export declare namespace foo.bar.baz {} + let modifiers = (0, getModifiers_1.getModifiers)(node); + let moduleDeclaration = node; + while ((!modifiers || modifiers.length === 0) && + ts.isModuleDeclaration(moduleDeclaration.parent)) { + const parentModifiers = (0, getModifiers_1.getModifiers)(moduleDeclaration.parent); + if (parentModifiers?.length) { + modifiers = parentModifiers; + } + moduleDeclaration = moduleDeclaration.parent; + } + return modifiers; +} +// `ts.declarationNameToString` +function declarationNameToString(node) { + const text = node.getSourceFile().text.slice(node.pos, node.end).trimStart(); + return text || '(Missing)'; +} +function isPropertyAccessEntityNameExpression(node) { + return (ts.isPropertyAccessExpression(node) && + ts.isIdentifier(node.name) && + isEntityNameExpression(node.expression)); +} +function isEntityNameExpression(node) { + return (node.kind === SyntaxKind.Identifier || + isPropertyAccessEntityNameExpression(node)); +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fabd5437b8c9e54878766e242cf31b833677382e --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.d.ts @@ -0,0 +1,16 @@ +import type { CacheDurationSeconds } from '@typescript-eslint/types'; +export declare const DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = 30; +export interface CacheLike { + get(key: Key): Value | undefined; + set(key: Key, value: Value): this; +} +/** + * A map with key-level expiration. + */ +export declare class ExpiringCache implements CacheLike { + #private; + constructor(cacheDurationSeconds: CacheDurationSeconds); + clear(): void; + get(key: Key): Value | undefined; + set(key: Key, value: Value): this; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js new file mode 100644 index 0000000000000000000000000000000000000000..0571828acd1de1b9959001ec3cf9374d20513cd7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/ExpiringCache.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ExpiringCache = exports.DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = void 0; +exports.DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = 30; +const ZERO_HR_TIME = [0, 0]; +/** + * A map with key-level expiration. + */ +class ExpiringCache { + #cacheDurationSeconds; + #map = new Map(); + constructor(cacheDurationSeconds) { + this.#cacheDurationSeconds = cacheDurationSeconds; + } + clear() { + this.#map.clear(); + } + get(key) { + const entry = this.#map.get(key); + if (entry?.value != null) { + if (this.#cacheDurationSeconds === 'Infinity') { + return entry.value; + } + const ageSeconds = process.hrtime(entry.lastSeen)[0]; + if (ageSeconds < this.#cacheDurationSeconds) { + // cache hit woo! + return entry.value; + } + // key has expired - clean it up to free up memory + this.#map.delete(key); + } + // no hit :'( + return undefined; + } + set(key, value) { + this.#map.set(key, { + lastSeen: this.#cacheDurationSeconds === 'Infinity' + ? // no need to waste time calculating the hrtime in infinity mode as there's no expiry + ZERO_HR_TIME + : process.hrtime(), + value, + }); + return this; + } +} +exports.ExpiringCache = ExpiringCache; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/candidateTSConfigRootDirs.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/candidateTSConfigRootDirs.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6e6e424f33e43bc753fc0b023108667ea82dfde0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/candidateTSConfigRootDirs.d.ts @@ -0,0 +1,3 @@ +export declare function addCandidateTSConfigRootDir(candidate: string): void; +export declare function clearCandidateTSConfigRootDirs(): void; +export declare function getInferredTSConfigRootDir(): string; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/candidateTSConfigRootDirs.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/candidateTSConfigRootDirs.js new file mode 100644 index 0000000000000000000000000000000000000000..db03bbfb6311fb017dd56efbfcf2f86bb51e4ea5 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/candidateTSConfigRootDirs.js @@ -0,0 +1,28 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.addCandidateTSConfigRootDir = addCandidateTSConfigRootDir; +exports.clearCandidateTSConfigRootDirs = clearCandidateTSConfigRootDirs; +exports.getInferredTSConfigRootDir = getInferredTSConfigRootDir; +const candidateTSConfigRootDirs = new Set(); +function addCandidateTSConfigRootDir(candidate) { + candidateTSConfigRootDirs.add(candidate); +} +function clearCandidateTSConfigRootDirs() { + candidateTSConfigRootDirs.clear(); +} +function getInferredTSConfigRootDir() { + const entries = [...candidateTSConfigRootDirs]; + switch (entries.length) { + case 0: + return process.cwd(); + case 1: + return entries[0]; + default: + throw new Error([ + 'No tsconfigRootDir was set, and multiple candidate TSConfigRootDirs are present:', + ...entries.map(candidate => ` - ${candidate}`), + "You'll need to explicitly set tsconfigRootDir in your parser options.", + 'See: https://tseslint.com/parser-tsconfigrootdir', + ].join('\n')); + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fea17ea209424d01d0cb674d2c83fbf9fbdcfca --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.d.ts @@ -0,0 +1,6 @@ +import * as ts from 'typescript'; +import type { TSESTreeOptions } from '../parser-options'; +import type { MutableParseSettings } from './index'; +export declare function createParseSettings(code: string | ts.SourceFile, tsestreeOptions?: Partial): MutableParseSettings; +export declare function clearTSConfigMatchCache(): void; +export declare function clearTSServerProjectService(): void; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js new file mode 100644 index 0000000000000000000000000000000000000000..01091805e57baa3b5f2541ea34f9962b9eb1ff1b --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/createParseSettings.js @@ -0,0 +1,252 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createParseSettings = createParseSettings; +exports.clearTSConfigMatchCache = clearTSConfigMatchCache; +exports.clearTSServerProjectService = clearTSServerProjectService; +const project_service_1 = require("@typescript-eslint/project-service"); +const debug_1 = __importDefault(require("debug")); +const node_path_1 = __importDefault(require("node:path")); +const ts = __importStar(require("typescript")); +const shared_1 = require("../create-program/shared"); +const validateDefaultProjectForFilesGlob_1 = require("../create-program/validateDefaultProjectForFilesGlob"); +const source_files_1 = require("../source-files"); +const candidateTSConfigRootDirs_1 = require("./candidateTSConfigRootDirs"); +const ExpiringCache_1 = require("./ExpiringCache"); +const getProjectConfigFiles_1 = require("./getProjectConfigFiles"); +const inferSingleRun_1 = require("./inferSingleRun"); +const resolveProjectList_1 = require("./resolveProjectList"); +const warnAboutTSVersion_1 = require("./warnAboutTSVersion"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:parseSettings:createParseSettings'); +let TSCONFIG_MATCH_CACHE; +let TSSERVER_PROJECT_SERVICE = null; +// NOTE - we intentionally use "unnecessary" `?.` here because in TS<5.3 this enum doesn't exist +// This object exists so we can centralize these for tracking and so we don't proliferate these across the file +// https://github.com/microsoft/TypeScript/issues/56579 +/* eslint-disable @typescript-eslint/no-unnecessary-condition */ +const JSDocParsingMode = { + ParseAll: ts.JSDocParsingMode?.ParseAll, + ParseForTypeErrors: ts.JSDocParsingMode?.ParseForTypeErrors, + ParseForTypeInfo: ts.JSDocParsingMode?.ParseForTypeInfo, + ParseNone: ts.JSDocParsingMode?.ParseNone, +}; +/* eslint-enable @typescript-eslint/no-unnecessary-condition */ +function createParseSettings(code, tsestreeOptions = {}) { + const codeFullText = enforceCodeString(code); + const singleRun = (0, inferSingleRun_1.inferSingleRun)(tsestreeOptions); + const tsconfigRootDir = (() => { + if (tsestreeOptions.tsconfigRootDir == null) { + const inferredTsconfigRootDir = (0, candidateTSConfigRootDirs_1.getInferredTSConfigRootDir)(); + if (node_path_1.default.resolve(inferredTsconfigRootDir) !== inferredTsconfigRootDir) { + throw new Error(`inferred tsconfigRootDir should be a resolved absolute path, but received: ${JSON.stringify(inferredTsconfigRootDir)}. This is a bug in typescript-eslint! Please report it to us at https://github.com/typescript-eslint/typescript-eslint/issues/new/choose.`); + } + return inferredTsconfigRootDir; + } + if (typeof tsestreeOptions.tsconfigRootDir === 'string') { + const userProvidedTsconfigRootDir = tsestreeOptions.tsconfigRootDir; + if (!node_path_1.default.isAbsolute(userProvidedTsconfigRootDir) || + // Ensure it's fully absolute with a drive letter if windows + (process.platform === 'win32' && + !/^[a-zA-Z]:/.test(userProvidedTsconfigRootDir))) { + throw new Error(`parserOptions.tsconfigRootDir must be an absolute path, but received: ${JSON.stringify(userProvidedTsconfigRootDir)}. This is a bug in your configuration; please supply an absolute path.`); + } + // Deal with any funny business around trailing path separators (a/b/) or relative path segments (/a/b/../c) + // Since we already know it's absolute, we can safely use path.resolve here. + return node_path_1.default.resolve(userProvidedTsconfigRootDir); + } + throw new Error(`If provided, parserOptions.tsconfigRootDir must be a string, but received a value of type "${typeof tsestreeOptions.tsconfigRootDir}"`); + })(); + const passedLoggerFn = typeof tsestreeOptions.loggerFn === 'function'; + const filePath = (0, shared_1.ensureAbsolutePath)(typeof tsestreeOptions.filePath === 'string' && + tsestreeOptions.filePath !== '' + ? tsestreeOptions.filePath + : getFileName(tsestreeOptions.jsx), tsconfigRootDir); + const extension = node_path_1.default.extname(filePath).toLowerCase(); + const jsDocParsingMode = (() => { + switch (tsestreeOptions.jsDocParsingMode) { + case 'all': + return JSDocParsingMode.ParseAll; + case 'none': + return JSDocParsingMode.ParseNone; + case 'type-info': + return JSDocParsingMode.ParseForTypeInfo; + default: + return JSDocParsingMode.ParseAll; + } + })(); + const parseSettings = { + loc: tsestreeOptions.loc === true, + range: tsestreeOptions.range === true, + allowInvalidAST: tsestreeOptions.allowInvalidAST === true, + code, + codeFullText, + comment: tsestreeOptions.comment === true, + comments: [], + debugLevel: tsestreeOptions.debugLevel === true + ? new Set(['typescript-eslint']) + : Array.isArray(tsestreeOptions.debugLevel) + ? new Set(tsestreeOptions.debugLevel) + : new Set(), + errorOnTypeScriptSyntacticAndSemanticIssues: false, + errorOnUnknownASTType: tsestreeOptions.errorOnUnknownASTType === true, + extraFileExtensions: Array.isArray(tsestreeOptions.extraFileExtensions) && + tsestreeOptions.extraFileExtensions.every(ext => typeof ext === 'string') + ? tsestreeOptions.extraFileExtensions + : [], + filePath, + jsDocParsingMode, + jsx: tsestreeOptions.jsx === true, + log: typeof tsestreeOptions.loggerFn === 'function' + ? tsestreeOptions.loggerFn + : tsestreeOptions.loggerFn === false + ? () => { } // eslint-disable-line @typescript-eslint/no-empty-function + : console.log, // eslint-disable-line no-console + preserveNodeMaps: tsestreeOptions.preserveNodeMaps !== false, + programs: Array.isArray(tsestreeOptions.programs) + ? tsestreeOptions.programs + : null, + projects: new Map(), + projectService: tsestreeOptions.projectService || + (tsestreeOptions.project && + tsestreeOptions.projectService !== false && + process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE === 'true') + ? populateProjectService(tsestreeOptions.projectService, { + jsDocParsingMode, + tsconfigRootDir, + }) + : undefined, + setExternalModuleIndicator: tsestreeOptions.sourceType === 'module' || + (tsestreeOptions.sourceType == null && extension === ts.Extension.Mjs) || + (tsestreeOptions.sourceType == null && extension === ts.Extension.Mts) + ? (file) => { + file.externalModuleIndicator = true; + } + : undefined, + singleRun, + suppressDeprecatedPropertyWarnings: tsestreeOptions.suppressDeprecatedPropertyWarnings ?? + process.env.NODE_ENV !== 'test', + tokens: tsestreeOptions.tokens === true ? [] : null, + tsconfigMatchCache: (TSCONFIG_MATCH_CACHE ??= new ExpiringCache_1.ExpiringCache(singleRun + ? 'Infinity' + : (tsestreeOptions.cacheLifetime?.glob ?? + ExpiringCache_1.DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS))), + tsconfigRootDir, + }; + // TODO: Eventually, parse settings will be validated more thoroughly. + // https://github.com/typescript-eslint/typescript-eslint/issues/6403 + if (parseSettings.projectService && + tsestreeOptions.project && + process.env.TYPESCRIPT_ESLINT_IGNORE_PROJECT_AND_PROJECT_SERVICE_ERROR !== + 'true') { + throw new Error('Enabling "project" does nothing when "projectService" is enabled. You can remove the "project" setting.'); + } + // debug doesn't support multiple `enable` calls, so have to do it all at once + if (parseSettings.debugLevel.size > 0) { + const namespaces = []; + if (parseSettings.debugLevel.has('typescript-eslint')) { + namespaces.push('typescript-eslint:*'); + } + if (parseSettings.debugLevel.has('eslint') || + // make sure we don't turn off the eslint debug if it was enabled via --debug + debug_1.default.enabled('eslint:*,-eslint:code-path')) { + // https://github.com/eslint/eslint/blob/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d/bin/eslint.js#L25 + namespaces.push('eslint:*,-eslint:code-path'); + } + debug_1.default.enable(namespaces.join(',')); + } + if (Array.isArray(tsestreeOptions.programs)) { + if (!tsestreeOptions.programs.length) { + throw new Error(`You have set parserOptions.programs to an empty array. This will cause all files to not be found in existing programs. Either provide one or more existing TypeScript Program instances in the array, or remove the parserOptions.programs setting.`); + } + log('parserOptions.programs was provided, so parserOptions.project will be ignored.'); + } + // Providing a program or project service overrides project resolution + if (!parseSettings.programs && !parseSettings.projectService) { + parseSettings.projects = (0, resolveProjectList_1.resolveProjectList)({ + cacheLifetime: tsestreeOptions.cacheLifetime, + project: (0, getProjectConfigFiles_1.getProjectConfigFiles)(parseSettings, tsestreeOptions.project), + projectFolderIgnoreList: tsestreeOptions.projectFolderIgnoreList, + singleRun: parseSettings.singleRun, + tsconfigRootDir, + }); + } + // No type-aware linting which means that cross-file (or even same-file) JSDoc is useless + // So in this specific case we default to 'none' if no value was provided + if (tsestreeOptions.jsDocParsingMode == null && + parseSettings.projects.size === 0 && + parseSettings.programs == null && + parseSettings.projectService == null) { + parseSettings.jsDocParsingMode = JSDocParsingMode.ParseNone; + } + (0, warnAboutTSVersion_1.warnAboutTSVersion)(parseSettings, passedLoggerFn); + return parseSettings; +} +function clearTSConfigMatchCache() { + TSCONFIG_MATCH_CACHE?.clear(); +} +function clearTSServerProjectService() { + TSSERVER_PROJECT_SERVICE = null; +} +/** + * Ensures source code is a string. + */ +function enforceCodeString(code) { + return (0, source_files_1.isSourceFile)(code) + ? code.getFullText(code) + : typeof code === 'string' + ? code + : String(code); +} +/** + * Compute the filename based on the parser options. + * + * Even if jsx option is set in typescript compiler, filename still has to + * contain .tsx file extension. + */ +function getFileName(jsx) { + return jsx ? 'estree.tsx' : 'estree.ts'; +} +function populateProjectService(optionsRaw, settings) { + const options = typeof optionsRaw === 'object' ? optionsRaw : {}; + (0, validateDefaultProjectForFilesGlob_1.validateDefaultProjectForFilesGlob)(options.allowDefaultProject); + TSSERVER_PROJECT_SERVICE ??= (0, project_service_1.createProjectService)({ + options, + ...settings, + }); + return TSSERVER_PROJECT_SERVICE; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..19a370cc0d55c4fa569bee08952cd4a44d0db86d --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.d.ts @@ -0,0 +1,12 @@ +import type { TSESTreeOptions } from '../parser-options'; +import type { ParseSettings } from './index'; +/** + * Checks for a matching TSConfig to a file including its parent directories, + * permanently caching results under each directory it checks. + * + * @remarks + * We don't (yet!) have a way to attach file watchers on disk, but still need to + * cache file checks for rapid subsequent calls to fs.existsSync. See discussion + * in https://github.com/typescript-eslint/typescript-eslint/issues/101. + */ +export declare function getProjectConfigFiles(parseSettings: Pick, project: TSESTreeOptions['project']): string[] | null; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js new file mode 100644 index 0000000000000000000000000000000000000000..f487c7375d331ca64c5bb72ddd5b709640dedd19 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/getProjectConfigFiles.js @@ -0,0 +1,82 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getProjectConfigFiles = getProjectConfigFiles; +const debug_1 = __importDefault(require("debug")); +const fs = __importStar(require("node:fs")); +const path = __importStar(require("node:path")); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:parseSettings:getProjectConfigFiles'); +/** + * Checks for a matching TSConfig to a file including its parent directories, + * permanently caching results under each directory it checks. + * + * @remarks + * We don't (yet!) have a way to attach file watchers on disk, but still need to + * cache file checks for rapid subsequent calls to fs.existsSync. See discussion + * in https://github.com/typescript-eslint/typescript-eslint/issues/101. + */ +function getProjectConfigFiles(parseSettings, project) { + if (project !== true) { + if (project == null || project === false) { + return null; + } + if (Array.isArray(project)) { + return project; + } + return [project]; + } + log('Looking for tsconfig.json at or above file: %s', parseSettings.filePath); + let directory = path.dirname(parseSettings.filePath); + const checkedDirectories = [directory]; + do { + log('Checking tsconfig.json path: %s', directory); + const tsconfigPath = path.join(directory, 'tsconfig.json'); + const cached = parseSettings.tsconfigMatchCache.get(directory) ?? + (fs.existsSync(tsconfigPath) && tsconfigPath); + if (cached) { + for (const directory of checkedDirectories) { + parseSettings.tsconfigMatchCache.set(directory, cached); + } + return [cached]; + } + directory = path.dirname(directory); + checkedDirectories.push(directory); + } while (directory.length > 1 && + directory.length >= parseSettings.tsconfigRootDir.length); + throw new Error(`project was set to \`true\` but couldn't find any tsconfig.json relative to '${parseSettings.filePath}' within '${parseSettings.tsconfigRootDir}'.`); +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c9966d39365cb20c106ab70c918dfb9f7c9cd869 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts @@ -0,0 +1,126 @@ +import type { ProjectServiceAndMetadata } from '@typescript-eslint/project-service'; +import type * as ts from 'typescript'; +import type { CanonicalPath } from '../create-program/shared'; +import type { TSESTree } from '../ts-estree'; +import type { CacheLike } from './ExpiringCache'; +type DebugModule = 'eslint' | 'typescript' | 'typescript-eslint'; +declare module 'typescript' { + enum JSDocParsingMode { + } +} +declare module 'typescript/lib/tsserverlibrary' { + enum JSDocParsingMode { + } +} +/** + * Internal settings used by the parser to run on a file. + */ +export interface MutableParseSettings { + /** + * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript. + */ + allowInvalidAST: boolean; + /** + * Code of the file being parsed, or raw source file containing it. + */ + code: string | ts.SourceFile; + /** + * Full text of the file being parsed. + */ + codeFullText: string; + /** + * Whether the `comment` parse option is enabled. + */ + comment: boolean; + /** + * If the `comment` parse option is enabled, retrieved comments. + */ + comments: TSESTree.Comment[]; + /** + * Which debug areas should be logged. + */ + debugLevel: Set; + /** + * Whether to error if TypeScript reports a semantic or syntactic error diagnostic. + */ + errorOnTypeScriptSyntacticAndSemanticIssues: boolean; + /** + * Whether to error if an unknown AST node type is encountered. + */ + errorOnUnknownASTType: boolean; + /** + * Any non-standard file extensions which will be parsed. + */ + extraFileExtensions: string[]; + /** + * Path of the file being parsed. + */ + filePath: string; + /** + * Sets the external module indicator on the source file. + * Used by Typescript to determine if a sourceFile is an external module. + * + * needed to always parsing `mjs`/`mts` files as ESM + */ + setExternalModuleIndicator?: (file: ts.SourceFile) => void; + /** + * JSDoc parsing style to pass through to TypeScript + */ + jsDocParsingMode: ts.JSDocParsingMode; + /** + * Whether parsing of JSX is enabled. + * + * @remarks The applicable file extension is still required. + */ + jsx: boolean; + /** + * Whether to add `loc` information to each node. + */ + loc: boolean; + /** + * Log function, if not `console.log`. + */ + log: (message: string) => void; + /** + * Whether two-way AST node maps are preserved during the AST conversion process. + */ + preserveNodeMaps?: boolean; + /** + * One or more instances of TypeScript Program objects to be used for type information. + */ + programs: Iterable | null; + /** + * Normalized paths to provided project paths. + */ + projects: ReadonlyMap; + /** + * TypeScript server to power program creation. + */ + projectService: ProjectServiceAndMetadata | undefined; + /** + * Whether to add the `range` property to AST nodes. + */ + range: boolean; + /** + * Whether this is part of a single run, rather than a long-running process. + */ + singleRun: boolean; + /** + * Whether deprecated AST properties should skip calling console.warn on accesses. + */ + suppressDeprecatedPropertyWarnings: boolean; + /** + * If the `tokens` parse option is enabled, retrieved tokens. + */ + tokens: TSESTree.Token[] | null; + /** + * Caches searches for TSConfigs from project directories. + */ + tsconfigMatchCache: CacheLike; + /** + * The absolute path to the root directory for all provided `project`s. + */ + tsconfigRootDir: string; +} +export type ParseSettings = Readonly; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2998abb996cfd1a4d46bd92bfee41545d52bc6f7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.d.ts @@ -0,0 +1,14 @@ +import type { TSESTreeOptions } from '../parser-options'; +/** + * ESLint (and therefore typescript-eslint) is used in both "single run"/one-time contexts, + * such as an ESLint CLI invocation, and long-running sessions (such as continuous feedback + * on a file in an IDE). + * + * When typescript-eslint handles TypeScript Program management behind the scenes, this distinction + * is important because there is significant overhead to managing the so called Watch Programs + * needed for the long-running use-case. We therefore use the following logic to figure out which + * of these contexts applies to the current execution. + * + * @returns Whether this is part of a single run, rather than a long-running process. + */ +export declare function inferSingleRun(options: TSESTreeOptions | undefined): boolean; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js new file mode 100644 index 0000000000000000000000000000000000000000..308ef677c93c19ab730d9d3641264418f7f14d06 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/inferSingleRun.js @@ -0,0 +1,62 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.inferSingleRun = inferSingleRun; +const node_path_1 = __importDefault(require("node:path")); +/** + * ESLint (and therefore typescript-eslint) is used in both "single run"/one-time contexts, + * such as an ESLint CLI invocation, and long-running sessions (such as continuous feedback + * on a file in an IDE). + * + * When typescript-eslint handles TypeScript Program management behind the scenes, this distinction + * is important because there is significant overhead to managing the so called Watch Programs + * needed for the long-running use-case. We therefore use the following logic to figure out which + * of these contexts applies to the current execution. + * + * @returns Whether this is part of a single run, rather than a long-running process. + */ +function inferSingleRun(options) { + // https://github.com/typescript-eslint/typescript-eslint/issues/9504 + // There's no support (yet?) for extraFileExtensions in single-run hosts. + // Only watch program hosts and project service can support that. + if (options?.extraFileExtensions?.length && options.project) { + return false; + } + if ( + // single-run implies type-aware linting - no projects means we can't be in single-run mode + (options?.project == null && !options?.projectService) || + // programs passed via options means the user should be managing the programs, so we shouldn't + // be creating our own single-run programs accidentally + options.programs != null) { + return false; + } + // Allow users to explicitly inform us of their intent to perform a single run (or not) with TSESTREE_SINGLE_RUN + if (process.env.TSESTREE_SINGLE_RUN === 'false') { + return false; + } + if (process.env.TSESTREE_SINGLE_RUN === 'true') { + return true; + } + // Ideally, we'd like to try to auto-detect CI or CLI usage that lets us infer a single CLI run. + if (!options.disallowAutomaticSingleRunInference) { + const possibleEslintBinPaths = [ + 'node_modules/.bin/eslint', // npm or yarn repo + 'node_modules/eslint/bin/eslint.js', // pnpm repo + ]; + if ( + // Default to single runs for CI processes. CI=true is set by most CI providers by default. + process.env.CI === 'true' || + // This will be true for invocations such as `npx eslint ...` and `./node_modules/.bin/eslint ...` + possibleEslintBinPaths.some(binPath => process.argv.length > 1 && + process.argv[1].endsWith(node_path_1.default.normalize(binPath)))) { + return !process.argv.includes('--fix'); + } + } + /** + * Unless we can reliably infer otherwise, we default to assuming that this run could be part + * of a long-running session (e.g. in an IDE) and watch programs will therefore be required + */ + return false; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..62847beca449a36b9350ba6496f90edf3ca915b4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.d.ts @@ -0,0 +1,18 @@ +import type { CanonicalPath } from '../create-program/shared'; +import type { TSESTreeOptions } from '../parser-options'; +export declare function clearGlobCache(): void; +/** + * Normalizes, sanitizes, resolves and filters the provided project paths + */ +export declare function resolveProjectList(options: Readonly<{ + cacheLifetime?: TSESTreeOptions['cacheLifetime']; + project: string[] | null; + projectFolderIgnoreList: TSESTreeOptions['projectFolderIgnoreList']; + singleRun: boolean; + tsconfigRootDir: string; +}>): ReadonlyMap; +/** + * Exported for testing purposes only + * @internal + */ +export declare function clearGlobResolutionCache(): void; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js new file mode 100644 index 0000000000000000000000000000000000000000..53d2ec1d0ebc4bb0258cf4bde6393600f5c94681 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/resolveProjectList.js @@ -0,0 +1,95 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clearGlobCache = clearGlobCache; +exports.resolveProjectList = resolveProjectList; +exports.clearGlobResolutionCache = clearGlobResolutionCache; +const debug_1 = __importDefault(require("debug")); +const tinyglobby_1 = require("tinyglobby"); +const shared_1 = require("../create-program/shared"); +const ExpiringCache_1 = require("./ExpiringCache"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:parseSettings:resolveProjectList'); +let RESOLUTION_CACHE = null; +function clearGlobCache() { + RESOLUTION_CACHE?.clear(); +} +/** + * Normalizes, sanitizes, resolves and filters the provided project paths + */ +function resolveProjectList(options) { + const sanitizedProjects = []; + // Normalize and sanitize the project paths + if (options.project != null) { + for (const project of options.project) { + if (typeof project === 'string') { + sanitizedProjects.push(project); + } + } + } + if (sanitizedProjects.length === 0) { + return new Map(); + } + const projectFolderIgnoreList = (options.projectFolderIgnoreList ?? ['**/node_modules/**']).filter(folder => typeof folder === 'string'); + const cacheKey = getHash({ + project: sanitizedProjects, + projectFolderIgnoreList, + tsconfigRootDir: options.tsconfigRootDir, + }); + if (RESOLUTION_CACHE == null) { + // note - we initialize the global cache based on the first config we encounter. + // this does mean that you can't have multiple lifetimes set per folder + // I doubt that anyone will really bother reconfiguring this, let alone + // try to do complicated setups, so we'll deal with this later if ever. + RESOLUTION_CACHE = new ExpiringCache_1.ExpiringCache(options.singleRun + ? 'Infinity' + : (options.cacheLifetime?.glob ?? + ExpiringCache_1.DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS)); + } + else { + const cached = RESOLUTION_CACHE.get(cacheKey); + if (cached) { + return cached; + } + } + // Transform glob patterns into paths + const nonGlobProjects = sanitizedProjects.filter(project => !(0, tinyglobby_1.isDynamicPattern)(project)); + const globProjects = sanitizedProjects.filter(project => (0, tinyglobby_1.isDynamicPattern)(project)); + let globProjectPaths = []; + if (globProjects.length > 0) { + // To ensure the order is correct, we need to glob for each pattern + // separately and then concatenate the results in patterns' order. + globProjectPaths = globProjects.flatMap(pattern => (0, tinyglobby_1.globSync)(pattern, { + cwd: options.tsconfigRootDir, + expandDirectories: false, + ignore: projectFolderIgnoreList, + })); + } + const uniqueCanonicalProjectPaths = new Map([...nonGlobProjects, ...globProjectPaths].map(project => [ + (0, shared_1.getCanonicalFileName)((0, shared_1.ensureAbsolutePath)(project, options.tsconfigRootDir)), + (0, shared_1.ensureAbsolutePath)(project, options.tsconfigRootDir), + ])); + log('parserOptions.project (excluding ignored) matched projects: %s', uniqueCanonicalProjectPaths); + RESOLUTION_CACHE.set(cacheKey, uniqueCanonicalProjectPaths); + return uniqueCanonicalProjectPaths; +} +function getHash({ project, projectFolderIgnoreList, tsconfigRootDir, }) { + // create a stable representation of the config + const hashObject = { + tsconfigRootDir, + // the project order does matter and can impact the resolved globs + project, + // the ignore order won't doesn't ever matter + projectFolderIgnoreList: [...projectFolderIgnoreList].sort(), + }; + return (0, shared_1.createHash)(JSON.stringify(hashObject)); +} +/** + * Exported for testing purposes only + * @internal + */ +function clearGlobResolutionCache() { + RESOLUTION_CACHE?.clear(); + RESOLUTION_CACHE = null; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2928c42cb0cdc617a389f7484cffc551300d0450 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.d.ts @@ -0,0 +1,6 @@ +import type { ParseSettings } from './index'; +/** + * This needs to be kept in sync with package.json in the typescript-eslint monorepo + */ +export declare const SUPPORTED_TYPESCRIPT_VERSIONS = ">=4.8.4 <6.1.0"; +export declare function warnAboutTSVersion(parseSettings: ParseSettings, passedLoggerFn: boolean): void; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js new file mode 100644 index 0000000000000000000000000000000000000000..7a133e88641bb90d921fb2c6560bf52b6813d9f6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/warnAboutTSVersion.js @@ -0,0 +1,81 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SUPPORTED_TYPESCRIPT_VERSIONS = void 0; +exports.warnAboutTSVersion = warnAboutTSVersion; +const semver_1 = __importDefault(require("semver")); +const ts = __importStar(require("typescript")); +const version_1 = require("../version"); +/** + * This needs to be kept in sync with package.json in the typescript-eslint monorepo + */ +exports.SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.8.4 <6.1.0'; +/* + * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one + * List them all separately here, so we can automatically create the full string + */ +const SUPPORTED_PRERELEASE_RANGES = []; +const ACTIVE_TYPESCRIPT_VERSION = ts.version; +const isRunningSupportedTypeScriptVersion = semver_1.default.satisfies(ACTIVE_TYPESCRIPT_VERSION, [exports.SUPPORTED_TYPESCRIPT_VERSIONS, ...SUPPORTED_PRERELEASE_RANGES].join(' || ')); +let warnedAboutTSVersion = false; +function warnAboutTSVersion(parseSettings, passedLoggerFn) { + if (isRunningSupportedTypeScriptVersion || warnedAboutTSVersion) { + return; + } + if (passedLoggerFn || + // See https://github.com/typescript-eslint/typescript-eslint/issues/7896 + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + (typeof process === 'undefined' ? false : process.stdout?.isTTY)) { + const border = '============='; + const versionWarning = [ + border, + '\n', + 'WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.', + '\n', + `* @typescript-eslint/typescript-estree version: ${version_1.version}`, + `* Supported TypeScript versions: ${exports.SUPPORTED_TYPESCRIPT_VERSIONS}`, + `* Your TypeScript version: ${ACTIVE_TYPESCRIPT_VERSION}`, + '\n', + 'Please only submit bug reports when using the officially supported version.', + '\n', + border, + ].join('\n'); + parseSettings.log(versionWarning); + } + warnedAboutTSVersion = true; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..82a17a53fa7981555307ffca1e5fceca279b7049 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.d.ts @@ -0,0 +1,210 @@ +import type { CacheDurationSeconds, DebugLevel, JSDocParsingMode, ProjectServiceOptions, SourceType } from '@typescript-eslint/types'; +import type * as ts from 'typescript'; +import type { TSESTree, TSESTreeToTSNode, TSNode, TSToken } from './ts-estree'; +interface ParseOptions { + /** + * Specify the `sourceType`. + * For more details, see https://github.com/typescript-eslint/typescript-eslint/pull/9121 + */ + sourceType?: SourceType; + /** + * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript. + * This case only usually occurs when attempting to lint invalid code. + */ + allowInvalidAST?: boolean; + /** + * create a top-level comments array containing all comments + */ + comment?: boolean; + /** + * An array of modules to turn explicit debugging on for. + * - 'typescript-eslint' is the same as setting the env var `DEBUG=typescript-eslint:*` + * - 'eslint' is the same as setting the env var `DEBUG=eslint:*` + * - 'typescript' is the same as setting `extendedDiagnostics: true` in your tsconfig compilerOptions + * + * For convenience, also supports a boolean: + * - true === ['typescript-eslint'] + * - false === [] + */ + debugLevel?: DebugLevel; + /** + * Cause the parser to error if it encounters an unknown AST node type (useful for testing). + * This case only usually occurs when TypeScript releases new features. + */ + errorOnUnknownASTType?: boolean; + /** + * Absolute (or relative to `cwd`) path to the file being parsed. + */ + filePath?: string; + /** + * If you are using TypeScript version >=5.3 then this option can be used as a performance optimization. + * + * The valid values for this rule are: + * - `'all'` - parse all JSDoc comments, always. + * - `'none'` - parse no JSDoc comments, ever. + * - `'type-info'` - parse just JSDoc comments that are required to provide correct type-info. TS will always parse JSDoc in non-TS files, but never in TS files. + * + * If you do not rely on JSDoc tags from the TypeScript AST, then you can safely set this to `'none'` to improve performance. + */ + jsDocParsingMode?: JSDocParsingMode; + /** + * Enable parsing of JSX. + * For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html + * + * NOTE: this setting does not effect known file types (.js, .cjs, .mjs, .jsx, .ts, .mts, .cts, .tsx, .json) because the + * TypeScript compiler has its own internal handling for known file extensions. + * + * For the exact behavior, see https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser#parseroptionsecmafeaturesjsx + */ + jsx?: boolean; + /** + * Controls whether the `loc` information to each node. + * The `loc` property is an object which contains the exact line/column the node starts/ends on. + * This is similar to the `range` property, except it is line/column relative. + */ + loc?: boolean; + loggerFn?: ((message: string) => void) | false; + /** + * Controls whether the `range` property is included on AST nodes. + * The `range` property is a [number, number] which indicates the start/end index of the node in the file contents. + * This is similar to the `loc` property, except this is the absolute index. + */ + range?: boolean; + /** + * Set to true to create a top-level array containing all tokens from the file. + */ + tokens?: boolean; + /** + * Whether deprecated AST properties should skip calling console.warn on accesses. + */ + suppressDeprecatedPropertyWarnings?: boolean; +} +interface ParseAndGenerateServicesOptions extends ParseOptions { + /** + * Granular control of the expiry lifetime of our internal caches. + * You can specify the number of seconds as an integer number, or the string + * 'Infinity' if you never want the cache to expire. + * + * By default cache entries will be evicted after 30 seconds, or will persist + * indefinitely if `disallowAutomaticSingleRunInference = false` AND the parser + * infers that it is a single run. + */ + cacheLifetime?: { + /** + * Glob resolution for `parserOptions.project` values. + */ + glob?: CacheDurationSeconds; + }; + /** + * ESLint (and therefore typescript-eslint) is used in both "single run"/one-time contexts, + * such as an ESLint CLI invocation, and long-running sessions (such as continuous feedback + * on a file in an IDE). + * + * When typescript-eslint handles TypeScript Program management behind the scenes, this distinction + * is important because there is significant overhead to managing the so called Watch Programs + * needed for the long-running use-case. + * + * By default, we will use common heuristics to infer whether ESLint is being + * used as part of a single run. This option disables those heuristics, and + * therefore the performance optimizations gained by them. + * + * In other words, typescript-eslint is faster by default, and this option + * disables an automatic performance optimization. + * + * This setting's default value can be specified by setting a `TSESTREE_SINGLE_RUN` + * environment variable to `"false"` or `"true"`. + * Otherwise, the default value is `false`. + */ + disallowAutomaticSingleRunInference?: boolean; + /** + * Causes the parser to error if the TypeScript compiler returns any unexpected syntax/semantic errors. + */ + errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; + /** + * When `project` is provided, this controls the non-standard file extensions which will be parsed. + * It accepts an array of file extensions, each preceded by a `.`. + * + * NOTE: When used with {@link projectService}, full project reloads may occur. + */ + extraFileExtensions?: string[]; + /** + * Absolute (or relative to `tsconfigRootDir`) path to the file being parsed. + * When `project` is provided, this is required, as it is used to fetch the file from the TypeScript compiler's cache. + */ + filePath?: string; + /** + * Allows the user to control whether or not two-way AST node maps are preserved + * during the AST conversion process. + * + * By default: the AST node maps are NOT preserved, unless `project` has been specified, + * in which case the maps are made available on the returned `parserServices`. + * + * NOTE: If `preserveNodeMaps` is explicitly set by the user, it will be respected, + * regardless of whether or not `project` is in use. + */ + preserveNodeMaps?: boolean; + /** + * Absolute (or relative to `tsconfigRootDir`) paths to the tsconfig(s), + * or `true` to find the nearest tsconfig.json to the file. + * If this is provided, type information will be returned. + * + * If set to `false`, `null` or `undefined` type information will not be returned. + * + * Note that {@link projectService} is now preferred. + */ + project?: boolean | string | string[] | null; + /** + * If you provide a glob (or globs) to the project option, you can use this option to ignore certain folders from + * being matched by the globs. + * This accepts an array of globs to ignore. + * + * By default, this is set to ["**\/node_modules/**"] + */ + projectFolderIgnoreList?: string[]; + /** + * Whether to create a shared TypeScript project service to power program creation. + */ + projectService?: boolean | ProjectServiceOptions; + /** + * The absolute path to the root directory for all provided `project`s. + */ + tsconfigRootDir?: string; + /** + * An array of one or more instances of TypeScript Program objects to be used for type information. + * This overrides any program or programs that would have been computed from the `project` option. + * All linted files must be part of the provided program(s). + */ + programs?: ts.Program[] | null; +} +export type TSESTreeOptions = ParseAndGenerateServicesOptions; +export interface ParserWeakMap { + get(key: Key): Value; + has(key: unknown): boolean; +} +export interface ParserWeakMapESTreeToTSNode { + get(key: KeyBase): TSESTreeToTSNode; + has(key: unknown): boolean; +} +export interface ParserServicesBase { + emitDecoratorMetadata: boolean | undefined; + experimentalDecorators: boolean | undefined; + isolatedDeclarations: boolean | undefined; +} +export interface ParserServicesNodeMaps { + esTreeNodeToTSNodeMap: ParserWeakMapESTreeToTSNode; + tsNodeToESTreeNodeMap: ParserWeakMap; +} +export interface ParserServicesWithTypeInformation extends ParserServicesNodeMaps, ParserServicesBase { + getSymbolAtLocation: (node: TSESTree.Node) => ts.Symbol | undefined; + getTypeAtLocation: (node: TSESTree.Node) => ts.Type; + getContextualType: (node: TSESTree.Expression) => ts.Type | undefined; + getResolvedSignature: (node: TSESTree.CallExpression | TSESTree.NewExpression) => ts.Signature | undefined; + getTypeFromTypeNode: (node: TSESTree.TypeNode) => ts.Type; + getTypeOfSymbolAtLocation: (symbol: ts.Symbol, node: TSESTree.Node) => ts.Type; + program: ts.Program; +} +export interface ParserServicesWithoutTypeInformation extends ParserServicesNodeMaps, ParserServicesBase { + program: null; +} +export type ParserServices = ParserServicesWithoutTypeInformation | ParserServicesWithTypeInformation; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser-options.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e881e4e368aca7c7ae93a53c868020a3e1ee3e2a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser.d.ts @@ -0,0 +1,17 @@ +import type * as ts from 'typescript'; +import type { ParserServices, TSESTreeOptions } from './parser-options'; +import type { TSESTree } from './ts-estree'; +export declare function clearProgramCache(): void; +export declare function clearDefaultProjectMatchedFiles(): void; +export type AST = (T['comment'] extends true ? { + comments: TSESTree.Comment[]; +} : {}) & (T['tokens'] extends true ? { + tokens: TSESTree.Token[]; +} : {}) & TSESTree.Program; +export interface ParseAndGenerateServicesResult { + ast: AST; + services: ParserServices; +} +export declare function parse(code: string, options?: T): AST; +export declare function clearParseAndGenerateServicesCalls(): void; +export declare function parseAndGenerateServices(code: string | ts.SourceFile, tsestreeOptions: T): ParseAndGenerateServicesResult; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser.js new file mode 100644 index 0000000000000000000000000000000000000000..ae120a02f4cb6579375acb4450be6ce98bdd6982 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/parser.js @@ -0,0 +1,184 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.clearProgramCache = clearProgramCache; +exports.clearDefaultProjectMatchedFiles = clearDefaultProjectMatchedFiles; +exports.parse = parse; +exports.clearParseAndGenerateServicesCalls = clearParseAndGenerateServicesCalls; +exports.parseAndGenerateServices = parseAndGenerateServices; +const debug_1 = __importDefault(require("debug")); +const ast_converter_1 = require("./ast-converter"); +const convert_1 = require("./convert"); +const createIsolatedProgram_1 = require("./create-program/createIsolatedProgram"); +const createProjectProgram_1 = require("./create-program/createProjectProgram"); +const createSourceFile_1 = require("./create-program/createSourceFile"); +const getWatchProgramsForProjects_1 = require("./create-program/getWatchProgramsForProjects"); +const useProvidedPrograms_1 = require("./create-program/useProvidedPrograms"); +const createParserServices_1 = require("./createParserServices"); +const createParseSettings_1 = require("./parseSettings/createParseSettings"); +const semantic_or_syntactic_errors_1 = require("./semantic-or-syntactic-errors"); +const useProgramFromProjectService_1 = require("./useProgramFromProjectService"); +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:parser'); +/** + * Cache existing programs for the single run use-case. + * + * clearProgramCache() is only intended to be used in testing to ensure the parser is clean between tests. + */ +const existingPrograms = new Map(); +function clearProgramCache() { + existingPrograms.clear(); +} +const defaultProjectMatchedFiles = new Set(); +function clearDefaultProjectMatchedFiles() { + defaultProjectMatchedFiles.clear(); +} +/** + * @param parseSettings Internal settings for parsing the file + * @param hasFullTypeInformation True if the program should be attempted to be calculated from provided tsconfig files + * @returns Returns a source file and program corresponding to the linted code + */ +function getProgramAndAST(parseSettings, hasFullTypeInformation) { + if (parseSettings.projectService) { + const fromProjectService = (0, useProgramFromProjectService_1.useProgramFromProjectService)(parseSettings.projectService, parseSettings, hasFullTypeInformation, defaultProjectMatchedFiles); + if (fromProjectService) { + return fromProjectService; + } + } + if (parseSettings.programs) { + return (0, useProvidedPrograms_1.useProvidedPrograms)(parseSettings.programs, parseSettings); + } + // no need to waste time creating a program as the caller didn't want parser services + // so we can save time and just create a lonesome source file + if (!hasFullTypeInformation) { + return (0, createSourceFile_1.createNoProgram)(parseSettings); + } + return (0, createProjectProgram_1.createProjectProgram)(parseSettings, (0, getWatchProgramsForProjects_1.getWatchProgramsForProjects)(parseSettings)); +} +function parse(code, options) { + const { ast } = parseWithNodeMapsInternal(code, options, false); + return ast; +} +function parseWithNodeMapsInternal(code, options, shouldPreserveNodeMaps) { + /** + * Reset the parse configuration + */ + const parseSettings = (0, createParseSettings_1.createParseSettings)(code, options); + /** + * Ensure users do not attempt to use parse() when they need parseAndGenerateServices() + */ + if (options?.errorOnTypeScriptSyntacticAndSemanticIssues) { + throw new Error(`"errorOnTypeScriptSyntacticAndSemanticIssues" is only supported for parseAndGenerateServices()`); + } + /** + * Create a ts.SourceFile directly, no ts.Program is needed for a simple parse + */ + const ast = (0, createSourceFile_1.createSourceFile)(parseSettings); + /** + * Convert the TypeScript AST to an ESTree-compatible one + */ + const { astMaps, estree } = (0, ast_converter_1.astConverter)(ast, parseSettings, shouldPreserveNodeMaps); + return { + ast: estree, + esTreeNodeToTSNodeMap: astMaps.esTreeNodeToTSNodeMap, + tsNodeToESTreeNodeMap: astMaps.tsNodeToESTreeNodeMap, + }; +} +let parseAndGenerateServicesCalls = {}; +// Privately exported utility intended for use in typescript-eslint unit tests only +function clearParseAndGenerateServicesCalls() { + parseAndGenerateServicesCalls = {}; +} +function parseAndGenerateServices(code, tsestreeOptions) { + /** + * Reset the parse configuration + */ + const parseSettings = (0, createParseSettings_1.createParseSettings)(code, tsestreeOptions); + /** + * If this is a single run in which the user has not provided any existing programs but there + * are programs which need to be created from the provided "project" option, + * create an Iterable which will lazily create the programs as needed by the iteration logic + */ + if (parseSettings.singleRun && + !parseSettings.programs && + parseSettings.projects.size > 0) { + parseSettings.programs = { + *[Symbol.iterator]() { + for (const configFile of parseSettings.projects) { + const existingProgram = existingPrograms.get(configFile[0]); + if (existingProgram) { + yield existingProgram; + } + else { + log('Detected single-run/CLI usage, creating Program once ahead of time for project: %s', configFile); + const newProgram = (0, useProvidedPrograms_1.createProgramFromConfigFile)(configFile[1]); + existingPrograms.set(configFile[0], newProgram); + yield newProgram; + } + } + }, + }; + } + const hasFullTypeInformation = parseSettings.programs != null || + parseSettings.projects.size > 0 || + !!parseSettings.projectService; + if (typeof tsestreeOptions.errorOnTypeScriptSyntacticAndSemanticIssues === + 'boolean' && + tsestreeOptions.errorOnTypeScriptSyntacticAndSemanticIssues) { + parseSettings.errorOnTypeScriptSyntacticAndSemanticIssues = true; + } + if (parseSettings.errorOnTypeScriptSyntacticAndSemanticIssues && + !hasFullTypeInformation) { + throw new Error('Cannot calculate TypeScript semantic issues without a valid project.'); + } + /** + * If we are in singleRun mode but the parseAndGenerateServices() function has been called more than once for the current file, + * it must mean that we are in the middle of an ESLint automated fix cycle (in which parsing can be performed up to an additional + * 10 times in order to apply all possible fixes for the file). + * + * In this scenario we cannot rely upon the singleRun AOT compiled programs because the SourceFiles will not contain the source + * with the latest fixes applied. Therefore we fallback to creating the quickest possible isolated program from the updated source. + * + * Note: This fallback is only needed for the legacy `project` option which uses AOT compiled programs. + * When `projectService` is used, the TypeScript language service always provides up-to-date programs, + * so no fallback is necessary. Additionally, external parsers like vue-eslint-parser may call + * parseAndGenerateServices() multiple times for the same file in a single lint pass, which would + * incorrectly trigger this fallback. + */ + if (parseSettings.singleRun && tsestreeOptions.filePath) { + parseAndGenerateServicesCalls[tsestreeOptions.filePath] = + (parseAndGenerateServicesCalls[tsestreeOptions.filePath] || 0) + 1; + } + const { ast, program } = parseSettings.singleRun && + tsestreeOptions.filePath && + parseAndGenerateServicesCalls[tsestreeOptions.filePath] > 1 && + !parseSettings.projectService + ? (0, createIsolatedProgram_1.createIsolatedProgram)(parseSettings) + : getProgramAndAST(parseSettings, hasFullTypeInformation); + /** + * Convert the TypeScript AST to an ESTree-compatible one, and optionally preserve + * mappings between converted and original AST nodes + */ + const shouldPreserveNodeMaps = typeof parseSettings.preserveNodeMaps === 'boolean' + ? parseSettings.preserveNodeMaps + : true; + const { astMaps, estree } = (0, ast_converter_1.astConverter)(ast, parseSettings, shouldPreserveNodeMaps); + /** + * Even if TypeScript parsed the source code ok, and we had no problems converting the AST, + * there may be other syntactic or semantic issues in the code that we can optionally report on. + */ + if (program && parseSettings.errorOnTypeScriptSyntacticAndSemanticIssues) { + const error = (0, semantic_or_syntactic_errors_1.getFirstSemanticOrSyntacticError)(program, ast); + if (error) { + throw (0, convert_1.convertError)(error); + } + } + /** + * Return the converted AST and additional parser services + */ + return { + ast: estree, + services: (0, createParserServices_1.createParserServices)(astMaps, program), + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e1211617d7b9185759bcabd19493c792c7a40cca --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.d.ts @@ -0,0 +1,12 @@ +import type { Diagnostic, Program, SourceFile } from 'typescript'; +export interface SemanticOrSyntacticError extends Diagnostic { + message: string; +} +/** + * By default, diagnostics from the TypeScript compiler contain all errors - regardless of whether + * they are related to generic ECMAScript standards, or TypeScript-specific constructs. + * + * Therefore, we filter out all diagnostics, except for the ones we explicitly want to consider when + * the user opts in to throwing errors on semantic issues. + */ +export declare function getFirstSemanticOrSyntacticError(program: Program, ast: SourceFile): SemanticOrSyntacticError | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js new file mode 100644 index 0000000000000000000000000000000000000000..5e77d97c373423674c5a74223795cdeff57b1e99 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/semantic-or-syntactic-errors.js @@ -0,0 +1,94 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getFirstSemanticOrSyntacticError = getFirstSemanticOrSyntacticError; +const typescript_1 = require("typescript"); +/** + * By default, diagnostics from the TypeScript compiler contain all errors - regardless of whether + * they are related to generic ECMAScript standards, or TypeScript-specific constructs. + * + * Therefore, we filter out all diagnostics, except for the ones we explicitly want to consider when + * the user opts in to throwing errors on semantic issues. + */ +function getFirstSemanticOrSyntacticError(program, ast) { + try { + const supportedSyntacticDiagnostics = allowlistSupportedDiagnostics(program.getSyntacticDiagnostics(ast)); + if (supportedSyntacticDiagnostics.length > 0) { + return convertDiagnosticToSemanticOrSyntacticError(supportedSyntacticDiagnostics[0]); + } + const supportedSemanticDiagnostics = allowlistSupportedDiagnostics(program.getSemanticDiagnostics(ast)); + if (supportedSemanticDiagnostics.length > 0) { + return convertDiagnosticToSemanticOrSyntacticError(supportedSemanticDiagnostics[0]); + } + return undefined; + } + catch (e) { + /** + * TypeScript compiler has certain Debug.fail() statements in, which will cause the diagnostics + * retrieval above to throw. + * + * E.g. from ast-alignment-tests + * "Debug Failure. Shouldn't ever directly check a JsxOpeningElement" + * + * For our current use-cases this is undesired behavior, so we just suppress it + * and log a warning. + */ + /* istanbul ignore next */ + console.warn(`Warning From TSC: "${e.message}`); // eslint-disable-line no-console + /* istanbul ignore next */ + return undefined; + } +} +function allowlistSupportedDiagnostics(diagnostics) { + return diagnostics.filter(diagnostic => { + switch (diagnostic.code) { + case 1013: // "A rest parameter or binding pattern may not have a trailing comma." + case 1014: // "A rest parameter must be last in a parameter list." + case 1044: // "'{0}' modifier cannot appear on a module or namespace element." + case 1045: // "A '{0}' modifier cannot be used with an interface declaration." + case 1048: // "A rest parameter cannot have an initializer." + case 1049: // "A 'set' accessor must have exactly one parameter." + case 1070: // "'{0}' modifier cannot appear on a type member." + case 1071: // "'{0}' modifier cannot appear on an index signature." + case 1085: // "Octal literals are not available when targeting ECMAScript 5 and higher. Use the syntax '{0}'." + case 1090: // "'{0}' modifier cannot appear on a parameter." + case 1096: // "An index signature must have exactly one parameter." + case 1097: // "'{0}' list cannot be empty." + case 1098: // "Type parameter list cannot be empty." + case 1099: // "Type argument list cannot be empty." + case 1117: // "An object literal cannot have multiple properties with the same name in strict mode." + case 1121: // "Octal literals are not allowed in strict mode." + case 1123: // "Variable declaration list cannot be empty." + case 1141: // "String literal expected." + case 1162: // "An object member cannot be declared optional." + case 1164: // "Computed property names are not allowed in enums." + case 1172: // "'extends' clause already seen." + case 1173: // "'extends' clause must precede 'implements' clause." + case 1175: // "'implements' clause already seen." + case 1176: // "Interface declaration cannot have 'implements' clause." + case 1190: // "The variable declaration of a 'for...of' statement cannot have an initializer." + case 1196: // "Catch clause variable type annotation must be 'any' or 'unknown' if specified." + case 1200: // "Line terminator not permitted before arrow." + case 1206: // "Decorators are not valid here." + case 1211: // "A class declaration without the 'default' modifier must have a name." + case 1242: // "'abstract' modifier can only appear on a class, method, or property declaration." + case 1246: // "An interface property cannot have an initializer." + case 1255: // "A definite assignment assertion '!' is not permitted in this context." + case 1308: // "'await' expression is only allowed within an async function." + case 2364: // "The left-hand side of an assignment expression must be a variable or a property access." + case 2369: // "A parameter property is only allowed in a constructor implementation." + case 2452: // "An enum member cannot have a numeric name." + case 2462: // "A rest element must be last in a destructuring pattern." + case 8017: // "Octal literal types must use ES2015 syntax. Use the syntax '{0}'." + case 17012: // "'{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'?" + case 17013: // "Meta-property '{0}' is only allowed in the body of a function declaration, function expression, or constructor." + return true; + } + return false; + }); +} +function convertDiagnosticToSemanticOrSyntacticError(diagnostic) { + return { + ...diagnostic, + message: (0, typescript_1.flattenDiagnosticMessageText)(diagnostic.messageText, typescript_1.sys.newLine), + }; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c73d263aa317eaf7fb520012a4cf1abc789d8cbb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.d.ts @@ -0,0 +1,11 @@ +import type { VisitorKeys } from '@typescript-eslint/visitor-keys'; +import type { TSESTree } from './ts-estree'; +type SimpleTraverseOptions = Readonly<{ + enter: (node: TSESTree.Node, parent: TSESTree.Node | undefined) => void; + visitorKeys?: Readonly; +} | { + visitorKeys?: Readonly; + visitors: Record void>; +}>; +export declare function simpleTraverse(startingNode: TSESTree.Node, options: SimpleTraverseOptions, setParentPointers?: boolean): void; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js new file mode 100644 index 0000000000000000000000000000000000000000..6960df2a1afd3a0747b004b47c281fe7a4390e4a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/simple-traverse.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.simpleTraverse = simpleTraverse; +const visitor_keys_1 = require("@typescript-eslint/visitor-keys"); +function isValidNode(x) { + return (typeof x === 'object' && + x != null && + 'type' in x && + typeof x.type === 'string'); +} +function getVisitorKeysForNode(allVisitorKeys, node) { + const keys = allVisitorKeys[node.type]; + return (keys ?? []); +} +class SimpleTraverser { + allVisitorKeys = visitor_keys_1.visitorKeys; + selectors; + setParentPointers; + constructor(selectors, setParentPointers = false) { + this.selectors = selectors; + this.setParentPointers = setParentPointers; + if (selectors.visitorKeys) { + this.allVisitorKeys = selectors.visitorKeys; + } + } + traverse(node, parent) { + if (!isValidNode(node)) { + return; + } + if (this.setParentPointers) { + node.parent = parent; + } + if ('enter' in this.selectors) { + this.selectors.enter(node, parent); + } + else if (node.type in this.selectors.visitors) { + this.selectors.visitors[node.type](node, parent); + } + const keys = getVisitorKeysForNode(this.allVisitorKeys, node); + if (keys.length < 1) { + return; + } + for (const key of keys) { + const childOrChildren = node[key]; + if (Array.isArray(childOrChildren)) { + for (const child of childOrChildren) { + this.traverse(child, node); + } + } + else { + this.traverse(childOrChildren, node); + } + } + } +} +function simpleTraverse(startingNode, options, setParentPointers = false) { + new SimpleTraverser(options, setParentPointers).traverse(startingNode, undefined); +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/source-files.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/source-files.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3467aa02bd0a0b244e7bae6d748747bbea53b68f --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/source-files.d.ts @@ -0,0 +1,3 @@ +import * as ts from 'typescript'; +export declare function isSourceFile(code: unknown): code is ts.SourceFile; +export declare function getCodeText(code: string | ts.SourceFile): string; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/source-files.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/source-files.js new file mode 100644 index 0000000000000000000000000000000000000000..51151c0e1c0902a7a6c0b3747986e40ca73aacf7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/source-files.js @@ -0,0 +1,49 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSourceFile = isSourceFile; +exports.getCodeText = getCodeText; +const ts = __importStar(require("typescript")); +function isSourceFile(code) { + if (typeof code !== 'object' || code == null) { + return false; + } + const maybeSourceFile = code; + return (maybeSourceFile.kind === ts.SyntaxKind.SourceFile && + typeof maybeSourceFile.getFullText === 'function'); +} +function getCodeText(code) { + return isSourceFile(code) ? code.getFullText(code) : code; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0b05666ed6d15210e23e7c4c8908c2f5c534b16a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.d.ts @@ -0,0 +1,178 @@ +import type { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; +import type * as ts from 'typescript'; +import type { TSNode } from './ts-nodes'; +export interface EstreeToTsNodeTypes { + [AST_NODE_TYPES.AccessorProperty]: ts.PropertyDeclaration; + [AST_NODE_TYPES.ArrayExpression]: ts.ArrayLiteralExpression; + [AST_NODE_TYPES.ArrayPattern]: ts.ArrayBindingPattern | ts.ArrayLiteralExpression; + [AST_NODE_TYPES.ArrowFunctionExpression]: ts.ArrowFunction; + [AST_NODE_TYPES.AssignmentExpression]: ts.BinaryExpression; + [AST_NODE_TYPES.AssignmentPattern]: ts.BinaryExpression | ts.BindingElement | ts.ParameterDeclaration | ts.ShorthandPropertyAssignment; + [AST_NODE_TYPES.AwaitExpression]: ts.AwaitExpression; + [AST_NODE_TYPES.BinaryExpression]: ts.BinaryExpression; + [AST_NODE_TYPES.BlockStatement]: ts.Block; + [AST_NODE_TYPES.BreakStatement]: ts.BreakStatement; + [AST_NODE_TYPES.CallExpression]: ts.CallExpression; + [AST_NODE_TYPES.CatchClause]: ts.CatchClause; + [AST_NODE_TYPES.ChainExpression]: ts.CallExpression | ts.ElementAccessExpression | ts.NonNullExpression | ts.PropertyAccessExpression; + [AST_NODE_TYPES.ClassBody]: ts.ClassDeclaration | ts.ClassExpression; + [AST_NODE_TYPES.ClassDeclaration]: ts.ClassDeclaration; + [AST_NODE_TYPES.ClassExpression]: ts.ClassExpression; + [AST_NODE_TYPES.ConditionalExpression]: ts.ConditionalExpression; + [AST_NODE_TYPES.ContinueStatement]: ts.ContinueStatement; + [AST_NODE_TYPES.DebuggerStatement]: ts.DebuggerStatement; + [AST_NODE_TYPES.Decorator]: ts.Decorator; + [AST_NODE_TYPES.DoWhileStatement]: ts.DoStatement; + [AST_NODE_TYPES.EmptyStatement]: ts.EmptyStatement; + [AST_NODE_TYPES.ExportAllDeclaration]: ts.ExportDeclaration; + [AST_NODE_TYPES.ExportDefaultDeclaration]: ts.ClassDeclaration | ts.ClassExpression | ts.EnumDeclaration | ts.ExportAssignment | ts.FunctionDeclaration | ts.InterfaceDeclaration | ts.ModuleDeclaration | ts.TypeAliasDeclaration | ts.VariableStatement; + [AST_NODE_TYPES.ExportNamedDeclaration]: ts.ClassDeclaration | ts.ClassExpression | ts.EnumDeclaration | ts.ExportDeclaration | ts.FunctionDeclaration | ts.ImportEqualsDeclaration | ts.InterfaceDeclaration | ts.ModuleDeclaration | ts.TypeAliasDeclaration | ts.VariableStatement; + [AST_NODE_TYPES.ExportSpecifier]: ts.ExportSpecifier; + [AST_NODE_TYPES.ExpressionStatement]: ts.ExpressionStatement; + [AST_NODE_TYPES.ForInStatement]: ts.ForInStatement; + [AST_NODE_TYPES.ForOfStatement]: ts.ForOfStatement; + [AST_NODE_TYPES.ForStatement]: ts.ForStatement; + [AST_NODE_TYPES.FunctionDeclaration]: ts.FunctionDeclaration; + [AST_NODE_TYPES.FunctionExpression]: ts.ConstructorDeclaration | ts.FunctionExpression | ts.GetAccessorDeclaration | ts.MethodDeclaration | ts.SetAccessorDeclaration; + [AST_NODE_TYPES.Identifier]: ts.ConstructorDeclaration | ts.Identifier | ts.Token; + [AST_NODE_TYPES.IfStatement]: ts.IfStatement; + [AST_NODE_TYPES.PrivateIdentifier]: ts.PrivateIdentifier; + [AST_NODE_TYPES.PropertyDefinition]: ts.PropertyDeclaration; + [AST_NODE_TYPES.ImportAttribute]: 'ImportAttribute' extends keyof typeof ts ? ts.ImportAttribute : ts.AssertEntry; + [AST_NODE_TYPES.ImportDeclaration]: ts.ImportDeclaration; + [AST_NODE_TYPES.ImportDefaultSpecifier]: ts.ImportClause; + [AST_NODE_TYPES.ImportExpression]: ts.CallExpression; + [AST_NODE_TYPES.ImportNamespaceSpecifier]: ts.NamespaceImport; + [AST_NODE_TYPES.ImportSpecifier]: ts.ImportSpecifier; + [AST_NODE_TYPES.JSXAttribute]: ts.JsxAttribute; + [AST_NODE_TYPES.JSXClosingElement]: ts.JsxClosingElement; + [AST_NODE_TYPES.JSXClosingFragment]: ts.JsxClosingFragment; + [AST_NODE_TYPES.JSXElement]: ts.JsxElement | ts.JsxSelfClosingElement; + [AST_NODE_TYPES.JSXEmptyExpression]: ts.JsxExpression; + [AST_NODE_TYPES.JSXExpressionContainer]: ts.JsxExpression; + [AST_NODE_TYPES.JSXFragment]: ts.JsxFragment; + [AST_NODE_TYPES.JSXIdentifier]: ts.Identifier | ts.ThisExpression; + [AST_NODE_TYPES.JSXMemberExpression]: ts.PropertyAccessExpression; + [AST_NODE_TYPES.JSXNamespacedName]: ts.JsxNamespacedName; + [AST_NODE_TYPES.JSXOpeningElement]: ts.JsxOpeningElement | ts.JsxSelfClosingElement; + [AST_NODE_TYPES.JSXOpeningFragment]: ts.JsxOpeningFragment; + [AST_NODE_TYPES.JSXSpreadAttribute]: ts.JsxSpreadAttribute; + [AST_NODE_TYPES.JSXSpreadChild]: ts.JsxExpression; + [AST_NODE_TYPES.JSXText]: ts.JsxText; + [AST_NODE_TYPES.LabeledStatement]: ts.LabeledStatement; + [AST_NODE_TYPES.Literal]: ts.BigIntLiteral | ts.BooleanLiteral | ts.NullLiteral | ts.NumericLiteral | ts.RegularExpressionLiteral | ts.StringLiteral; + [AST_NODE_TYPES.LogicalExpression]: ts.BinaryExpression; + [AST_NODE_TYPES.MemberExpression]: ts.ElementAccessExpression | ts.PropertyAccessExpression; + [AST_NODE_TYPES.MetaProperty]: ts.MetaProperty; + [AST_NODE_TYPES.MethodDefinition]: ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.MethodDeclaration | ts.SetAccessorDeclaration; + [AST_NODE_TYPES.NewExpression]: ts.NewExpression; + [AST_NODE_TYPES.ObjectExpression]: ts.ObjectLiteralExpression; + [AST_NODE_TYPES.ObjectPattern]: ts.ObjectBindingPattern | ts.ObjectLiteralExpression; + [AST_NODE_TYPES.Program]: ts.SourceFile; + [AST_NODE_TYPES.Property]: ts.BindingElement | ts.GetAccessorDeclaration | ts.MethodDeclaration | ts.PropertyAssignment | ts.SetAccessorDeclaration | ts.ShorthandPropertyAssignment; + [AST_NODE_TYPES.RestElement]: ts.BindingElement | ts.ParameterDeclaration | ts.SpreadAssignment | ts.SpreadElement; + [AST_NODE_TYPES.ReturnStatement]: ts.ReturnStatement; + [AST_NODE_TYPES.SequenceExpression]: ts.BinaryExpression; + [AST_NODE_TYPES.SpreadElement]: ts.SpreadAssignment | ts.SpreadElement; + [AST_NODE_TYPES.StaticBlock]: ts.ClassStaticBlockDeclaration; + [AST_NODE_TYPES.Super]: ts.SuperExpression; + [AST_NODE_TYPES.SwitchCase]: ts.CaseClause | ts.DefaultClause; + [AST_NODE_TYPES.SwitchStatement]: ts.SwitchStatement; + [AST_NODE_TYPES.TaggedTemplateExpression]: ts.TaggedTemplateExpression; + [AST_NODE_TYPES.TemplateElement]: ts.NoSubstitutionTemplateLiteral | ts.TemplateHead | ts.TemplateMiddle | ts.TemplateTail; + [AST_NODE_TYPES.TemplateLiteral]: ts.NoSubstitutionTemplateLiteral | ts.TemplateExpression; + [AST_NODE_TYPES.ThisExpression]: ts.Identifier | ts.KeywordTypeNode | ts.ThisExpression; + [AST_NODE_TYPES.ThrowStatement]: ts.ThrowStatement; + [AST_NODE_TYPES.TryStatement]: ts.TryStatement; + [AST_NODE_TYPES.TSAbstractAccessorProperty]: ts.PropertyDeclaration; + [AST_NODE_TYPES.TSAbstractMethodDefinition]: ts.ConstructorDeclaration | ts.GetAccessorDeclaration | ts.MethodDeclaration | ts.SetAccessorDeclaration; + [AST_NODE_TYPES.TSAbstractPropertyDefinition]: ts.PropertyDeclaration; + [AST_NODE_TYPES.TSArrayType]: ts.ArrayTypeNode; + [AST_NODE_TYPES.TSAsExpression]: ts.AsExpression; + [AST_NODE_TYPES.TSCallSignatureDeclaration]: ts.CallSignatureDeclaration; + [AST_NODE_TYPES.TSClassImplements]: ts.ExpressionWithTypeArguments; + [AST_NODE_TYPES.TSConditionalType]: ts.ConditionalTypeNode; + [AST_NODE_TYPES.TSConstructorType]: ts.ConstructorTypeNode; + [AST_NODE_TYPES.TSConstructSignatureDeclaration]: ts.ConstructSignatureDeclaration; + [AST_NODE_TYPES.TSDeclareFunction]: ts.FunctionDeclaration; + [AST_NODE_TYPES.TSEnumBody]: ts.EnumDeclaration; + [AST_NODE_TYPES.TSEnumDeclaration]: ts.EnumDeclaration; + [AST_NODE_TYPES.TSEnumMember]: ts.EnumMember; + [AST_NODE_TYPES.TSExportAssignment]: ts.ExportAssignment; + [AST_NODE_TYPES.TSExternalModuleReference]: ts.ExternalModuleReference; + [AST_NODE_TYPES.TSFunctionType]: ts.FunctionTypeNode; + [AST_NODE_TYPES.TSImportEqualsDeclaration]: ts.ImportEqualsDeclaration; + [AST_NODE_TYPES.TSImportType]: ts.ImportTypeNode; + [AST_NODE_TYPES.TSIndexedAccessType]: ts.IndexedAccessTypeNode; + [AST_NODE_TYPES.TSIndexSignature]: ts.IndexSignatureDeclaration; + [AST_NODE_TYPES.TSInferType]: ts.InferTypeNode; + [AST_NODE_TYPES.TSInstantiationExpression]: ts.ExpressionWithTypeArguments; + [AST_NODE_TYPES.TSInterfaceBody]: ts.InterfaceDeclaration; + [AST_NODE_TYPES.TSInterfaceDeclaration]: ts.InterfaceDeclaration; + [AST_NODE_TYPES.TSInterfaceHeritage]: ts.ExpressionWithTypeArguments; + [AST_NODE_TYPES.TSIntersectionType]: ts.IntersectionTypeNode; + [AST_NODE_TYPES.TSLiteralType]: ts.LiteralTypeNode; + [AST_NODE_TYPES.TSMappedType]: ts.MappedTypeNode; + [AST_NODE_TYPES.TSMethodSignature]: ts.GetAccessorDeclaration | ts.MethodSignature | ts.SetAccessorDeclaration; + [AST_NODE_TYPES.TSModuleBlock]: ts.ModuleBlock; + [AST_NODE_TYPES.TSModuleDeclaration]: ts.ModuleDeclaration; + [AST_NODE_TYPES.TSNamedTupleMember]: ts.NamedTupleMember; + [AST_NODE_TYPES.TSNamespaceExportDeclaration]: ts.NamespaceExportDeclaration; + [AST_NODE_TYPES.TSNonNullExpression]: ts.NonNullExpression; + [AST_NODE_TYPES.TSOptionalType]: ts.OptionalTypeNode; + [AST_NODE_TYPES.TSParameterProperty]: ts.ParameterDeclaration; + [AST_NODE_TYPES.TSPropertySignature]: ts.PropertySignature; + [AST_NODE_TYPES.TSQualifiedName]: ts.Identifier | ts.QualifiedName; + [AST_NODE_TYPES.TSRestType]: ts.NamedTupleMember | ts.RestTypeNode; + [AST_NODE_TYPES.TSSatisfiesExpression]: ts.SatisfiesExpression; + [AST_NODE_TYPES.TSTemplateLiteralType]: ts.TemplateLiteralTypeNode; + [AST_NODE_TYPES.TSThisType]: ts.ThisTypeNode; + [AST_NODE_TYPES.TSTupleType]: ts.TupleTypeNode; + [AST_NODE_TYPES.TSTypeAliasDeclaration]: ts.TypeAliasDeclaration; + [AST_NODE_TYPES.TSTypeAnnotation]: undefined; + [AST_NODE_TYPES.TSTypeAssertion]: ts.TypeAssertion; + [AST_NODE_TYPES.TSTypeLiteral]: ts.TypeLiteralNode; + [AST_NODE_TYPES.TSTypeOperator]: ts.TypeOperatorNode; + [AST_NODE_TYPES.TSTypeParameter]: ts.TypeParameterDeclaration; + [AST_NODE_TYPES.TSTypeParameterDeclaration]: undefined; + [AST_NODE_TYPES.TSTypeParameterInstantiation]: ts.CallExpression | ts.ExpressionWithTypeArguments | ts.ImportTypeNode | ts.JsxOpeningElement | ts.JsxSelfClosingElement | ts.NewExpression | ts.TaggedTemplateExpression | ts.TypeQueryNode | ts.TypeReferenceNode; + [AST_NODE_TYPES.TSTypePredicate]: ts.TypePredicateNode; + [AST_NODE_TYPES.TSTypeQuery]: ts.ImportTypeNode | ts.TypeQueryNode; + [AST_NODE_TYPES.TSTypeReference]: ts.TypeReferenceNode; + [AST_NODE_TYPES.TSUnionType]: ts.UnionTypeNode; + [AST_NODE_TYPES.UnaryExpression]: ts.DeleteExpression | ts.PostfixUnaryExpression | ts.PrefixUnaryExpression | ts.TypeOfExpression | ts.VoidExpression; + [AST_NODE_TYPES.UpdateExpression]: ts.PostfixUnaryExpression | ts.PrefixUnaryExpression; + [AST_NODE_TYPES.VariableDeclaration]: ts.VariableDeclarationList | ts.VariableStatement; + [AST_NODE_TYPES.VariableDeclarator]: ts.VariableDeclaration; + [AST_NODE_TYPES.WhileStatement]: ts.WhileStatement; + [AST_NODE_TYPES.WithStatement]: ts.WithStatement; + [AST_NODE_TYPES.YieldExpression]: ts.YieldExpression; + [AST_NODE_TYPES.TSEmptyBodyFunctionExpression]: ts.ConstructorDeclaration | ts.FunctionExpression | ts.GetAccessorDeclaration | ts.MethodDeclaration | ts.SetAccessorDeclaration; + [AST_NODE_TYPES.TSAbstractKeyword]: ts.Token; + [AST_NODE_TYPES.TSAnyKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSBigIntKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSBooleanKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSIntrinsicKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSNeverKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSNullKeyword]: ts.KeywordTypeNode | ts.NullLiteral; + [AST_NODE_TYPES.TSNumberKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSObjectKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSStringKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSSymbolKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSUndefinedKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSUnknownKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSVoidKeyword]: ts.KeywordTypeNode; + [AST_NODE_TYPES.TSAsyncKeyword]: ts.Token; + [AST_NODE_TYPES.TSDeclareKeyword]: ts.Token; + [AST_NODE_TYPES.TSExportKeyword]: ts.Token; + [AST_NODE_TYPES.TSPrivateKeyword]: ts.Token; + [AST_NODE_TYPES.TSProtectedKeyword]: ts.Token; + [AST_NODE_TYPES.TSPublicKeyword]: ts.Token; + [AST_NODE_TYPES.TSReadonlyKeyword]: ts.Token; + [AST_NODE_TYPES.TSStaticKeyword]: ts.Token; +} +/** + * Maps TSESTree AST Node type to the expected TypeScript AST Node type(s). + * This mapping is based on the internal logic of the parser. + */ +export type TSESTreeToTSNode = Extract | TSNode, EstreeToTsNodeTypes[T['type']]>; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/estree-to-ts-node-types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5c794c2b91b3607b78a75b7c598fd051006fc982 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.d.ts @@ -0,0 +1,3 @@ +export * from './estree-to-ts-node-types'; +export * from './ts-nodes'; +export { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/types'; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js new file mode 100644 index 0000000000000000000000000000000000000000..2782aae0363cc0d0b722eecd56cca03aa1281211 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/index.js @@ -0,0 +1,24 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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.TSESTree = exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0; +// for simplicity and backwards-compatibility +__exportStar(require("./estree-to-ts-node-types"), exports); +__exportStar(require("./ts-nodes"), exports); +var types_1 = require("@typescript-eslint/types"); +Object.defineProperty(exports, "AST_NODE_TYPES", { enumerable: true, get: function () { return types_1.AST_NODE_TYPES; } }); +Object.defineProperty(exports, "AST_TOKEN_TYPES", { enumerable: true, get: function () { return types_1.AST_TOKEN_TYPES; } }); +Object.defineProperty(exports, "TSESTree", { enumerable: true, get: function () { return types_1.TSESTree; } }); diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3eb4d8d14ac019fb18d97a9b77e34c54544fa16a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts @@ -0,0 +1,17 @@ +import type * as ts from 'typescript'; +declare module 'typescript' { + interface AssertClause extends ts.ImportAttributes { + } + interface AssertEntry extends ts.ImportAttribute { + } + interface SatisfiesExpression extends ts.Node { + } + interface JsxNamespacedName extends ts.Node { + } + interface ImportAttribute extends ts.Node { + } + interface ImportAttributes extends ts.Node { + } +} +export type TSToken = ts.Token; +export type TSNode = ts.ArrayBindingPattern | ts.ArrayLiteralExpression | ts.ArrayTypeNode | ts.ArrowFunction | ts.AsExpression | ts.AssertClause | ts.AssertEntry | ts.AwaitExpression | ts.BigIntLiteral | ts.BinaryExpression | ts.BindingElement | ts.Block | ts.BooleanLiteral | ts.BreakStatement | ts.Bundle | ts.CallExpression | ts.CallSignatureDeclaration | ts.CaseBlock | ts.CaseClause | ts.CatchClause | ts.ClassDeclaration | ts.ClassExpression | ts.ClassStaticBlockDeclaration | ts.CommaListExpression | ts.ComputedPropertyName | ts.ConditionalExpression | ts.ConditionalTypeNode | ts.ConstructorDeclaration | ts.ConstructorTypeNode | ts.ConstructSignatureDeclaration | ts.ContinueStatement | ts.DebuggerStatement | ts.Decorator | ts.DefaultClause | ts.DeleteExpression | ts.DoStatement | ts.ElementAccessExpression | ts.EmptyStatement | ts.EnumDeclaration | ts.EnumMember | ts.ExportAssignment | ts.ExportDeclaration | ts.ExportSpecifier | ts.ExpressionStatement | ts.ExpressionWithTypeArguments | ts.ExternalModuleReference | ts.ForInStatement | ts.ForOfStatement | ts.ForStatement | ts.FunctionDeclaration | ts.FunctionExpression | ts.FunctionTypeNode | ts.GetAccessorDeclaration | ts.HeritageClause | ts.Identifier | ts.IfStatement | ts.ImportAttribute | ts.ImportAttributes | ts.ImportClause | ts.ImportDeclaration | ts.ImportEqualsDeclaration | ts.ImportExpression | ts.ImportSpecifier | ts.ImportTypeNode | ts.IndexedAccessTypeNode | ts.IndexSignatureDeclaration | ts.InferTypeNode | ts.InterfaceDeclaration | ts.IntersectionTypeNode | ts.JSDoc | ts.JSDocAllType | ts.JSDocAugmentsTag | ts.JSDocAuthorTag | ts.JSDocCallbackTag | ts.JSDocClassTag | ts.JSDocEnumTag | ts.JSDocFunctionType | ts.JSDocNonNullableType | ts.JSDocNullableType | ts.JSDocOptionalType | ts.JSDocParameterTag | ts.JSDocPropertyTag | ts.JSDocReturnTag | ts.JSDocSignature | ts.JSDocTemplateTag | ts.JSDocThisTag | ts.JSDocTypedefTag | ts.JSDocTypeExpression | ts.JSDocTypeLiteral | ts.JSDocTypeTag | ts.JSDocUnknownTag | ts.JSDocUnknownType | ts.JSDocVariadicType | ts.JsonMinusNumericLiteral | ts.JsxAttribute | ts.JsxClosingElement | ts.JsxClosingFragment | ts.JsxElement | ts.JsxExpression | ts.JsxFragment | ts.JsxNamespacedName | ts.JsxOpeningElement | ts.JsxOpeningFragment | ts.JsxSelfClosingElement | ts.JsxSpreadAttribute | ts.JsxText | ts.KeywordTypeNode | ts.LabeledStatement | ts.LiteralTypeNode | ts.MappedTypeNode | ts.MetaProperty | ts.MethodDeclaration | ts.MethodSignature | ts.MissingDeclaration | ts.Modifier | ts.ModuleBlock | ts.ModuleDeclaration | ts.NamedExports | ts.NamedImports | ts.NamedTupleMember | ts.NamespaceExportDeclaration | ts.NamespaceImport | ts.NewExpression | ts.NonNullExpression | ts.NoSubstitutionTemplateLiteral | ts.NotEmittedStatement | ts.NullLiteral | ts.NumericLiteral | ts.ObjectBindingPattern | ts.ObjectLiteralExpression | ts.OmittedExpression | ts.OptionalTypeNode | ts.ParameterDeclaration | ts.ParenthesizedExpression | ts.ParenthesizedTypeNode | ts.PartiallyEmittedExpression | ts.PostfixUnaryExpression | ts.PrefixUnaryExpression | ts.PrivateIdentifier | ts.PropertyAccessExpression | ts.PropertyAssignment | ts.PropertyDeclaration | ts.PropertySignature | ts.QualifiedName | ts.RegularExpressionLiteral | ts.RestTypeNode | ts.ReturnStatement | ts.SatisfiesExpression | ts.SemicolonClassElement | ts.SetAccessorDeclaration | ts.ShorthandPropertyAssignment | ts.SourceFile | ts.SpreadAssignment | ts.SpreadElement | ts.StringLiteral | ts.SuperExpression | ts.SwitchStatement | ts.SyntheticExpression | ts.TaggedTemplateExpression | ts.TemplateExpression | ts.TemplateHead | ts.TemplateLiteralTypeNode | ts.TemplateMiddle | ts.TemplateSpan | ts.TemplateTail | ts.ThisExpression | ts.ThisTypeNode | ts.ThrowStatement | ts.TryStatement | ts.TupleTypeNode | ts.TypeAliasDeclaration | ts.TypeAssertion | ts.TypeLiteralNode | ts.TypeOfExpression | ts.TypeOperatorNode | ts.TypeParameterDeclaration | ts.TypePredicateNode | ts.TypeQueryNode | ts.TypeReferenceNode | ts.UnionTypeNode | ts.VariableDeclaration | ts.VariableDeclarationList | ts.VariableStatement | ts.VoidExpression | ts.WhileStatement | ts.WithStatement | ts.YieldExpression; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0d6b979bb2539806bc8c80158afaf10a974f2465 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.d.ts @@ -0,0 +1,7 @@ +export * from './ast-converter'; +export * from './create-program/getScriptKind'; +export type { ParseSettings } from './parseSettings'; +export { SUPPORTED_TYPESCRIPT_VERSIONS } from './parseSettings/warnAboutTSVersion'; +export * from './getModifiers'; +export { typescriptVersionIsAtLeast } from './version-check'; +export { getCanonicalFileName } from './create-program/shared'; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.js new file mode 100644 index 0000000000000000000000000000000000000000..9c8b2963ee4b533b3e284cd2c3536fc82b0bac77 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/use-at-your-own-risk.js @@ -0,0 +1,29 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (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.getCanonicalFileName = exports.typescriptVersionIsAtLeast = exports.SUPPORTED_TYPESCRIPT_VERSIONS = void 0; +// required by website +__exportStar(require("./ast-converter"), exports); +__exportStar(require("./create-program/getScriptKind"), exports); +var warnAboutTSVersion_1 = require("./parseSettings/warnAboutTSVersion"); +Object.defineProperty(exports, "SUPPORTED_TYPESCRIPT_VERSIONS", { enumerable: true, get: function () { return warnAboutTSVersion_1.SUPPORTED_TYPESCRIPT_VERSIONS; } }); +// required by packages/utils/src/ts-estree.ts +__exportStar(require("./getModifiers"), exports); +var version_check_1 = require("./version-check"); +Object.defineProperty(exports, "typescriptVersionIsAtLeast", { enumerable: true, get: function () { return version_check_1.typescriptVersionIsAtLeast; } }); +// required by packages/type-utils +var shared_1 = require("./create-program/shared"); +Object.defineProperty(exports, "getCanonicalFileName", { enumerable: true, get: function () { return shared_1.getCanonicalFileName; } }); diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f52307a98d09490251ceb2ce345f169e104f56b9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.d.ts @@ -0,0 +1,6 @@ +import type { ProjectServiceAndMetadata } from '@typescript-eslint/project-service'; +import type { ASTAndDefiniteProgram, ASTAndNoProgram, ASTAndProgram } from './create-program/shared'; +import type { MutableParseSettings } from './parseSettings'; +export declare function useProgramFromProjectService(serviceAndSettings: ProjectServiceAndMetadata, parseSettings: Readonly, hasFullTypeInformation: boolean, defaultProjectMatchedFiles: Set): ASTAndProgram | undefined; +export declare function useProgramFromProjectService(serviceAndSettings: ProjectServiceAndMetadata, parseSettings: Readonly, hasFullTypeInformation: true, defaultProjectMatchedFiles: Set): ASTAndDefiniteProgram | undefined; +export declare function useProgramFromProjectService(serviceAndSettings: ProjectServiceAndMetadata, parseSettings: Readonly, hasFullTypeInformation: false, defaultProjectMatchedFiles: Set): ASTAndNoProgram | undefined; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js new file mode 100644 index 0000000000000000000000000000000000000000..20f3d7b8dc767ed096484c6615ae9ec035e4e474 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/useProgramFromProjectService.js @@ -0,0 +1,205 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.useProgramFromProjectService = useProgramFromProjectService; +const debug_1 = __importDefault(require("debug")); +const minimatch_1 = require("minimatch"); +const node_path_1 = __importDefault(require("node:path")); +const node_util_1 = __importDefault(require("node:util")); +const ts = __importStar(require("typescript")); +const createProjectProgram_1 = require("./create-program/createProjectProgram"); +const createSourceFile_1 = require("./create-program/createSourceFile"); +const shared_1 = require("./create-program/shared"); +const validateDefaultProjectForFilesGlob_1 = require("./create-program/validateDefaultProjectForFilesGlob"); +const RELOAD_THROTTLE_MS = 250; +const log = (0, debug_1.default)('typescript-eslint:typescript-estree:useProgramFromProjectService'); +const serviceFileExtensions = new WeakMap(); +const updateExtraFileExtensions = (service, extraFileExtensions) => { + const currentServiceFileExtensions = serviceFileExtensions.get(service) ?? []; + if (!node_util_1.default.isDeepStrictEqual(currentServiceFileExtensions, extraFileExtensions)) { + log('Updating extra file extensions: before=%s: after=%s', currentServiceFileExtensions, extraFileExtensions); + service.setHostConfiguration({ + extraFileExtensions: extraFileExtensions.map(extension => ({ + extension, + isMixedContent: false, + scriptKind: ts.ScriptKind.Deferred, + })), + }); + serviceFileExtensions.set(service, extraFileExtensions); + log('Extra file extensions updated: %o', extraFileExtensions); + } +}; +function openClientFileFromProjectService(defaultProjectMatchedFiles, isDefaultProjectAllowed, filePathAbsolute, parseSettings, serviceAndSettings) { + const opened = openClientFileAndMaybeReload(); + log('Result from attempting to open client file: %o', opened); + log('Default project allowed path: %s, based on config file: %s', isDefaultProjectAllowed, opened.configFileName); + if (opened.configFileName) { + if (isDefaultProjectAllowed) { + throw new Error(`${parseSettings.filePath} was included by allowDefaultProject but also was found in the project service. Consider removing it from allowDefaultProject.`); + } + } + else { + const wasNotFound = `${parseSettings.filePath} was not found by the project service`; + const fileExtension = node_path_1.default.extname(parseSettings.filePath); + const extraFileExtensions = parseSettings.extraFileExtensions; + if (!shared_1.DEFAULT_EXTRA_FILE_EXTENSIONS.has(fileExtension) && + !extraFileExtensions.includes(fileExtension)) { + const nonStandardExt = `${wasNotFound} because the extension for the file (\`${fileExtension}\`) is non-standard`; + if (extraFileExtensions.length > 0) { + throw new Error(`${nonStandardExt}. It should be added to your existing \`parserOptions.extraFileExtensions\`.`); + } + else { + throw new Error(`${nonStandardExt}. You should add \`parserOptions.extraFileExtensions\` to your config.`); + } + } + if (!isDefaultProjectAllowed) { + const baseMessage = `${wasNotFound}. Consider either including it in the tsconfig.json or including it in allowDefaultProject.`; + const allowDefaultProject = parseSettings.projectService?.allowDefaultProject; + if (!allowDefaultProject) { + throw new Error(baseMessage); + } + const relativeFilePath = node_path_1.default.relative(parseSettings.tsconfigRootDir, filePathAbsolute); + throw new Error([ + baseMessage, + `allowDefaultProject is set to ${JSON.stringify(allowDefaultProject)}, which does not match '${relativeFilePath}'.`, + ].join('\n')); + } + } + // No a configFileName indicates this file wasn't included in a TSConfig. + // That means it must get its type information from the default project. + if (!opened.configFileName) { + defaultProjectMatchedFiles.add(filePathAbsolute); + if (defaultProjectMatchedFiles.size > + serviceAndSettings.maximumDefaultProjectFileMatchCount) { + const filePrintLimit = 20; + const filesToPrint = [...defaultProjectMatchedFiles].slice(0, filePrintLimit); + const truncatedFileCount = defaultProjectMatchedFiles.size - filesToPrint.length; + throw new Error(`Too many files (>${serviceAndSettings.maximumDefaultProjectFileMatchCount}) have matched the default project.${validateDefaultProjectForFilesGlob_1.DEFAULT_PROJECT_FILES_ERROR_EXPLANATION} +Matching files: +${filesToPrint.map(file => `- ${file}`).join('\n')} +${truncatedFileCount ? `...and ${truncatedFileCount} more files\n` : ''} +If you absolutely need more files included, set parserOptions.projectService.maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING to a larger value. +`); + } + } + return opened; + function openClientFile() { + return serviceAndSettings.service.openClientFile(filePathAbsolute, parseSettings.codeFullText, + /* scriptKind */ undefined, parseSettings.tsconfigRootDir); + } + function openClientFileAndMaybeReload() { + log('Opening project service client file at path: %s', filePathAbsolute); + let opened = openClientFile(); + // If no project included the file and we're not in single-run mode, + // we might be running in an editor with outdated file info. + // We can try refreshing the project service - debounced for performance. + if (!opened.configFileErrors && + !opened.configFileName && + !parseSettings.singleRun && + !isDefaultProjectAllowed && + performance.now() - serviceAndSettings.lastReloadTimestamp > + RELOAD_THROTTLE_MS) { + log('No config file found; reloading project service and retrying.'); + serviceAndSettings.service.reloadProjects(); + opened = openClientFile(); + serviceAndSettings.lastReloadTimestamp = performance.now(); + } + return opened; + } +} +function createNoProgramWithProjectService(filePathAbsolute, parseSettings, service) { + log('No project service information available. Creating no program.'); + // If the project service knows about this file, this informs if of changes. + // Doing so ensures that: + // - if the file is not part of a project, we don't waste time creating a program (fast non-type-aware linting) + // - otherwise, we refresh the file in the project service (moderately fast, since the project is already loaded) + if (service.getScriptInfo(filePathAbsolute)) { + log('Script info available. Opening client file in project service.'); + service.openClientFile(filePathAbsolute, parseSettings.codeFullText, + /* scriptKind */ undefined, parseSettings.tsconfigRootDir); + } + return (0, createSourceFile_1.createNoProgram)(parseSettings); +} +function retrieveASTAndProgramFor(filePathAbsolute, parseSettings, serviceAndSettings) { + log('Retrieving script info and then program for: %s', filePathAbsolute); + const scriptInfo = serviceAndSettings.service.getScriptInfo(filePathAbsolute); + /* eslint-disable @typescript-eslint/no-non-null-assertion */ + const program = serviceAndSettings.service + .getDefaultProjectForFile(scriptInfo.fileName, true) + .getLanguageService(/*ensureSynchronized*/ true) + .getProgram(); + /* eslint-enable @typescript-eslint/no-non-null-assertion */ + if (!program) { + log('Could not find project service program for: %s', filePathAbsolute); + return undefined; + } + log('Found project service program for: %s', filePathAbsolute); + return (0, createProjectProgram_1.createProjectProgram)(parseSettings, [program]); +} +function useProgramFromProjectService(serviceAndSettings, parseSettings, hasFullTypeInformation, defaultProjectMatchedFiles) { + // NOTE: triggers a full project reload when changes are detected + updateExtraFileExtensions(serviceAndSettings.service, parseSettings.extraFileExtensions); + // We don't canonicalize the filename because it caused a performance regression. + // See https://github.com/typescript-eslint/typescript-eslint/issues/8519 + const filePathAbsolute = absolutify(parseSettings.filePath, serviceAndSettings); + log('Opening project service file for: %s at absolute path %s', parseSettings.filePath, filePathAbsolute); + const filePathRelative = node_path_1.default.relative(parseSettings.tsconfigRootDir, filePathAbsolute); + const isDefaultProjectAllowed = filePathMatchedBy(filePathRelative, serviceAndSettings.allowDefaultProject); + // Type-aware linting is disabled for this file. + // However, type-aware lint rules might still rely on its contents. + if (!hasFullTypeInformation && !isDefaultProjectAllowed) { + return createNoProgramWithProjectService(filePathAbsolute, parseSettings, serviceAndSettings.service); + } + // If type info was requested, we attempt to open it in the project service. + // By now, the file is known to be one of: + // - in the project service (valid configuration) + // - allowlisted in the default project (valid configuration) + // - neither, which openClientFileFromProjectService will throw an error for + const opened = hasFullTypeInformation && + openClientFileFromProjectService(defaultProjectMatchedFiles, isDefaultProjectAllowed, filePathAbsolute, parseSettings, serviceAndSettings); + log('Opened project service file: %o', opened); + return retrieveASTAndProgramFor(filePathAbsolute, parseSettings, serviceAndSettings); +} +function absolutify(filePath, serviceAndSettings) { + return node_path_1.default.isAbsolute(filePath) + ? filePath + : node_path_1.default.join(serviceAndSettings.service.host.getCurrentDirectory(), filePath); +} +function filePathMatchedBy(filePath, allowDefaultProject) { + return !!allowDefaultProject?.some(pattern => (0, minimatch_1.minimatch)(filePath, pattern, { dot: true })); +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a3207bbfc3f42c9017d4df23468ff9006022d680 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version-check.d.ts @@ -0,0 +1,4 @@ +declare const versions: readonly ["4.7", "4.8", "4.9", "5.0", "5.1", "5.2", "5.3", "5.4", "5.5", "5.6", "5.7", "5.8", "5.9", "6.0"]; +type Versions = typeof versions extends ArrayLike ? U : never; +export declare const typescriptVersionIsAtLeast: Record; +export {}; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js new file mode 100644 index 0000000000000000000000000000000000000000..54d545de864632bbd8aa80afc0dd17d97eb4c54c --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version-check.js @@ -0,0 +1,63 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.typescriptVersionIsAtLeast = void 0; +const semver = __importStar(require("semver")); +const ts = __importStar(require("typescript")); +function semverCheck(version) { + return semver.satisfies(ts.version, `>= ${version}.0 || >= ${version}.1-rc || >= ${version}.0-beta`, { + includePrerelease: true, + }); +} +const versions = [ + '4.7', + '4.8', + '4.9', + '5.0', + '5.1', + '5.2', + '5.3', + '5.4', + '5.5', + '5.6', + '5.7', + '5.8', + '5.9', + '6.0', +]; +exports.typescriptVersionIsAtLeast = {}; +for (const version of versions) { + exports.typescriptVersionIsAtLeast[version] = semverCheck(version); +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..baaee2fd0c7b5df5f84487b7c700c3bc9f0eaf45 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version.d.ts @@ -0,0 +1 @@ +export declare const version: string; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version.js new file mode 100644 index 0000000000000000000000000000000000000000..b303ecb105baa80730a46b759d7a4357793ffd47 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/version.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = void 0; +// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access +exports.version = require('../package.json').version; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b89bff4ff8ada017bb93c5e18c4c90e56221bc0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.d.ts @@ -0,0 +1,9 @@ +/** + * Removes options that prompt the parser to parse the project with type + * information. In other words, you can use this if you are invoking the parser + * directly, to ensure that one file will be parsed in isolation, which is much, + * much faster. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/8428 + */ +export declare function withoutProjectParserOptions(opts: Options): Omit; diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.js new file mode 100644 index 0000000000000000000000000000000000000000..365ba9b2ada4906dbfa95ad367fc4373412768c1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/dist/withoutProjectParserOptions.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.withoutProjectParserOptions = withoutProjectParserOptions; +/** + * Removes options that prompt the parser to parse the project with type + * information. In other words, you can use this if you are invoking the parser + * directly, to ensure that one file will be parsed in isolation, which is much, + * much faster. + * + * @see https://github.com/typescript-eslint/typescript-eslint/issues/8428 + */ +function withoutProjectParserOptions(opts) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars -- The variables are meant to be omitted + const { EXPERIMENTAL_useProjectService, project, projectService, ...rest } = opts; + return rest; +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/LICENSE.md b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..61ece8cc92afb41fdb1552ec1f72ac147b9eaceb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,23 @@ +(MIT) + +Original code Copyright Julian Gruber + +Port to TypeScript Copyright Isaac Z. Schlueter + +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/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/README.md b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f3bb3773a5320cef4378cdde9bc78adb5e646552 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/README.md @@ -0,0 +1,57 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and +``. Supports regular expressions as well! + +## Example + +Get the first matching pair of braces: + +```js +import { balanced } from '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 + +### const 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', '}']`. + +### const 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]`. diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f819cfd016012ff5607febb82aaab715244f8fab --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.d.ts @@ -0,0 +1,9 @@ +export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | { + start: number; + end: number; + pre: string; + body: string; + post: string; +} | undefined; +export declare const range: (a: string, b: string, str: string) => undefined | [number, number]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..6306762c77d77b909214a5d7af014b2eb156bbb3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..0c9014bac153187d5b0e3d1d214a5d1c71eefd32 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.range = exports.balanced = void 0; +const balanced = (a, b, str) => { + const ma = a instanceof RegExp ? maybeMatch(a, str) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str) : b; + const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str); + return (r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + ma.length, r[1]), + post: str.slice(r[1] + mb.length), + }); +}; +exports.balanced = balanced; +const maybeMatch = (reg, str) => { + const m = str.match(reg); + return m ? m[0] : null; +}; +const range = (a, b, str) => { + let begs, beg, left, right = undefined, result; + let ai = str.indexOf(a); + let bi = str.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } + else if (begs.length === 1) { + const r = begs.pop(); + if (r !== undefined) + result = [r, bi]; + } + else { + beg = begs.pop(); + if (beg !== undefined && beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== undefined) { + result = [left, right]; + } + } + return result; +}; +exports.range = range; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..83f547ca9d33d5e0cc5a6e38b1dab4b9060a2bc7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,IAAA,aAAK,EAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;KAClC,CACF,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB;AAED,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,EAAE;IAC9C,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;I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GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA/CY,QAAA,KAAK,SA+CjB","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/package.json b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f819cfd016012ff5607febb82aaab715244f8fab --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.d.ts @@ -0,0 +1,9 @@ +export declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | { + start: number; + end: number; + pre: string; + body: string; + post: string; +} | undefined; +export declare const range: (a: string, b: string, str: string) => undefined | [number, number]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..6306762c77d77b909214a5d7af014b2eb156bbb3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fe81200f9d676da19bf1bf088ecef7944290e38a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.js @@ -0,0 +1,54 @@ +export const balanced = (a, b, str) => { + const ma = a instanceof RegExp ? maybeMatch(a, str) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str) : b; + const r = ma !== null && mb != null && range(ma, mb, str); + return (r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + ma.length, r[1]), + post: str.slice(r[1] + mb.length), + }); +}; +const maybeMatch = (reg, str) => { + const m = str.match(reg); + return m ? m[0] : null; +}; +export const range = (a, b, str) => { + let begs, beg, left, right = undefined, result; + let ai = str.indexOf(a); + let bi = str.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } + else if (begs.length === 1) { + const r = begs.pop(); + if (r !== undefined) + result = [r, bi]; + } + else { + beg = begs.pop(); + if (beg !== undefined && beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== undefined) { + result = [left, right]; + } + } + return result; +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..b476cae229324756c8359ea6545e7494f13e63d7 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;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I,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBACpB,IAAI,CAAC,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAChB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["export const balanced = (\n a: string | RegExp,\n b: string | RegExp,\n str: string,\n) => {\n const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n const r = ma !== null && mb != null && range(ma, mb, str)\n\n return (\n r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + ma.length, r[1]),\n post: str.slice(r[1] + mb.length),\n }\n )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n const m = str.match(reg)\n return m ? m[0] : null\n}\n\nexport const range = (\n a: string,\n b: string,\n str: string,\n): undefined | [number, number] => {\n let begs: number[],\n beg: number | undefined,\n left: number,\n right: number | undefined = undefined,\n result: undefined | [number, number]\n let ai = str.indexOf(a)\n let bi = str.indexOf(b, ai + 1)\n let i = ai\n\n if (ai >= 0 && bi > 0) {\n if (a === b) {\n return [ai, bi]\n }\n begs = []\n left = str.length\n\n while (i >= 0 && !result) {\n if (i === ai) {\n begs.push(i)\n ai = str.indexOf(a, i + 1)\n } else if (begs.length === 1) {\n const r = begs.pop()\n if (r !== undefined) result = [r, bi]\n } else {\n beg = begs.pop()\n if (beg !== undefined && beg < left) {\n left = beg\n right = bi\n }\n\n bi = str.indexOf(b, i + 1)\n }\n\n i = ai < bi && ai >= 0 ? ai : bi\n }\n\n if (begs.length && right !== undefined) {\n result = [left, right]\n }\n }\n\n return result\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/package.json b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/package.json b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/package.json new file mode 100644 index 0000000000000000000000000000000000000000..48f1a638d0b67d3187e9d6dbaee454df4b302f23 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match/package.json @@ -0,0 +1,68 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "4.0.4", + "files": [ + "dist" + ], + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "type": "module", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "devDependencies": { + "@types/brace-expansion": "^1.1.2", + "@types/node": "^25.2.1", + "mkdirp": "^3.0.1", + "prettier": "^3.3.2", + "tap": "^21.6.2", + "tshy": "^3.0.2", + "typedoc": "^0.28.5" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/LICENSE b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..46e7b75c91ced041ae473299398af2b0472dc352 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/LICENSE @@ -0,0 +1,23 @@ +MIT License + +Copyright Julian Gruber + +TypeScript port Copyright Isaac Z. Schlueter + +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/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/README.md b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/README.md new file mode 100644 index 0000000000000000000000000000000000000000..073aceb3177ae7babf06970ec4238c00f2527419 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/README.md @@ -0,0 +1,105 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![CI](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +## Example + +```js +import { expand } from '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 +import { expand } from 'brace-expansion' +``` + +### const expanded = expand(str, [options]) + +Return an array of all possible and valid expansions of `str`. If +none are found, `[str]` is returned. + +The `options` object can provide a `max` value to cap the number +of expansions allowed. This is limited to `100_000` by default, +to prevent DoS attacks. + +```js +const expansions = expand('{1..100}'.repeat(5), { + max: 100, +}) +// expansions.length will be 100, not 100^5 +``` + +The `options` object can also provide a `maxLength` value to cap the +total number of characters across all expansions. This is limited to +`4_000_000` by default, to prevent memory exhaustion from inputs whose +result count stays under `max` while each result grows very long. + +```js +const expansions = expand('{a,b}'.repeat(1500), { + maxLength: 10_000, +}) +``` + +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. diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3e2de9d87e1ce462517e49f35733bed8bdf85af --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.d.ts @@ -0,0 +1,8 @@ +export declare const EXPANSION_MAX = 100000; +export declare const EXPANSION_MAX_LENGTH = 4000000; +export type BraceExpansionOptions = { + max?: number; + maxLength?: number; +}; +export declare function expand(str: string, options?: BraceExpansionOptions): string[]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..c0ff8dc158ab44082d0c3de029606fcb7b84eb88 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAYpC,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAwD7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..869a6bee23807b9f01c18c99ab8e952b4b242f97 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.js @@ -0,0 +1,289 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0; +exports.expand = expand; +const balanced_match_1 = require("balanced-match"); +const escSlash = '\0SLASH' + Math.random() + '\0'; +const escOpen = '\0OPEN' + Math.random() + '\0'; +const escClose = '\0CLOSE' + Math.random() + '\0'; +const escComma = '\0COMMA' + Math.random() + '\0'; +const escPeriod = '\0PERIOD' + Math.random() + '\0'; +const escSlashPattern = new RegExp(escSlash, 'g'); +const escOpenPattern = new RegExp(escOpen, 'g'); +const escClosePattern = new RegExp(escClose, 'g'); +const escCommaPattern = new RegExp(escComma, 'g'); +const escPeriodPattern = new RegExp(escPeriod, 'g'); +const slashPattern = /\\\\/g; +const openPattern = /\\{/g; +const closePattern = /\\}/g; +const commaPattern = /\\,/g; +const periodPattern = /\\\./g; +exports.EXPANSION_MAX = 100_000; +// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An +// input like `'{a,b}'.repeat(1500)` stays under that count - its output is +// truncated to 100k results - while making every result ~1500 characters +// long. The result set, and the intermediate arrays built while combining +// brace sets, then grow large enough to exhaust memory and crash the process +// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of +// characters the accumulator may hold at any point, so memory stays flat no +// matter how many brace groups are chained. The limit sits well above any +// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M +// characters) so legitimate input is unaffected. +exports.EXPANSION_MAX_LENGTH = 4_000_000; +function numeric(str) { + return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); +} +function escapeBraces(str) { + return str + .replace(slashPattern, escSlash) + .replace(openPattern, escOpen) + .replace(closePattern, escClose) + .replace(commaPattern, escComma) + .replace(periodPattern, escPeriod); +} +function unescapeBraces(str) { + return str + .replace(escSlashPattern, '\\') + .replace(escOpenPattern, '{') + .replace(escClosePattern, '}') + .replace(escCommaPattern, ',') + .replace(escPeriodPattern, '.'); +} +/** + * Basically just str.split(","), but handling cases + * where we have nested braced sections, which should be + * treated as individual members, like {a,{b,c},d} + */ +function parseCommaParts(str) { + if (!str) { + return ['']; + } + const parts = []; + const m = (0, balanced_match_1.balanced)('{', '}', str); + if (!m) { + return str.split(','); + } + const { pre, body, post } = m; + const p = pre.split(','); + p[p.length - 1] += '{' + body + '}'; + const postParts = parseCommaParts(post); + if (post.length) { + ; + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); + return parts; +} +function expand(str, options = {}) { + if (!str) { + return []; + } + const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH } = options; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.slice(0, 2) === '{}') { + str = '\\{\\}' + str.slice(2); + } + return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces); +} +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} +// Build `{ acc[a] + pre + values[v] }` for every combination, capping the +// number of results at `max` and the total number of characters at `maxLength`. +// This is the one place output grows, so bounding it here keeps the single +// accumulator - and therefore memory - flat regardless of how many brace groups +// are combined (CVE-2026-14257). +function combine(acc, pre, values, max, maxLength, dropEmpties) { + const out = []; + let length = 0; + for (let a = 0; a < acc.length; a++) { + for (let v = 0; v < values.length; v++) { + if (out.length >= max) + return out; + const expansion = acc[a] + pre + values[v]; + // Bash drops empty results at the top level. Skip them before they count + // against `max`, so `max` bounds the number of *kept* results. + if (dropEmpties && !expansion) + continue; + if (length + expansion.length > maxLength) + return out; + out.push(expansion); + length += expansion.length; + } + } + return out; +} +// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) +// sequence body. +function expandSequence(body, isAlphaSequence, max, maxLength) { + const n = body.split(/\.\./); + const N = []; + // A sequence body always splits into two or three parts, but the compiler + // can't know that. + /* c8 ignore start */ + if (n[0] === undefined || n[1] === undefined) { + return N; + } + /* c8 ignore stop */ + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + let length = 0; + for (let i = x; test(i, y) && N.length < max; i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + if (length + c.length > maxLength) + break; + N.push(c); + length += c.length; + } + return N; +} +function expand_(str, max, maxLength, isTop) { + // Consume the string's top-level brace groups left to right, threading a + // running set of combined prefixes (`acc`). Expanding the tail iteratively - + // rather than recursing on `m.post` once per group - keeps the native stack + // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no + // longer overflow the stack, and leaves a single accumulator whose size + // `maxLength` bounds directly (CVE-2026-14257). + let acc = ['']; + // Bash drops empty results, but only when the *first* top-level group is a + // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop + // is on the final strings, so it is applied to whichever `combine` produces + // them (the one with no brace set left in the tail). + let dropEmpties = false; + let firstGroup = true; + for (;;) { + const m = (0, balanced_match_1.balanced)('{', '}', str); + // No brace set left: the rest of the string is literal. + if (!m) { + return combine(acc, str, [''], max, maxLength, dropEmpties); + } + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + if (/\$$/.test(pre)) { + acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length); + firstGroup = false; + if (!m.post.length) + break; + str = m.post; + continue; + } + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + const isSequence = isNumericSequence || isAlphaSequence; + const isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + isTop = true; + continue; + } + // Nothing here expands, so the whole remaining string is literal. + return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties); + } + if (firstGroup) { + dropEmpties = isTop && !isSequence; + firstGroup = false; + } + let values; + if (isSequence) { + values = expandSequence(m.body, isAlphaSequence, max, maxLength); + } + else { + let n = parseCommaParts(m.body); + if (n.length === 1 && n[0] !== undefined) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand_(n[0], max, maxLength, false).map(embrace); + //XXX is this necessary? Can't seem to hit it in tests. + /* c8 ignore start */ + if (n.length === 1) { + acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + continue; + } + /* c8 ignore stop */ + } + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. + let dropsEmpties = dropEmpties && !m.post.length && !pre; + for (let d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d]) { + dropsEmpties = false; + } + } + values = []; + let valuesLength = 0; + outer: for (let j = 0; j < n.length; j++) { + const expanded = expand_(n[j], max, maxLength, false); + for (let k = 0; k < expanded.length; k++) { + const v = expanded[k]; + if (dropsEmpties && !v) + continue; + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer; + } + values.push(v); + valuesLength += v.length; + } + } + } + acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + } + return acc; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..658bba38ad60d96289e5ed98b330aa29c6fcc483 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA2FA,wBAkBC;AA7GD,mDAAyC;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC/C,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;AACnD,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,WAAW,GAAG,MAAM,CAAA;AAC1B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MA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,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBACzC,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAW,CAAA;oBAC/B,IAAI,YAAY,IAAI,CAAC,CAAC;wBAAE,SAAQ;oBAChC,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,YAAY,GAAG,CAAC,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;wBAChE,MAAM,KAAK,CAAA;oBACb,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;oBACd,YAAY,IAAI,CAAC,CAAC,MAAM,CAAA;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;QAED,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9E,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;YAAE,MAAK;QACzB,GAAG,GAAG,CAAC,CAAC,IAAI,CAAA;IACd,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\n// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An\n// input like `'{a,b}'.repeat(1500)` stays under that count - its output is\n// truncated to 100k results - while making every result ~1500 characters\n// long. The result set, and the intermediate arrays built while combining\n// brace sets, then grow large enough to exhaust memory and crash the process\n// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of\n// characters the accumulator may hold at any point, so memory stays flat no\n// matter how many brace groups are chained. The limit sits well above any\n// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M\n// characters) so legitimate input is unaffected.\nexport const EXPANSION_MAX_LENGTH = 4_000_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n maxLength?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\n// Build `{ acc[a] + pre + values[v] }` for every combination, capping the\n// number of results at `max` and the total number of characters at `maxLength`.\n// This is the one place output grows, so bounding it here keeps the single\n// accumulator - and therefore memory - flat regardless of how many brace groups\n// are combined (CVE-2026-14257).\nfunction combine(\n acc: string[],\n pre: string,\n values: string[],\n max: number,\n maxLength: number,\n dropEmpties: boolean,\n): string[] {\n const out: string[] = []\n let length = 0\n for (let a = 0; a < acc.length; a++) {\n for (let v = 0; v < values.length; v++) {\n if (out.length >= max) return out\n const expansion = (acc[a] as string) + pre + values[v]\n // Bash drops empty results at the top level. Skip them before they count\n // against `max`, so `max` bounds the number of *kept* results.\n if (dropEmpties && !expansion) continue\n if (length + expansion.length > maxLength) return out\n out.push(expansion)\n length += expansion.length\n }\n }\n return out\n}\n\n// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)\n// sequence body.\nfunction expandSequence(\n body: string,\n isAlphaSequence: boolean,\n max: number,\n maxLength: number,\n): string[] {\n const n = body.split(/\\.\\./)\n const N: string[] = []\n // A sequence body always splits into two or three parts, but the compiler\n // can't know that.\n /* c8 ignore start */\n if (n[0] === undefined || n[1] === undefined) {\n return N\n }\n /* c8 ignore stop */\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n let length = 0\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n if (length + c.length > maxLength) break\n N.push(c)\n length += c.length\n }\n return N\n}\n\nfunction expand_(\n str: string,\n max: number,\n maxLength: number,\n isTop: boolean,\n): string[] {\n // Consume the string's top-level brace groups left to right, threading a\n // running set of combined prefixes (`acc`). Expanding the tail iteratively -\n // rather than recursing on `m.post` once per group - keeps the native stack\n // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no\n // longer overflow the stack, and leaves a single accumulator whose size\n // `maxLength` bounds directly (CVE-2026-14257).\n let acc: string[] = ['']\n\n // Bash drops empty results, but only when the *first* top-level group is a\n // comma set - a sequence like `{a..\\}` may legitimately yield ''. The drop\n // is on the final strings, so it is applied to whichever `combine` produces\n // them (the one with no brace set left in the tail).\n let dropEmpties = false\n let firstGroup = true\n\n for (;;) {\n const m = balanced('{', '}', str)\n\n // No brace set left: the rest of the string is literal.\n if (!m) {\n return combine(acc, str, [''], max, maxLength, dropEmpties)\n }\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n\n if (/\\$$/.test(pre)) {\n acc = combine(\n acc,\n pre + '{' + m.body + '}',\n [''],\n max,\n maxLength,\n dropEmpties && !m.post.length,\n )\n firstGroup = false\n if (!m.post.length) break\n str = m.post\n continue\n }\n\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n isTop = true\n continue\n }\n // Nothing here expands, so the whole remaining string is literal.\n return combine(\n acc,\n pre + '{' + m.body + '}' + m.post,\n [''],\n max,\n maxLength,\n dropEmpties,\n )\n }\n\n if (firstGroup) {\n dropEmpties = isTop && !isSequence\n firstGroup = false\n }\n\n let values: string[]\n if (isSequence) {\n values = expandSequence(m.body, isAlphaSequence, max, maxLength)\n } else {\n let n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, maxLength, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n acc = combine(\n acc,\n pre + n[0],\n [''],\n max,\n maxLength,\n dropEmpties && !m.post.length,\n )\n if (!m.post.length) break\n str = m.post\n continue\n }\n /* c8 ignore stop */\n }\n\n // Values that `combine` is going to drop as empty produce no result, so\n // they must not count against `max` - otherwise `{a,,b}` with `max: 2`\n // would stop at `['a', '']` and yield one result instead of two. Skipping\n // them outright keeps `values` bounded while leaving `max` a bound on\n // *kept* results.\n let dropsEmpties = dropEmpties && !m.post.length && !pre\n for (let d = 0; dropsEmpties && d < acc.length; d++) {\n if (acc[d]) {\n dropsEmpties = false\n }\n }\n\n values = []\n let valuesLength = 0\n outer: for (let j = 0; j < n.length; j++) {\n const expanded = expand_(n[j] as string, max, maxLength, false)\n for (let k = 0; k < expanded.length; k++) {\n const v = expanded[k] as string\n if (dropsEmpties && !v) continue\n if (values.length >= max || valuesLength + v.length > maxLength) {\n break outer\n }\n values.push(v)\n valuesLength += v.length\n }\n }\n }\n\n acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length)\n if (!m.post.length) break\n str = m.post\n }\n\n return acc\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/package.json b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/commonjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3e2de9d87e1ce462517e49f35733bed8bdf85af --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.d.ts @@ -0,0 +1,8 @@ +export declare const EXPANSION_MAX = 100000; +export declare const EXPANSION_MAX_LENGTH = 4000000; +export type BraceExpansionOptions = { + max?: number; + maxLength?: number; +}; +export declare function expand(str: string, options?: BraceExpansionOptions): string[]; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..c0ff8dc158ab44082d0c3de029606fcb7b84eb88 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAYpC,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAwD7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..fd68f57029207ac1bcafe7fb1c14ad5305b3ffa4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.js @@ -0,0 +1,285 @@ +import { balanced } from 'balanced-match'; +const escSlash = '\0SLASH' + Math.random() + '\0'; +const escOpen = '\0OPEN' + Math.random() + '\0'; +const escClose = '\0CLOSE' + Math.random() + '\0'; +const escComma = '\0COMMA' + Math.random() + '\0'; +const escPeriod = '\0PERIOD' + Math.random() + '\0'; +const escSlashPattern = new RegExp(escSlash, 'g'); +const escOpenPattern = new RegExp(escOpen, 'g'); +const escClosePattern = new RegExp(escClose, 'g'); +const escCommaPattern = new RegExp(escComma, 'g'); +const escPeriodPattern = new RegExp(escPeriod, 'g'); +const slashPattern = /\\\\/g; +const openPattern = /\\{/g; +const closePattern = /\\}/g; +const commaPattern = /\\,/g; +const periodPattern = /\\\./g; +export const EXPANSION_MAX = 100_000; +// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An +// input like `'{a,b}'.repeat(1500)` stays under that count - its output is +// truncated to 100k results - while making every result ~1500 characters +// long. The result set, and the intermediate arrays built while combining +// brace sets, then grow large enough to exhaust memory and crash the process +// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of +// characters the accumulator may hold at any point, so memory stays flat no +// matter how many brace groups are chained. The limit sits well above any +// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M +// characters) so legitimate input is unaffected. +export const EXPANSION_MAX_LENGTH = 4_000_000; +function numeric(str) { + return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); +} +function escapeBraces(str) { + return str + .replace(slashPattern, escSlash) + .replace(openPattern, escOpen) + .replace(closePattern, escClose) + .replace(commaPattern, escComma) + .replace(periodPattern, escPeriod); +} +function unescapeBraces(str) { + return str + .replace(escSlashPattern, '\\') + .replace(escOpenPattern, '{') + .replace(escClosePattern, '}') + .replace(escCommaPattern, ',') + .replace(escPeriodPattern, '.'); +} +/** + * Basically just str.split(","), but handling cases + * where we have nested braced sections, which should be + * treated as individual members, like {a,{b,c},d} + */ +function parseCommaParts(str) { + if (!str) { + return ['']; + } + const parts = []; + const m = balanced('{', '}', str); + if (!m) { + return str.split(','); + } + const { pre, body, post } = m; + const p = pre.split(','); + p[p.length - 1] += '{' + body + '}'; + const postParts = parseCommaParts(post); + if (post.length) { + ; + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); + return parts; +} +export function expand(str, options = {}) { + if (!str) { + return []; + } + const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.slice(0, 2) === '{}') { + str = '\\{\\}' + str.slice(2); + } + return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces); +} +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} +// Build `{ acc[a] + pre + values[v] }` for every combination, capping the +// number of results at `max` and the total number of characters at `maxLength`. +// This is the one place output grows, so bounding it here keeps the single +// accumulator - and therefore memory - flat regardless of how many brace groups +// are combined (CVE-2026-14257). +function combine(acc, pre, values, max, maxLength, dropEmpties) { + const out = []; + let length = 0; + for (let a = 0; a < acc.length; a++) { + for (let v = 0; v < values.length; v++) { + if (out.length >= max) + return out; + const expansion = acc[a] + pre + values[v]; + // Bash drops empty results at the top level. Skip them before they count + // against `max`, so `max` bounds the number of *kept* results. + if (dropEmpties && !expansion) + continue; + if (length + expansion.length > maxLength) + return out; + out.push(expansion); + length += expansion.length; + } + } + return out; +} +// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`) +// sequence body. +function expandSequence(body, isAlphaSequence, max, maxLength) { + const n = body.split(/\.\./); + const N = []; + // A sequence body always splits into two or three parts, but the compiler + // can't know that. + /* c8 ignore start */ + if (n[0] === undefined || n[1] === undefined) { + return N; + } + /* c8 ignore stop */ + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? + Math.max(Math.abs(numeric(n[2])), 1) + : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + let length = 0; + for (let i = x; test(i, y) && N.length < max; i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + if (length + c.length > maxLength) + break; + N.push(c); + length += c.length; + } + return N; +} +function expand_(str, max, maxLength, isTop) { + // Consume the string's top-level brace groups left to right, threading a + // running set of combined prefixes (`acc`). Expanding the tail iteratively - + // rather than recursing on `m.post` once per group - keeps the native stack + // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no + // longer overflow the stack, and leaves a single accumulator whose size + // `maxLength` bounds directly (CVE-2026-14257). + let acc = ['']; + // Bash drops empty results, but only when the *first* top-level group is a + // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop + // is on the final strings, so it is applied to whichever `combine` produces + // them (the one with no brace set left in the tail). + let dropEmpties = false; + let firstGroup = true; + for (;;) { + const m = balanced('{', '}', str); + // No brace set left: the rest of the string is literal. + if (!m) { + return combine(acc, str, [''], max, maxLength, dropEmpties); + } + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + if (/\$$/.test(pre)) { + acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length); + firstGroup = false; + if (!m.post.length) + break; + str = m.post; + continue; + } + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + const isSequence = isNumericSequence || isAlphaSequence; + const isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + isTop = true; + continue; + } + // Nothing here expands, so the whole remaining string is literal. + return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties); + } + if (firstGroup) { + dropEmpties = isTop && !isSequence; + firstGroup = false; + } + let values; + if (isSequence) { + values = expandSequence(m.body, isAlphaSequence, max, maxLength); + } + else { + let n = parseCommaParts(m.body); + if (n.length === 1 && n[0] !== undefined) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand_(n[0], max, maxLength, false).map(embrace); + //XXX is this necessary? Can't seem to hit it in tests. + /* c8 ignore start */ + if (n.length === 1) { + acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + continue; + } + /* c8 ignore stop */ + } + // Values that `combine` is going to drop as empty produce no result, so + // they must not count against `max` - otherwise `{a,,b}` with `max: 2` + // would stop at `['a', '']` and yield one result instead of two. Skipping + // them outright keeps `values` bounded while leaving `max` a bound on + // *kept* results. + let dropsEmpties = dropEmpties && !m.post.length && !pre; + for (let d = 0; dropsEmpties && d < acc.length; d++) { + if (acc[d]) { + dropsEmpties = false; + } + } + values = []; + let valuesLength = 0; + outer: for (let j = 0; j < n.length; j++) { + const expanded = expand_(n[j], max, maxLength, false); + for (let k = 0; k < expanded.length; k++) { + const v = expanded[k]; + if (dropsEmpties && !v) + continue; + if (values.length >= max || valuesLength + v.length > maxLength) { + break outer; + } + values.push(v); + valuesLength += v.length; + } + } + } + acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length); + if (!m.post.length) + break; + str = m.post; + } + return acc; +} +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..17b5e434eead5a29e21b1930e783aa7b29c0b610 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,C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zB,GAAG,GAAG,CAAC,CAAC,IAAI,CAAA;IACd,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\n// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An\n// input like `'{a,b}'.repeat(1500)` stays under that count - its output is\n// truncated to 100k results - while making every result ~1500 characters\n// long. The result set, and the intermediate arrays built while combining\n// brace sets, then grow large enough to exhaust memory and crash the process\n// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of\n// characters the accumulator may hold at any point, so memory stays flat no\n// matter how many brace groups are chained. The limit sits well above any\n// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M\n// characters) so legitimate input is unaffected.\nexport const EXPANSION_MAX_LENGTH = 4_000_000\n\nfunction numeric(str: string) {\n return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n return str\n .replace(slashPattern, escSlash)\n .replace(openPattern, escOpen)\n .replace(closePattern, escClose)\n .replace(commaPattern, escComma)\n .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n return str\n .replace(escSlashPattern, '\\\\')\n .replace(escOpenPattern, '{')\n .replace(escClosePattern, '}')\n .replace(escCommaPattern, ',')\n .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n if (!str) {\n return ['']\n }\n\n const parts: string[] = []\n const m = balanced('{', '}', str)\n\n if (!m) {\n return str.split(',')\n }\n\n const { pre, body, post } = m\n const p = pre.split(',')\n\n p[p.length - 1] += '{' + body + '}'\n const postParts = parseCommaParts(post)\n if (post.length) {\n ;(p[p.length - 1] as string) += postParts.shift()\n p.push.apply(p, postParts)\n }\n\n parts.push.apply(parts, p)\n\n return parts\n}\n\nexport type BraceExpansionOptions = {\n max?: number\n maxLength?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n if (!str) {\n return []\n }\n\n const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.slice(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.slice(2)\n }\n\n return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n return i <= y\n}\n\nfunction gte(i: number, y: number) {\n return i >= y\n}\n\n// Build `{ acc[a] + pre + values[v] }` for every combination, capping the\n// number of results at `max` and the total number of characters at `maxLength`.\n// This is the one place output grows, so bounding it here keeps the single\n// accumulator - and therefore memory - flat regardless of how many brace groups\n// are combined (CVE-2026-14257).\nfunction combine(\n acc: string[],\n pre: string,\n values: string[],\n max: number,\n maxLength: number,\n dropEmpties: boolean,\n): string[] {\n const out: string[] = []\n let length = 0\n for (let a = 0; a < acc.length; a++) {\n for (let v = 0; v < values.length; v++) {\n if (out.length >= max) return out\n const expansion = (acc[a] as string) + pre + values[v]\n // Bash drops empty results at the top level. Skip them before they count\n // against `max`, so `max` bounds the number of *kept* results.\n if (dropEmpties && !expansion) continue\n if (length + expansion.length > maxLength) return out\n out.push(expansion)\n length += expansion.length\n }\n }\n return out\n}\n\n// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)\n// sequence body.\nfunction expandSequence(\n body: string,\n isAlphaSequence: boolean,\n max: number,\n maxLength: number,\n): string[] {\n const n = body.split(/\\.\\./)\n const N: string[] = []\n // A sequence body always splits into two or three parts, but the compiler\n // can't know that.\n /* c8 ignore start */\n if (n[0] === undefined || n[1] === undefined) {\n return N\n }\n /* c8 ignore stop */\n const x = numeric(n[0])\n const y = numeric(n[1])\n const width = Math.max(n[0].length, n[1].length)\n let incr =\n n.length === 3 && n[2] !== undefined ?\n Math.max(Math.abs(numeric(n[2])), 1)\n : 1\n let test = lte\n const reverse = y < x\n if (reverse) {\n incr *= -1\n test = gte\n }\n const pad = n.some(isPadded)\n\n let length = 0\n for (let i = x; test(i, y) && N.length < max; i += incr) {\n let c\n if (isAlphaSequence) {\n c = String.fromCharCode(i)\n if (c === '\\\\') {\n c = ''\n }\n } else {\n c = String(i)\n if (pad) {\n const need = width - c.length\n if (need > 0) {\n const z = new Array(need + 1).join('0')\n if (i < 0) {\n c = '-' + z + c.slice(1)\n } else {\n c = z + c\n }\n }\n }\n }\n if (length + c.length > maxLength) break\n N.push(c)\n length += c.length\n }\n return N\n}\n\nfunction expand_(\n str: string,\n max: number,\n maxLength: number,\n isTop: boolean,\n): string[] {\n // Consume the string's top-level brace groups left to right, threading a\n // running set of combined prefixes (`acc`). Expanding the tail iteratively -\n // rather than recursing on `m.post` once per group - keeps the native stack\n // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no\n // longer overflow the stack, and leaves a single accumulator whose size\n // `maxLength` bounds directly (CVE-2026-14257).\n let acc: string[] = ['']\n\n // Bash drops empty results, but only when the *first* top-level group is a\n // comma set - a sequence like `{a..\\}` may legitimately yield ''. The drop\n // is on the final strings, so it is applied to whichever `combine` produces\n // them (the one with no brace set left in the tail).\n let dropEmpties = false\n let firstGroup = true\n\n for (;;) {\n const m = balanced('{', '}', str)\n\n // No brace set left: the rest of the string is literal.\n if (!m) {\n return combine(acc, str, [''], max, maxLength, dropEmpties)\n }\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n const pre = m.pre\n\n if (/\\$$/.test(pre)) {\n acc = combine(\n acc,\n pre + '{' + m.body + '}',\n [''],\n max,\n maxLength,\n dropEmpties && !m.post.length,\n )\n firstGroup = false\n if (!m.post.length) break\n str = m.post\n continue\n }\n\n const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n m.body,\n )\n const isSequence = isNumericSequence || isAlphaSequence\n const isOptions = m.body.indexOf(',') >= 0\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,(?!,).*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post\n isTop = true\n continue\n }\n // Nothing here expands, so the whole remaining string is literal.\n return combine(\n acc,\n pre + '{' + m.body + '}' + m.post,\n [''],\n max,\n maxLength,\n dropEmpties,\n )\n }\n\n if (firstGroup) {\n dropEmpties = isTop && !isSequence\n firstGroup = false\n }\n\n let values: string[]\n if (isSequence) {\n values = expandSequence(m.body, isAlphaSequence, max, maxLength)\n } else {\n let n = parseCommaParts(m.body)\n if (n.length === 1 && n[0] !== undefined) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand_(n[0], max, maxLength, false).map(embrace)\n //XXX is this necessary? Can't seem to hit it in tests.\n /* c8 ignore start */\n if (n.length === 1) {\n acc = combine(\n acc,\n pre + n[0],\n [''],\n max,\n maxLength,\n dropEmpties && !m.post.length,\n )\n if (!m.post.length) break\n str = m.post\n continue\n }\n /* c8 ignore stop */\n }\n\n // Values that `combine` is going to drop as empty produce no result, so\n // they must not count against `max` - otherwise `{a,,b}` with `max: 2`\n // would stop at `['a', '']` and yield one result instead of two. Skipping\n // them outright keeps `values` bounded while leaving `max` a bound on\n // *kept* results.\n let dropsEmpties = dropEmpties && !m.post.length && !pre\n for (let d = 0; dropsEmpties && d < acc.length; d++) {\n if (acc[d]) {\n dropsEmpties = false\n }\n }\n\n values = []\n let valuesLength = 0\n outer: for (let j = 0; j < n.length; j++) {\n const expanded = expand_(n[j] as string, max, maxLength, false)\n for (let k = 0; k < expanded.length; k++) {\n const v = expanded[k] as string\n if (dropsEmpties && !v) continue\n if (values.length >= max || valuesLength + v.length > maxLength) {\n break outer\n }\n values.push(v)\n valuesLength += v.length\n }\n }\n }\n\n acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length)\n if (!m.post.length) break\n str = m.post\n }\n\n return acc\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/package.json b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/dist/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/package.json b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4376400796c951434ba3036b784822cd70083a00 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion/package.json @@ -0,0 +1,64 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "5.0.9", + "files": [ + "dist" + ], + "exports": { + "./package.json": "./package.json", + ".": { + "import": { + "types": "./dist/esm/index.d.ts", + "default": "./dist/esm/index.js" + }, + "require": { + "types": "./dist/commonjs/index.d.ts", + "default": "./dist/commonjs/index.js" + } + } + }, + "type": "module", + "scripts": { + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags", + "prepare": "tshy", + "pretest": "npm run prepare", + "presnap": "npm run prepare", + "test": "tap", + "snap": "tap", + "format": "prettier --write .", + "benchmark": "node benchmark/index.js", + "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts" + }, + "devDependencies": { + "@types/brace-expansion": "^1.1.2", + "@types/node": "^25.2.1", + "mkdirp": "^3.0.1", + "prettier": "^3.3.2", + "tap": "^21.6.2", + "tshy": "^3.0.2", + "typedoc": "^0.28.5" + }, + "dependencies": { + "balanced-match": "^4.0.2" + }, + "license": "MIT", + "engines": { + "node": "20 || >=22" + }, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts" + } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/juliangruber/brace-expansion.git" + } +} diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/LICENSE.md b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..8cb5cc6e616c0d9259b4965f9d2ce8528e4d2828 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/LICENSE.md @@ -0,0 +1,55 @@ +# Blue Oak Model License + +Version 1.0.0 + +## Purpose + +This license gives everyone as much permission to work with +this software as possible, while protecting contributors +from liability. + +## Acceptance + +In order to receive this license, you must agree to its +rules. The rules of this license are both obligations +under that agreement and conditions to your license. +You must not do anything with this software that triggers +a rule that you cannot or will not follow. + +## Copyright + +Each contributor licenses you to do everything with this +software that would otherwise infringe that contributor's +copyright in it. + +## Notices + +You must ensure that everyone who gets a copy of +any part of this software from you, with or without +changes, also gets the text of this license or a link to +. + +## Excuse + +If anyone notifies you in writing that you have not +complied with [Notices](#notices), you can keep your +license by taking all practical steps to comply within 30 +days after the notice. If you do not do so, your license +ends immediately. + +## Patent + +Each contributor licenses you to do everything with this +software that would otherwise infringe any patent claims +they can license or become able to license. + +## Reliability + +No contributor can revoke this license. + +## No Liability + +**_As far as the law allows, this software comes as is, +without any warranty or condition, and no contributor +will be liable to anyone for any damages related to this +software or this license, under any kind of legal claim._** diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/README.md b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1a068fab2a0fb246162b55c9aec983019282b37a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/README.md @@ -0,0 +1,528 @@ +# minimatch + +A minimal matching utility. + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Important Security Consideration! + +> [!WARNING] +> This library uses JavaScript regular expressions. Please read +> the following warning carefully, and be thoughtful about what +> you provide to this library in production systems. + +_Any_ library in JavaScript that deals with matching string +patterns using regular expressions will be subject to +[ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) +if the pattern is generated using untrusted input. + +Efforts have been made to mitigate risk as much as is feasible in +such a library, providing maximum recursion depths and so forth, +but these measures can only ultimately protect against accidents, +not malice. A dedicated attacker can _always_ find patterns that +cannot be defended against by a bash-compatible glob pattern +matching system that uses JavaScript regular expressions. + +To be extremely clear: + +> [!WARNING] +> **If you create a system where you take user input, and use +> that input as the source of a Regular Expression pattern, in +> this or any extant glob matcher in JavaScript, you will be +> pwned.** + +A future version of this library _may_ use a different matching +algorithm which does not exhibit backtracking problems. If and +when that happens, it will likely be a sweeping change, and those +improvements will **not** be backported to legacy versions. + +In the near term, it is not reasonable to continue to play +whack-a-mole with security advisories, and so any future ReDoS +reports will be considered "working as intended", and resolved +entirely by this warning. + +## Usage + +```js +// hybrid module, load with require() or import +import { minimatch } from 'minimatch' +// or: +const { minimatch } = require('minimatch') + +minimatch('bar.foo', '*.foo') // true! +minimatch('bar.foo', '*.bar') // false! +minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +- Brace Expansion +- Extended glob matching +- "Globstar" `**` matching +- [Posix character + classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html), + like `[[:alpha:]]`, supporting the full range of Unicode + characters. For example, `[[:alpha:]]` will match against + `'é'`, though `[a-zA-Z]` will not. Collating symbol and set + matching is not supported, so `[[=e=]]` will _not_ match `'é'` + and `[[.ch.]]` will not match `'ch'` in locales where `ch` is + considered a single character. + +See: + +- `man sh` +- `man bash` [Pattern + Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html) +- `man 3 fnmatch` +- `man 5 gitignore` + +## 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 in patterns +will always be interpreted as escape characters, not path separators. + +Note that `\` or `/` _will_ be interpreted as path separators in paths on +Windows, and will match against `/` in glob expressions. + +So just always use `/` in patterns. + +### UNC Paths + +On Windows, UNC paths like `//?/c:/...` or +`//ComputerName/Share/...` are handled specially. + +- Patterns starting with a double-slash followed by some + non-slash characters will preserve their double-slash. As a + result, a pattern like `//*` will match `//x`, but not `/x`. +- Patterns staring with `//?/:` will _not_ treat + the `?` as a wildcard character. Instead, it will be treated + as a normal string. +- Patterns starting with `//?/:/...` will match + file paths starting with `:/...`, and vice versa, + as if the `//?/` was not present. This behavior only is + present when the drive letters are a case-insensitive match to + one another. The remaining portions of the path/pattern are + compared case sensitively, unless `nocase:true` is set. + +Note that specifying a UNC path using `\` characters as path +separators is always allowed in the file path argument, but only +allowed in the pattern argument when `windowsPathsNoEscape: true` +is set in the options. + +## Minimatch Class + +Create a minimatch object by instantiating the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require('minimatch').Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +- `pattern` The original pattern the minimatch object represents. +- `options` The options supplied to the constructor. +- `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +- `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +- `negate` True if the pattern is negated. +- `comment` True if the pattern is a comment. +- `empty` True if the pattern is `""`. + +### Methods + +- `makeRe()` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +- `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +- `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. +- `hasMagic()` Returns true if the parsed pattern contains any + magic characters. Returns false if all comparator parts are + string literals. If the `magicalBraces` option is set on the + constructor, then it will consider brace expansions which are + not otherwise magical to be magic. If not set, then a pattern + like `a{b,c}d` will return `false`, because neither `abd` nor + `acd` contain any special glob characters. + + This does **not** mean that the pattern string can be used as a + literal filename, as it may contain magic glob characters that + are escaped. For example, the pattern `\\*` or `[*]` would not + be considered to have magic, as the matching portion parses to + the literal string `'*'` and would match a path named `'*'`, + not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may + be used to remove escape characters. + +All other methods are internal, and will be called as necessary. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, '*.js', { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter( + minimatch.filter('*.js', { matchBase: true }), +) +``` + +### minimatch.escape(pattern, options = {}) + +Escape all magic characters in a glob pattern, so that it will +only ever match literal strings. + +If the `windowsPathsNoEscape` option is used, then characters are +escaped by wrapping in `[]`, because a magic character wrapped in +a character class can only be satisfied by that exact character. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +### minimatch.unescape(pattern, options = {}) + +Un-escape a glob string that may contain some escaped characters. + +If the `windowsPathsNoEscape` option is used, then square-brace +escapes are removed, but not backslash escapes. For example, it +will turn the string `'[*]'` into `*`, but it will not turn +`'\\*'` into `'*'`, because `\` is a path separator in +`windowsPathsNoEscape` mode. + +When `windowsPathsNoEscape` is not set, then both brace escapes +and backslash escapes are removed. + +Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot +be escaped or unescaped. + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, '*.js', { matchBase: true }) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nocaseMagicOnly + +When used with `{nocase: true}`, create regular expressions that +are case-insensitive, but leave string match portions untouched. +Has no effect when used without `{nocase: true}`. + +Useful when some other form of case-insensitive matching is used, +or if the original string representation is useful in some other +way. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### magicalBraces + +This only affects the results of the `Minimatch.hasMagic` method. + +If the pattern contains brace expansions, such as `a{b,c}d`, but +no other magic characters, then the `Minimatch.hasMagic()` method +will return `false` by default. When this option set, it will +return `true` for brace expansion as well as other magic glob +characters. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + +### partial + +Compare a partial path to a pattern. As long as the parts of the path that +are present are not contradicted by the pattern, it will be treated as a +match. This is useful in applications where you're walking through a +folder structure, and don't yet have the full path, but want to ensure that +you do not walk down paths that can never be a match. + +For example, + +```js +minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d +minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d +minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a +``` + +### windowsPathsNoEscape + +Use `\\` as a path separator _only_, and _never_ as an escape +character. If set, all `\\` characters are replaced with `/` in +the pattern. Note that this makes it **impossible** to match +against paths containing literal glob pattern characters, but +allows matching with patterns constructed using `path.join()` and +`path.resolve()` on Windows platforms, mimicking the (buggy!) +behavior of earlier versions on Windows. Please use with +caution, and be mindful of [the caveat about Windows +paths](#windows). + +For legacy reasons, this is also set if +`options.allowWindowsEscape` is set to the exact value `false`. + +### windowsNoMagicRoot + +When a pattern starts with a UNC path or drive letter, and in +`nocase:true` mode, do not convert the root portions of the +pattern into a case-insensitive regular expression, and instead +leave them as strings. + +This is the default when the platform is `win32` and +`nocase:true` is set. + +### preserveMultipleSlashes + +By default, multiple `/` characters (other than the leading `//` +in a UNC path, see "UNC Paths" above) are treated as a single +`/`. + +That is, a pattern like `a///b` will match the file path `a/b`. + +Set `preserveMultipleSlashes: true` to suppress this behavior. + +### optimizationLevel + +A number indicating the level of optimization that should be done +to the pattern prior to parsing and using it for matches. + +Globstar parts `**` are always converted to `*` when `noglobstar` +is set, and multiple adjacent `**` parts are converted into a +single `**` (ie, `a/**/**/b` will be treated as `a/**/b`, as this +is equivalent in all cases). + +- `0` - Make no further changes. In this mode, `.` and `..` are + maintained in the pattern, meaning that they must also appear + in the same position in the test path string. Eg, a pattern + like `a/*/../c` will match the string `a/b/../c` but not the + string `a/c`. +- `1` - (default) Remove cases where a double-dot `..` follows a + pattern portion that is not `**`, `.`, `..`, or empty `''`. For + example, the pattern `./a/b/../*` is converted to `./a/*`, and + so it will match the path string `./a/c`, but not the path + string `./a/b/../c`. Dots and empty path portions in the + pattern are preserved. +- `2` (or higher) - Much more aggressive optimizations, suitable + for use with file-walking cases: + - Remove cases where a double-dot `..` follows a pattern + portion that is not `**`, `.`, or empty `''`. Remove empty + and `.` portions of the pattern, where safe to do so (ie, + anywhere other than the last position, the first position, or + the second position in a pattern starting with `/`, as this + may indicate a UNC path on Windows). + - Convert patterns containing `
/**/../

/` into the + equivalent `

/{..,**}/

/`, where `

` is a + a pattern portion other than `.`, `..`, `**`, or empty + `''`. + - Dedupe patterns where a `**` portion is present in one and + omitted in another, and it is not the final path portion, and + they are otherwise equivalent. So `{a/**/b,a/b}` becomes + `a/**/b`, because `**` matches against an empty path portion. + - Dedupe patterns where a `*` portion is present in one, and a + non-dot pattern other than `**`, `.`, `..`, or `''` is in the + same position in the other. So `a/{*,x}/b` becomes `a/*/b`, + because `*` can match against `x`. + + While these optimizations improve the performance of + file-walking use cases such as [glob](http://npm.im/glob) (ie, + the reason this module exists), there are cases where it will + fail to match a literal string that would have been matched in + optimization level 1 or 0. + + Specifically, while the `Minimatch.match()` method will + optimize the file path string in the same ways, resulting in + the same matches, it will fail when tested with the regular + expression provided by `Minimatch.makeRe()`, unless the path + string is first processed with + `minimatch.levelTwoFileOptimize()` or similar. + +### platform + +When set to `win32`, this will trigger all windows-specific +behaviors (special handling for UNC paths, and treating `\` as +separators in file paths for comparison.) + +Defaults to the value of `process.platform`. + +### maxGlobstarRecursion + +Max number of non-adjacent `**` patterns to recursively walk +down. + +The default of `200` is almost certainly high enough for most +purposes, and can handle absurdly excessive patterns. + +If the limit is exceeded (which would require very excessively +long patterns and paths containing lots of `**` patterns!), then +it is treated as non-matching, even if the path would normally +match the pattern provided. + +That is, this is an intentional false negative, deemed an +acceptable break in correctness for security and performance. + +### maxExtglobRecursion + +Max depth to traverse for nested extglobs like `*(a|b|c)` + +Default is 2, which is quite low, but any higher value swiftly +results in punishing performance impacts. Note that this is _not_ +relevant when the globstar types can be safely coalesced into a +single set. + +For example, `*(a|@(b|c)|d)` would be flattened into +`*(a|b|c|d)`. Thus, many common extglobs will retain good +performance and never hit this limit, even if they are +excessively deep and complicated. + +If the limit is hit, then the extglob characters are simply not +parsed, and the pattern effectively switches into `noextglob: +true` mode for the contents of that nested sub-pattern. This will +typically _not_ result in a match, but is considered a valid +trade-off for security and performance. + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a +worthwhile goal, some discrepancies exist between minimatch and +other implementations. Some are intentional, and some are +unavoidable. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +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.1, 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. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.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. + +Negated extglob patterns are handled as closely as possible to +Bash semantics, but there are some cases with negative extglobs +which are exceedingly difficult to express in a JavaScript +regular expression. In particular the negated pattern +`!(*|)*` will in bash match anything that does +not start with ``. However, +`!(*)*` _will_ match paths starting with +``, because the empty string can match against +the negated portion. In this library, `!(*|)*` +will _not_ match any pattern starting with ``, due to a +difference in precisely which patterns are considered "greedy" in +Regular Expressions vs bash path expansion. This may be fixable, +but not without incurring some complexity and performance costs, +and the trade-off seems to not be worth pursuing. + +Note that `fnmatch(3)` in libc is an extremely naive string comparison +matcher, which does not do anything special for slashes. This library is +designed to be used in glob searching and file walkers, and so it does do +special things with `/`. Thus, `foo*` will not match `foo/bar` in this +library, even though it would in `fnmatch(3)`. diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..34d7a78a0c514479118614db25b5bb9c1b1706f2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts @@ -0,0 +1,2 @@ +export declare const assertValidPattern: (pattern: unknown) => void; +//# sourceMappingURL=assert-valid-pattern.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..30ddcd51f6eae80e97bc753145194c71fd1cbad2 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js new file mode 100644 index 0000000000000000000000000000000000000000..5fc86bbd0116c9b0e2579cb27de4ad53af938fc6 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertValidPattern = void 0; +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = (pattern) => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern'); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long'); + } +}; +exports.assertValidPattern = assertValidPattern; +//# sourceMappingURL=assert-valid-pattern.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map new file mode 100644 index 0000000000000000000000000000000000000000..9fc27a931c7e3feedf326df1a48a52b886f58cfb --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n pattern: unknown,\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..74f2cf9322b97504fa4d6eb29dbe74222a4449ba --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.d.ts @@ -0,0 +1,22 @@ +import type { MinimatchOptions, MMRegExp } from './index.js'; +export type ExtglobType = '!' | '?' | '+' | '*' | '@'; +export declare class AST { + #private; + type: ExtglobType | null; + id: number; + get depth(): number; + constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions); + get hasMagic(): boolean | undefined; + toString(): string; + push(...parts: (string | AST)[]): void; + toJSON(): unknown[]; + isStart(): boolean; + isEnd(): boolean; + copyIn(part: AST | string): void; + clone(parent: AST): AST; + static fromGlob(pattern: string, options?: MinimatchOptions): AST; + toMMPattern(): MMRegExp | string; + get options(): MinimatchOptions; + toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean]; +} +//# sourceMappingURL=ast.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..8965fd6a99ff91e22cd5de1f2c41563a673b8dc0 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js new file mode 100644 index 0000000000000000000000000000000000000000..33df3769f3ca063f574b30d862942ba36b956a58 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js @@ -0,0 +1,845 @@ +"use strict"; +// parse a single path portion +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AST = void 0; +const brace_expressions_js_1 = require("./brace-expressions.js"); +const unescape_js_1 = require("./unescape.js"); +const types = new Set(['!', '?', '+', '*', '@']); +const isExtglobType = (c) => types.has(c); +const isExtglobAST = (c) => isExtglobType(c.type); +// Map of which extglob types can adopt the children of a nested extglob +// +// anything but ! can adopt a matching type: +// +(a|+(b|c)|d) => +(a|b|c|d) +// *(a|*(b|c)|d) => *(a|b|c|d) +// @(a|@(b|c)|d) => @(a|b|c|d) +// ?(a|?(b|c)|d) => ?(a|b|c|d) +// +// * can adopt anything, because 0 or repetition is allowed +// *(a|?(b|c)|d) => *(a|b|c|d) +// *(a|+(b|c)|d) => *(a|b|c|d) +// *(a|@(b|c)|d) => *(a|b|c|d) +// +// + can adopt @, because 1 or repetition is allowed +// +(a|@(b|c)|d) => +(a|b|c|d) +// +// + and @ CANNOT adopt *, because 0 would be allowed +// +(a|*(b|c)|d) => would match "", on *(b|c) +// @(a|*(b|c)|d) => would match "", on *(b|c) +// +// + and @ CANNOT adopt ?, because 0 would be allowed +// +(a|?(b|c)|d) => would match "", on ?(b|c) +// @(a|?(b|c)|d) => would match "", on ?(b|c) +// +// ? can adopt @, because 0 or 1 is allowed +// ?(a|@(b|c)|d) => ?(a|b|c|d) +// +// ? and @ CANNOT adopt * or +, because >1 would be allowed +// ?(a|*(b|c)|d) => would match bbb on *(b|c) +// @(a|*(b|c)|d) => would match bbb on *(b|c) +// ?(a|+(b|c)|d) => would match bbb on +(b|c) +// @(a|+(b|c)|d) => would match bbb on +(b|c) +// +// ! CANNOT adopt ! (nothing else can either) +// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c) +// +// ! can adopt @ +// !(a|@(b|c)|d) => !(a|b|c|d) +// +// ! CANNOT adopt * +// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed +// +// ! CANNOT adopt + +// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed +// +// ! CANNOT adopt ? +// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x" +const adoptionMap = new Map([ + ['!', ['@']], + ['?', ['?', '@']], + ['@', ['@']], + ['*', ['*', '+', '?', '@']], + ['+', ['+', '@']], +]); +// nested extglobs that can be adopted in, but with the addition of +// a blank '' element. +const adoptionWithSpaceMap = new Map([ + ['!', ['?']], + ['@', ['?']], + ['+', ['?', '*']], +]); +// union of the previous two maps +const adoptionAnyMap = new Map([ + ['!', ['?', '@']], + ['?', ['?', '@']], + ['@', ['?', '@']], + ['*', ['*', '+', '?', '@']], + ['+', ['+', '@', '?', '*']], +]); +// Extglobs that can take over their parent if they are the only child +// the key is parent, value maps child to resulting extglob parent type +// '@' is omitted because it's a special case. An `@` extglob with a single +// member can always be usurped by that subpattern. +const usurpMap = new Map([ + ['!', new Map([['!', '@']])], + [ + '?', + new Map([ + ['*', '*'], + ['+', '*'], + ]), + ], + [ + '@', + new Map([ + ['!', '!'], + ['?', '?'], + ['@', '@'], + ['*', '*'], + ['+', '+'], + ]), + ], + [ + '+', + new Map([ + ['?', '*'], + ['*', '*'], + ]), + ], +]); +// Patterns that get prepended to bind to the start of either the +// entire string, or just a single path portion, to prevent dots +// and/or traversal patterns, when needed. +// Exts don't need the ^ or / bit, because the root binds that already. +const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; +const startNoDot = '(?!\\.)'; +// characters that indicate a start of pattern needs the "no dots" bit, +// because a dot *might* be matched. ( is not in the list, because in +// the case of a child extglob, it will handle the prevention itself. +const addPatternStart = new Set(['[', '.']); +// cases where traversal is A-OK, no dot prevention needed +const justDots = new Set(['..', '.']); +const reSpecials = new Set('().*{}+?[]^$\\!'); +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// any single thing other than / +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// use + when we need to ensure that *something* matches, because the * is +// the only thing in the path portion. +const starNoEmpty = qmark + '+?'; +// remove the \ chars that we added if we end up doing a nonmagic compare +// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') +let ID = 0; +class AST { + type; + #root; + #hasMagic; + #uflag = false; + #parts = []; + #parent; + #parentIndex; + #negs; + #filledNegs = false; + #options; + #toString; + // set to true if it's an extglob with no children + // (which really means one child of '') + #emptyExt = false; + id = ++ID; + get depth() { + return (this.#parent?.depth ?? -1) + 1; + } + [Symbol.for('nodejs.util.inspect.custom')]() { + return { + '@@type': 'AST', + id: this.id, + type: this.type, + root: this.#root.id, + parent: this.#parent?.id, + depth: this.depth, + partsLength: this.#parts.length, + parts: this.#parts, + }; + } + constructor(type, parent, options = {}) { + this.type = type; + // extglobs are inherently magical + if (type) + this.#hasMagic = true; + this.#parent = parent; + this.#root = this.#parent ? this.#parent.#root : this; + this.#options = this.#root === this ? options : this.#root.#options; + this.#negs = this.#root === this ? [] : this.#root.#negs; + if (type === '!' && !this.#root.#filledNegs) + this.#negs.push(this); + this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; + } + get hasMagic() { + /* c8 ignore start */ + if (this.#hasMagic !== undefined) + return this.#hasMagic; + /* c8 ignore stop */ + for (const p of this.#parts) { + if (typeof p === 'string') + continue; + if (p.type || p.hasMagic) + return (this.#hasMagic = true); + } + // note: will be undefined until we generate the regexp src and find out + return this.#hasMagic; + } + // reconstructs the pattern + toString() { + return (this.#toString !== undefined ? this.#toString + : !this.type ? + (this.#toString = this.#parts.map(p => String(p)).join('')) + : (this.#toString = + this.type + + '(' + + this.#parts.map(p => String(p)).join('|') + + ')')); + } + #fillNegs() { + /* c8 ignore start */ + if (this !== this.#root) + throw new Error('should only call on root'); + if (this.#filledNegs) + return this; + /* c8 ignore stop */ + // call toString() once to fill this out + this.toString(); + this.#filledNegs = true; + let n; + while ((n = this.#negs.pop())) { + if (n.type !== '!') + continue; + // walk up the tree, appending everthing that comes AFTER parentIndex + let p = n; + let pp = p.#parent; + while (pp) { + for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { + for (const part of n.#parts) { + /* c8 ignore start */ + if (typeof part === 'string') { + throw new Error('string part in extglob AST??'); + } + /* c8 ignore stop */ + part.copyIn(pp.#parts[i]); + } + } + p = pp; + pp = p.#parent; + } + } + return this; + } + push(...parts) { + for (const p of parts) { + if (p === '') + continue; + /* c8 ignore start */ + if (typeof p !== 'string' && + !(p instanceof _a && p.#parent === this)) { + throw new Error('invalid part: ' + p); + } + /* c8 ignore stop */ + this.#parts.push(p); + } + } + toJSON() { + const ret = this.type === null ? + this.#parts + .slice() + .map(p => (typeof p === 'string' ? p : p.toJSON())) + : [this.type, ...this.#parts.map(p => p.toJSON())]; + if (this.isStart() && !this.type) + ret.unshift([]); + if (this.isEnd() && + (this === this.#root || + (this.#root.#filledNegs && this.#parent?.type === '!'))) { + ret.push({}); + } + return ret; + } + isStart() { + if (this.#root === this) + return true; + // if (this.type) return !!this.#parent?.isStart() + if (!this.#parent?.isStart()) + return false; + if (this.#parentIndex === 0) + return true; + // if everything AHEAD of this is a negation, then it's still the "start" + const p = this.#parent; + for (let i = 0; i < this.#parentIndex; i++) { + const pp = p.#parts[i]; + if (!(pp instanceof _a && pp.type === '!')) { + return false; + } + } + return true; + } + isEnd() { + if (this.#root === this) + return true; + if (this.#parent?.type === '!') + return true; + if (!this.#parent?.isEnd()) + return false; + if (!this.type) + return this.#parent?.isEnd(); + // if not root, it'll always have a parent + /* c8 ignore start */ + const pl = this.#parent ? this.#parent.#parts.length : 0; + /* c8 ignore stop */ + return this.#parentIndex === pl - 1; + } + copyIn(part) { + if (typeof part === 'string') + this.push(part); + else + this.push(part.clone(this)); + } + clone(parent) { + const c = new _a(this.type, parent); + for (const p of this.#parts) { + c.copyIn(p); + } + return c; + } + static #parseAST(str, ast, pos, opt, extDepth) { + const maxDepth = opt.maxExtglobRecursion ?? 2; + let escaping = false; + let inBrace = false; + let braceStart = -1; + let braceNeg = false; + if (ast.type === null) { + // outside of a extglob, append until we find a start + let i = pos; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + // we don't have to check for adoption here, because that's + // done at the other recursion point. + const doRecurse = !opt.noext && + isExtglobType(c) && + str.charAt(i) === '(' && + extDepth <= maxDepth; + if (doRecurse) { + ast.push(acc); + acc = ''; + const ext = new _a(c, ast); + i = _a.#parseAST(str, ext, i, opt, extDepth + 1); + ast.push(ext); + continue; + } + acc += c; + } + ast.push(acc); + return i; + } + // some kind of extglob, pos is at the ( + // find the next | or ) + let i = pos + 1; + let part = new _a(null, ast); + const parts = []; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + const doRecurse = !opt.noext && + isExtglobType(c) && + str.charAt(i) === '(' && + /* c8 ignore start - the maxDepth is sufficient here */ + (extDepth <= maxDepth || (ast && ast.#canAdoptType(c))); + /* c8 ignore stop */ + if (doRecurse) { + const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1; + part.push(acc); + acc = ''; + const ext = new _a(c, part); + part.push(ext); + i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd); + continue; + } + if (c === '|') { + part.push(acc); + acc = ''; + parts.push(part); + part = new _a(null, ast); + continue; + } + if (c === ')') { + if (acc === '' && ast.#parts.length === 0) { + ast.#emptyExt = true; + } + part.push(acc); + acc = ''; + ast.push(...parts, part); + return i; + } + acc += c; + } + // unfinished extglob + // if we got here, it was a malformed extglob! not an extglob, but + // maybe something else in there. + ast.type = null; + ast.#hasMagic = undefined; + ast.#parts = [str.substring(pos - 1)]; + return i; + } + #canAdoptWithSpace(child) { + return this.#canAdopt(child, adoptionWithSpaceMap); + } + #canAdopt(child, map = adoptionMap) { + if (!child || + typeof child !== 'object' || + child.type !== null || + child.#parts.length !== 1 || + this.type === null) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== 'object' || gc.type === null) { + return false; + } + return this.#canAdoptType(gc.type, map); + } + #canAdoptType(c, map = adoptionAnyMap) { + return !!map.get(this.type)?.includes(c); + } + #adoptWithSpace(child, index) { + const gc = child.#parts[0]; + const blank = new _a(null, gc, this.options); + blank.#parts.push(''); + gc.push(blank); + this.#adopt(child, index); + } + #adopt(child, index) { + const gc = child.#parts[0]; + this.#parts.splice(index, 1, ...gc.#parts); + for (const p of gc.#parts) { + if (typeof p === 'object') + p.#parent = this; + } + this.#toString = undefined; + } + #canUsurpType(c) { + const m = usurpMap.get(this.type); + return !!m?.has(c); + } + #canUsurp(child) { + if (!child || + typeof child !== 'object' || + child.type !== null || + child.#parts.length !== 1 || + this.type === null || + this.#parts.length !== 1) { + return false; + } + const gc = child.#parts[0]; + if (!gc || typeof gc !== 'object' || gc.type === null) { + return false; + } + return this.#canUsurpType(gc.type); + } + #usurp(child) { + const m = usurpMap.get(this.type); + const gc = child.#parts[0]; + const nt = m?.get(gc.type); + /* c8 ignore start - impossible */ + if (!nt) + return false; + /* c8 ignore stop */ + this.#parts = gc.#parts; + for (const p of this.#parts) { + if (typeof p === 'object') { + p.#parent = this; + } + } + this.type = nt; + this.#toString = undefined; + this.#emptyExt = false; + } + static fromGlob(pattern, options = {}) { + const ast = new _a(null, undefined, options); + _a.#parseAST(pattern, ast, 0, options, 0); + return ast; + } + // returns the regular expression if there's magic, or the unescaped + // string if not. + toMMPattern() { + // should only be called on root + /* c8 ignore start */ + if (this !== this.#root) + return this.#root.toMMPattern(); + /* c8 ignore stop */ + const glob = this.toString(); + const [re, body, hasMagic, uflag] = this.toRegExpSource(); + // if we're in nocase mode, and not nocaseMagicOnly, then we do + // still need a regular expression if we have to case-insensitively + // match capital/lowercase characters. + const anyMagic = hasMagic || + this.#hasMagic || + (this.#options.nocase && + !this.#options.nocaseMagicOnly && + glob.toUpperCase() !== glob.toLowerCase()); + if (!anyMagic) { + return body; + } + const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); + return Object.assign(new RegExp(`^${re}$`, flags), { + _src: re, + _glob: glob, + }); + } + get options() { + return this.#options; + } + // returns the string match, the regexp source, whether there's magic + // in the regexp (so a regular expression is required) and whether or + // not the uflag is needed for the regular expression (for posix classes) + // TODO: instead of injecting the start/end at this point, just return + // the BODY of the regexp, along with the start/end portions suitable + // for binding the start/end in either a joined full-path makeRe context + // (where we bind to (^|/), or a standalone matchPart context (where + // we bind to ^, and not /). Otherwise slashes get duped! + // + // In part-matching mode, the start is: + // - if not isStart: nothing + // - if traversal possible, but not allowed: ^(?!\.\.?$) + // - if dots allowed or not possible: ^ + // - if dots possible and not allowed: ^(?!\.) + // end is: + // - if not isEnd(): nothing + // - else: $ + // + // In full-path matching mode, we put the slash at the START of the + // pattern, so start is: + // - if first pattern: same as part-matching mode + // - if not isStart(): nothing + // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) + // - if dots allowed or not possible: / + // - if dots possible and not allowed: /(?!\.) + // end is: + // - if last pattern, same as part-matching mode + // - else nothing + // + // Always put the (?:$|/) on negated tails, though, because that has to be + // there to bind the end of the negated pattern portion, and it's easier to + // just stick it in now rather than try to inject it later in the middle of + // the pattern. + // + // We can just always return the same end, and leave it up to the caller + // to know whether it's going to be used joined or in parts. + // And, if the start is adjusted slightly, can do the same there: + // - if not isStart: nothing + // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) + // - if dots allowed or not possible: (?:/|^) + // - if dots possible and not allowed: (?:/|^)(?!\.) + // + // But it's better to have a simpler binding without a conditional, for + // performance, so probably better to return both start options. + // + // Then the caller just ignores the end if it's not the first pattern, + // and the start always gets applied. + // + // But that's always going to be $ if it's the ending pattern, or nothing, + // so the caller can just attach $ at the end of the pattern when building. + // + // So the todo is: + // - better detect what kind of start is needed + // - return both flavors of starting pattern + // - attach $ at the end of the pattern when creating the actual RegExp + // + // Ah, but wait, no, that all only applies to the root when the first pattern + // is not an extglob. If the first pattern IS an extglob, then we need all + // that dot prevention biz to live in the extglob portions, because eg + // +(*|.x*) can match .xy but not .yx. + // + // So, return the two flavors if it's #root and the first child is not an + // AST, otherwise leave it to the child AST to handle it, and there, + // use the (?:^|/) style of start binding. + // + // Even simplified further: + // - Since the start for a join is eg /(?!\.) and the start for a part + // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root + // or start or whatever) and prepend ^ or / at the Regexp construction. + toRegExpSource(allowDot) { + const dot = allowDot ?? !!this.#options.dot; + if (this.#root === this) { + this.#flatten(); + this.#fillNegs(); + } + if (!isExtglobAST(this)) { + const noEmpty = this.isStart() && + this.isEnd() && + !this.#parts.some(s => typeof s !== 'string'); + const src = this.#parts + .map(p => { + const [re, _, hasMagic, uflag] = typeof p === 'string' ? + _a.#parseGlob(p, this.#hasMagic, noEmpty) + : p.toRegExpSource(allowDot); + this.#hasMagic = this.#hasMagic || hasMagic; + this.#uflag = this.#uflag || uflag; + return re; + }) + .join(''); + let start = ''; + if (this.isStart()) { + if (typeof this.#parts[0] === 'string') { + // this is the string that will match the start of the pattern, + // so we need to protect against dots and such. + // '.' and '..' cannot match unless the pattern is that exactly, + // even if it starts with . or dot:true is set. + const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); + if (!dotTravAllowed) { + const aps = addPatternStart; + // check if we have a possibility of matching . or .., + // and prevent that. + const needNoTrav = + // dots are allowed, and the pattern starts with [ or . + (dot && aps.has(src.charAt(0))) || + // the pattern starts with \., and then [ or . + (src.startsWith('\\.') && aps.has(src.charAt(2))) || + // the pattern starts with \.\., and then [ or . + (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); + // no need to prevent dots if it can't match a dot, or if a + // sub-pattern will be preventing it anyway. + const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); + start = + needNoTrav ? startNoTraversal + : needNoDot ? startNoDot + : ''; + } + } + } + // append the "end of path portion" pattern to negation tails + let end = ''; + if (this.isEnd() && + this.#root.#filledNegs && + this.#parent?.type === '!') { + end = '(?:$|\\/)'; + } + const final = start + src + end; + return [ + final, + (0, unescape_js_1.unescape)(src), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + // We need to calculate the body *twice* if it's a repeat pattern + // at the start, once in nodot mode, then again in dot mode, so a + // pattern like *(?) can match 'x.y' + const repeated = this.type === '*' || this.type === '+'; + // some kind of extglob + const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; + let body = this.#partsToRegExp(dot); + if (this.isStart() && this.isEnd() && !body && this.type !== '!') { + // invalid extglob, has to at least be *something* present, if it's + // the entire path portion. + const s = this.toString(); + const me = this; + me.#parts = [s]; + me.type = null; + me.#hasMagic = undefined; + return [s, (0, unescape_js_1.unescape)(this.toString()), false, false]; + } + let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? + '' + : this.#partsToRegExp(true); + if (bodyDotAllowed === body) { + bodyDotAllowed = ''; + } + if (bodyDotAllowed) { + body = `(?:${body})(?:${bodyDotAllowed})*?`; + } + // an empty !() is exactly equivalent to a starNoEmpty + let final = ''; + if (this.type === '!' && this.#emptyExt) { + final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; + } + else { + const close = this.type === '!' ? + // !() must match something,but !(x) can match '' + '))' + + (this.isStart() && !dot && !allowDot ? startNoDot : '') + + star + + ')' + : this.type === '@' ? ')' + : this.type === '?' ? ')?' + : this.type === '+' && bodyDotAllowed ? ')' + : this.type === '*' && bodyDotAllowed ? `)?` + : `)${this.type}`; + final = start + body + close; + } + return [ + final, + (0, unescape_js_1.unescape)(body), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + #flatten() { + if (!isExtglobAST(this)) { + for (const p of this.#parts) { + if (typeof p === 'object') { + p.#flatten(); + } + } + } + else { + // do up to 10 passes to flatten as much as possible + let iterations = 0; + let done = false; + do { + done = true; + for (let i = 0; i < this.#parts.length; i++) { + const c = this.#parts[i]; + if (typeof c === 'object') { + c.#flatten(); + if (this.#canAdopt(c)) { + done = false; + this.#adopt(c, i); + } + else if (this.#canAdoptWithSpace(c)) { + done = false; + this.#adoptWithSpace(c, i); + } + else if (this.#canUsurp(c)) { + done = false; + this.#usurp(c); + } + } + } + } while (!done && ++iterations < 10); + } + this.#toString = undefined; + } + #partsToRegExp(dot) { + return this.#parts + .map(p => { + // extglob ASTs should only contain parent ASTs + /* c8 ignore start */ + if (typeof p === 'string') { + throw new Error('string type in extglob ast??'); + } + /* c8 ignore stop */ + // can ignore hasMagic, because extglobs are already always magic + const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); + this.#uflag = this.#uflag || uflag; + return re; + }) + .filter(p => !(this.isStart() && this.isEnd()) || !!p) + .join('|'); + } + static #parseGlob(glob, hasMagic, noEmpty = false) { + let escaping = false; + let re = ''; + let uflag = false; + // multiple stars that aren't globstars coalesce into one * + let inStar = false; + for (let i = 0; i < glob.length; i++) { + const c = glob.charAt(i); + if (escaping) { + escaping = false; + re += (reSpecials.has(c) ? '\\' : '') + c; + continue; + } + if (c === '*') { + if (inStar) + continue; + inStar = true; + re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star; + hasMagic = true; + continue; + } + else { + inStar = false; + } + if (c === '\\') { + if (i === glob.length - 1) { + re += '\\\\'; + } + else { + escaping = true; + } + continue; + } + if (c === '[') { + const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i); + if (consumed) { + re += src; + uflag = uflag || needUflag; + i += consumed - 1; + hasMagic = hasMagic || magic; + continue; + } + } + if (c === '?') { + re += qmark; + hasMagic = true; + continue; + } + re += regExpEscape(c); + } + return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag]; + } +} +exports.AST = AST; +_a = AST; +//# sourceMappingURL=ast.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js.map new file mode 100644 index 0000000000000000000000000000000000000000..3498fb2631bc2968f6e8e7b04b5adbbe2f29e6ed --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/ast.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":";AAAA,8BAA8B;;;;AAE9B,iEAAmD;A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BACX,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;YACD,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,IAAA,sBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF;AArxBD,kBAqxBC","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport type { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n// 1 2 3 4 5 6 1 2 3 46 5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n// v----- .* because there's more following,\n// v v otherwise, .+ because it must be\n// v v *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n// copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string | null): c is ExtglobType =>\n types.has(c as ExtglobType)\nconst isExtglobAST = (c: AST): c is AST & { type: ExtglobType } =>\n isExtglobType(c.type)\n\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n ['!', ['@']],\n ['?', ['?', '@']],\n ['@', ['@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@']],\n])\n\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n ['!', ['?']],\n ['@', ['?']],\n ['+', ['?', '*']],\n])\n\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n ['!', ['?', '@']],\n ['?', ['?', '@']],\n ['@', ['?', '@']],\n ['*', ['*', '+', '?', '@']],\n ['+', ['+', '@', '?', '*']],\n])\n\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map<\n ExtglobType,\n Map\n>([\n ['!', new Map([['!', '@']])],\n [\n '?',\n new Map([\n ['*', '*'],\n ['+', '*'],\n ]),\n ],\n [\n '@',\n new Map([\n ['!', '!'],\n ['?', '?'],\n ['@', '@'],\n ['*', '*'],\n ['+', '+'],\n ]),\n ],\n [\n '+',\n new Map([\n ['?', '*'],\n ['*', '*'],\n ]),\n ],\n])\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nlet ID = 0\nexport class AST {\n type: ExtglobType | null\n readonly #root: AST\n\n #hasMagic?: boolean\n #uflag: boolean = false\n #parts: (string | AST)[] = []\n #parent?: AST\n #parentIndex: number\n #negs: AST[]\n #filledNegs: boolean = false\n #options: MinimatchOptions\n #toString?: string\n // set to true if it's an extglob with no children\n // (which really means one child of '')\n #emptyExt: boolean = false\n id = ++ID\n\n get depth(): number {\n return (this.#parent?.depth ?? -1) + 1\n }\n\n [Symbol.for('nodejs.util.inspect.custom')]() {\n return {\n '@@type': 'AST',\n id: this.id,\n type: this.type,\n root: this.#root.id,\n parent: this.#parent?.id,\n depth: this.depth,\n partsLength: this.#parts.length,\n parts: this.#parts,\n }\n }\n\n constructor(\n type: ExtglobType | null,\n parent?: AST,\n options: MinimatchOptions = {},\n ) {\n this.type = type\n // extglobs are inherently magical\n if (type) this.#hasMagic = true\n this.#parent = parent\n this.#root = this.#parent ? this.#parent.#root : this\n this.#options = this.#root === this ? options : this.#root.#options\n this.#negs = this.#root === this ? [] : this.#root.#negs\n if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n }\n\n get hasMagic(): boolean | undefined {\n /* c8 ignore start */\n if (this.#hasMagic !== undefined) return this.#hasMagic\n /* c8 ignore stop */\n for (const p of this.#parts) {\n if (typeof p === 'string') continue\n if (p.type || p.hasMagic) return (this.#hasMagic = true)\n }\n // note: will be undefined until we generate the regexp src and find out\n return this.#hasMagic\n }\n\n // reconstructs the pattern\n toString(): string {\n return (\n this.#toString !== undefined ? this.#toString\n : !this.type ?\n (this.#toString = this.#parts.map(p => String(p)).join(''))\n : (this.#toString =\n this.type +\n '(' +\n this.#parts.map(p => String(p)).join('|') +\n ')')\n )\n }\n\n #fillNegs() {\n /* c8 ignore start */\n if (this !== this.#root) throw new Error('should only call on root')\n if (this.#filledNegs) return this\n /* c8 ignore stop */\n\n // call toString() once to fill this out\n this.toString()\n this.#filledNegs = true\n let n: AST | undefined\n while ((n = this.#negs.pop())) {\n if (n.type !== '!') continue\n // walk up the tree, appending everthing that comes AFTER parentIndex\n let p: AST | undefined = n\n let pp = p.#parent\n while (pp) {\n for (\n let i = p.#parentIndex + 1;\n !pp.type && i < pp.#parts.length;\n i++\n ) {\n for (const part of n.#parts) {\n /* c8 ignore start */\n if (typeof part === 'string') {\n throw new Error('string part in extglob AST??')\n }\n /* c8 ignore stop */\n part.copyIn(pp.#parts[i])\n }\n }\n p = pp\n pp = p.#parent\n }\n }\n return this\n }\n\n push(...parts: (string | AST)[]) {\n for (const p of parts) {\n if (p === '') continue\n /* c8 ignore start */\n if (\n typeof p !== 'string' &&\n !(p instanceof AST && p.#parent === this)\n ) {\n throw new Error('invalid part: ' + p)\n }\n /* c8 ignore stop */\n this.#parts.push(p)\n }\n }\n\n toJSON() {\n const ret: unknown[] =\n this.type === null ?\n this.#parts\n .slice()\n .map(p => (typeof p === 'string' ? p : p.toJSON()))\n : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n if (this.isStart() && !this.type) ret.unshift([])\n if (\n this.isEnd() &&\n (this === this.#root ||\n (this.#root.#filledNegs && this.#parent?.type === '!'))\n ) {\n ret.push({})\n }\n return ret\n }\n\n isStart(): boolean {\n if (this.#root === this) return true\n // if (this.type) return !!this.#parent?.isStart()\n if (!this.#parent?.isStart()) return false\n if (this.#parentIndex === 0) return true\n // if everything AHEAD of this is a negation, then it's still the \"start\"\n const p = this.#parent\n for (let i = 0; i < this.#parentIndex; i++) {\n const pp = p.#parts[i]\n if (!(pp instanceof AST && pp.type === '!')) {\n return false\n }\n }\n return true\n }\n\n isEnd(): boolean {\n if (this.#root === this) return true\n if (this.#parent?.type === '!') return true\n if (!this.#parent?.isEnd()) return false\n if (!this.type) return this.#parent?.isEnd()\n // if not root, it'll always have a parent\n /* c8 ignore start */\n const pl = this.#parent ? this.#parent.#parts.length : 0\n /* c8 ignore stop */\n return this.#parentIndex === pl - 1\n }\n\n copyIn(part: AST | string) {\n if (typeof part === 'string') this.push(part)\n else this.push(part.clone(this))\n }\n\n clone(parent: AST) {\n const c = new AST(this.type, parent)\n for (const p of this.#parts) {\n c.copyIn(p)\n }\n return c\n }\n\n static #parseAST(\n str: string,\n ast: AST,\n pos: number,\n opt: MinimatchOptions,\n extDepth: number,\n ): number {\n const maxDepth = opt.maxExtglobRecursion ?? 2\n let escaping = false\n let inBrace = false\n let braceStart = -1\n let braceNeg = false\n if (ast.type === null) {\n // outside of a extglob, append until we find a start\n let i = pos\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n // we don't have to check for adoption here, because that's\n // done at the other recursion point.\n const doRecurse =\n !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n extDepth <= maxDepth\n if (doRecurse) {\n ast.push(acc)\n acc = ''\n const ext = new AST(c, ast)\n i = AST.#parseAST(str, ext, i, opt, extDepth + 1)\n ast.push(ext)\n continue\n }\n acc += c\n }\n ast.push(acc)\n return i\n }\n\n // some kind of extglob, pos is at the (\n // find the next | or )\n let i = pos + 1\n let part = new AST(null, ast)\n const parts: AST[] = []\n let acc = ''\n while (i < str.length) {\n const c = str.charAt(i++)\n // still accumulate escapes at this point, but we do ignore\n // starts that are escaped\n if (escaping || c === '\\\\') {\n escaping = !escaping\n acc += c\n continue\n }\n\n if (inBrace) {\n if (i === braceStart + 1) {\n if (c === '^' || c === '!') {\n braceNeg = true\n }\n } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n inBrace = false\n }\n acc += c\n continue\n } else if (c === '[') {\n inBrace = true\n braceStart = i\n braceNeg = false\n acc += c\n continue\n }\n\n const doRecurse =\n !opt.noext &&\n isExtglobType(c) &&\n str.charAt(i) === '(' &&\n /* c8 ignore start - the maxDepth is sufficient here */\n (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)))\n /* c8 ignore stop */\n if (doRecurse) {\n const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1\n part.push(acc)\n acc = ''\n const ext = new AST(c, part)\n part.push(ext)\n i = AST.#parseAST(str, ext, i, opt, extDepth + depthAdd)\n continue\n }\n if (c === '|') {\n part.push(acc)\n acc = ''\n parts.push(part)\n part = new AST(null, ast)\n continue\n }\n if (c === ')') {\n if (acc === '' && ast.#parts.length === 0) {\n ast.#emptyExt = true\n }\n part.push(acc)\n acc = ''\n ast.push(...parts, part)\n return i\n }\n acc += c\n }\n\n // unfinished extglob\n // if we got here, it was a malformed extglob! not an extglob, but\n // maybe something else in there.\n ast.type = null\n ast.#hasMagic = undefined\n ast.#parts = [str.substring(pos - 1)]\n return i\n }\n\n #canAdoptWithSpace(child?: AST | string): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n return this.#canAdopt(child, adoptionWithSpaceMap)\n }\n\n #canAdopt(\n child?: AST | string,\n map: Map = adoptionMap,\n ): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n if (\n !child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null\n ) {\n return false\n }\n const gc = child.#parts[0]\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false\n }\n return (this as AST & { type: ExtglobType }).#canAdoptType(\n gc.type,\n map,\n )\n }\n #canAdoptType(\n c: string,\n map: Map = adoptionAnyMap,\n ): c is ExtglobType {\n return !!map.get(this.type as ExtglobType)?.includes(c as ExtglobType)\n }\n\n #adoptWithSpace(\n this: AST & { type: ExtglobType },\n child: AST & {\n type: null\n },\n index: number,\n ) {\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n const blank = new AST(null, gc, this.options)\n blank.#parts.push('')\n gc.push(blank)\n this.#adopt(child, index)\n }\n\n #adopt(\n child: AST & {\n type: null\n },\n index: number,\n ) {\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n this.#parts.splice(index, 1, ...gc.#parts)\n for (const p of gc.#parts) {\n if (typeof p === 'object') p.#parent = this\n }\n this.#toString = undefined\n }\n\n #canUsurpType(c: string): boolean {\n const m = usurpMap.get(this.type as ExtglobType)\n return !!m?.has(c as ExtglobType)\n }\n\n #canUsurp(child?: AST | string): child is AST & {\n type: null\n parts: [AST & { type: ExtglobType }]\n } {\n if (\n !child ||\n typeof child !== 'object' ||\n child.type !== null ||\n child.#parts.length !== 1 ||\n this.type === null ||\n this.#parts.length !== 1\n ) {\n return false\n }\n const gc = child.#parts[0]\n if (!gc || typeof gc !== 'object' || gc.type === null) {\n return false\n }\n return (this as AST & { type: ExtglobType }).#canUsurpType(gc.type)\n }\n\n #usurp(this: AST & { type: ExtglobType }, child: AST & { type: null }) {\n const m = usurpMap.get(this.type as ExtglobType)\n const gc = child.#parts[0] as AST & { type: ExtglobType }\n const nt = m?.get(gc.type)\n /* c8 ignore start - impossible */\n if (!nt) return false\n /* c8 ignore stop */\n this.#parts = gc.#parts\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#parent = this\n }\n }\n this.type = nt\n this.#toString = undefined\n this.#emptyExt = false\n }\n\n static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n const ast = new AST(null, undefined, options)\n AST.#parseAST(pattern, ast, 0, options, 0)\n return ast\n }\n\n // returns the regular expression if there's magic, or the unescaped\n // string if not.\n toMMPattern(): MMRegExp | string {\n // should only be called on root\n /* c8 ignore start */\n if (this !== this.#root) return this.#root.toMMPattern()\n /* c8 ignore stop */\n const glob = this.toString()\n const [re, body, hasMagic, uflag] = this.toRegExpSource()\n // if we're in nocase mode, and not nocaseMagicOnly, then we do\n // still need a regular expression if we have to case-insensitively\n // match capital/lowercase characters.\n const anyMagic =\n hasMagic ||\n this.#hasMagic ||\n (this.#options.nocase &&\n !this.#options.nocaseMagicOnly &&\n glob.toUpperCase() !== glob.toLowerCase())\n if (!anyMagic) {\n return body\n }\n\n const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n return Object.assign(new RegExp(`^${re}$`, flags), {\n _src: re,\n _glob: glob,\n })\n }\n\n get options() {\n return this.#options\n }\n\n // returns the string match, the regexp source, whether there's magic\n // in the regexp (so a regular expression is required) and whether or\n // not the uflag is needed for the regular expression (for posix classes)\n // TODO: instead of injecting the start/end at this point, just return\n // the BODY of the regexp, along with the start/end portions suitable\n // for binding the start/end in either a joined full-path makeRe context\n // (where we bind to (^|/), or a standalone matchPart context (where\n // we bind to ^, and not /). Otherwise slashes get duped!\n //\n // In part-matching mode, the start is:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n // - if dots allowed or not possible: ^\n // - if dots possible and not allowed: ^(?!\\.)\n // end is:\n // - if not isEnd(): nothing\n // - else: $\n //\n // In full-path matching mode, we put the slash at the START of the\n // pattern, so start is:\n // - if first pattern: same as part-matching mode\n // - if not isStart(): nothing\n // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n // - if dots allowed or not possible: /\n // - if dots possible and not allowed: /(?!\\.)\n // end is:\n // - if last pattern, same as part-matching mode\n // - else nothing\n //\n // Always put the (?:$|/) on negated tails, though, because that has to be\n // there to bind the end of the negated pattern portion, and it's easier to\n // just stick it in now rather than try to inject it later in the middle of\n // the pattern.\n //\n // We can just always return the same end, and leave it up to the caller\n // to know whether it's going to be used joined or in parts.\n // And, if the start is adjusted slightly, can do the same there:\n // - if not isStart: nothing\n // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n // - if dots allowed or not possible: (?:/|^)\n // - if dots possible and not allowed: (?:/|^)(?!\\.)\n //\n // But it's better to have a simpler binding without a conditional, for\n // performance, so probably better to return both start options.\n //\n // Then the caller just ignores the end if it's not the first pattern,\n // and the start always gets applied.\n //\n // But that's always going to be $ if it's the ending pattern, or nothing,\n // so the caller can just attach $ at the end of the pattern when building.\n //\n // So the todo is:\n // - better detect what kind of start is needed\n // - return both flavors of starting pattern\n // - attach $ at the end of the pattern when creating the actual RegExp\n //\n // Ah, but wait, no, that all only applies to the root when the first pattern\n // is not an extglob. If the first pattern IS an extglob, then we need all\n // that dot prevention biz to live in the extglob portions, because eg\n // +(*|.x*) can match .xy but not .yx.\n //\n // So, return the two flavors if it's #root and the first child is not an\n // AST, otherwise leave it to the child AST to handle it, and there,\n // use the (?:^|/) style of start binding.\n //\n // Even simplified further:\n // - Since the start for a join is eg /(?!\\.) and the start for a part\n // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n // or start or whatever) and prepend ^ or / at the Regexp construction.\n toRegExpSource(\n allowDot?: boolean,\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n const dot = allowDot ?? !!this.#options.dot\n if (this.#root === this) {\n this.#flatten()\n this.#fillNegs()\n }\n if (!isExtglobAST(this)) {\n const noEmpty =\n this.isStart() &&\n this.isEnd() &&\n !this.#parts.some(s => typeof s !== 'string')\n const src = this.#parts\n .map(p => {\n const [re, _, hasMagic, uflag] =\n typeof p === 'string' ?\n AST.#parseGlob(p, this.#hasMagic, noEmpty)\n : p.toRegExpSource(allowDot)\n this.#hasMagic = this.#hasMagic || hasMagic\n this.#uflag = this.#uflag || uflag\n return re\n })\n .join('')\n\n let start = ''\n if (this.isStart()) {\n if (typeof this.#parts[0] === 'string') {\n // this is the string that will match the start of the pattern,\n // so we need to protect against dots and such.\n\n // '.' and '..' cannot match unless the pattern is that exactly,\n // even if it starts with . or dot:true is set.\n const dotTravAllowed =\n this.#parts.length === 1 && justDots.has(this.#parts[0])\n if (!dotTravAllowed) {\n const aps = addPatternStart\n // check if we have a possibility of matching . or ..,\n // and prevent that.\n const needNoTrav =\n // dots are allowed, and the pattern starts with [ or .\n (dot && aps.has(src.charAt(0))) ||\n // the pattern starts with \\., and then [ or .\n (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n // the pattern starts with \\.\\., and then [ or .\n (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n // no need to prevent dots if it can't match a dot, or if a\n // sub-pattern will be preventing it anyway.\n const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n start =\n needNoTrav ? startNoTraversal\n : needNoDot ? startNoDot\n : ''\n }\n }\n }\n\n // append the \"end of path portion\" pattern to negation tails\n let end = ''\n if (\n this.isEnd() &&\n this.#root.#filledNegs &&\n this.#parent?.type === '!'\n ) {\n end = '(?:$|\\\\/)'\n }\n const final = start + src + end\n return [\n final,\n unescape(src),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n // We need to calculate the body *twice* if it's a repeat pattern\n // at the start, once in nodot mode, then again in dot mode, so a\n // pattern like *(?) can match 'x.y'\n\n const repeated = this.type === '*' || this.type === '+'\n // some kind of extglob\n const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n let body = (this as AST & { type: ExtglobType }).#partsToRegExp(dot)\n\n if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n // invalid extglob, has to at least be *something* present, if it's\n // the entire path portion.\n const s = this.toString()\n const me = this as AST\n me.#parts = [s]\n me.type = null\n me.#hasMagic = undefined\n return [s, unescape(this.toString()), false, false]\n }\n\n let bodyDotAllowed =\n !repeated || allowDot || dot || !startNoDot ?\n ''\n : this.#partsToRegExp(true)\n if (bodyDotAllowed === body) {\n bodyDotAllowed = ''\n }\n if (bodyDotAllowed) {\n body = `(?:${body})(?:${bodyDotAllowed})*?`\n }\n\n // an empty !() is exactly equivalent to a starNoEmpty\n let final = ''\n if (this.type === '!' && this.#emptyExt) {\n final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n } else {\n const close =\n this.type === '!' ?\n // !() must match something,but !(x) can match ''\n '))' +\n (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n star +\n ')'\n : this.type === '@' ? ')'\n : this.type === '?' ? ')?'\n : this.type === '+' && bodyDotAllowed ? ')'\n : this.type === '*' && bodyDotAllowed ? `)?`\n : `)${this.type}`\n final = start + body + close\n }\n return [\n final,\n unescape(body),\n (this.#hasMagic = !!this.#hasMagic),\n this.#uflag,\n ]\n }\n\n #flatten() {\n if (!isExtglobAST(this)) {\n for (const p of this.#parts) {\n if (typeof p === 'object') {\n p.#flatten()\n }\n }\n } else {\n // do up to 10 passes to flatten as much as possible\n let iterations = 0\n let done = false\n do {\n done = true\n for (let i = 0; i < this.#parts.length; i++) {\n const c = this.#parts[i]\n if (typeof c === 'object') {\n c.#flatten()\n if (this.#canAdopt(c)) {\n done = false\n this.#adopt(c, i)\n } else if (this.#canAdoptWithSpace(c)) {\n done = false\n ;(this as AST & { type: ExtglobType }).#adoptWithSpace(c, i)\n } else if (this.#canUsurp(c)) {\n done = false\n ;(this as AST & { type: ExtglobType }).#usurp(c)\n }\n }\n }\n } while (!done && ++iterations < 10)\n }\n this.#toString = undefined\n }\n\n #partsToRegExp(this: AST & { type: ExtglobType }, dot: boolean) {\n return this.#parts\n .map(p => {\n // extglob ASTs should only contain parent ASTs\n /* c8 ignore start */\n if (typeof p === 'string') {\n throw new Error('string type in extglob ast??')\n }\n /* c8 ignore stop */\n // can ignore hasMagic, because extglobs are already always magic\n const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n this.#uflag = this.#uflag || uflag\n return re\n })\n .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n .join('|')\n }\n\n static #parseGlob(\n glob: string,\n hasMagic: boolean | undefined,\n noEmpty: boolean = false,\n ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n let escaping = false\n let re = ''\n let uflag = false\n // multiple stars that aren't globstars coalesce into one *\n let inStar = false\n for (let i = 0; i < glob.length; i++) {\n const c = glob.charAt(i)\n if (escaping) {\n escaping = false\n re += (reSpecials.has(c) ? '\\\\' : '') + c\n continue\n }\n if (c === '*') {\n if (inStar) continue\n inStar = true\n re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star\n hasMagic = true\n continue\n } else {\n inStar = false\n }\n if (c === '\\\\') {\n if (i === glob.length - 1) {\n re += '\\\\\\\\'\n } else {\n escaping = true\n }\n continue\n }\n if (c === '[') {\n const [src, needUflag, consumed, magic] = parseClass(glob, i)\n if (consumed) {\n re += src\n uflag = uflag || needUflag\n i += consumed - 1\n hasMagic = hasMagic || magic\n continue\n }\n }\n if (c === '?') {\n re += qmark\n hasMagic = true\n continue\n }\n re += regExpEscape(c)\n }\n return [re, unescape(glob), !!hasMagic, uflag]\n }\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1572deb95e2e376474f9fc1e56e4c38a055fbd1 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts @@ -0,0 +1,8 @@ +export type ParseClassResult = [ + src: string, + uFlag: boolean, + consumed: number, + hasMagic: boolean +]; +export declare const parseClass: (glob: string, position: number) => ParseClassResult; +//# sourceMappingURL=brace-expressions.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..09b4c11060de7850a23ad17948c7d5d674850576 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js new file mode 100644 index 0000000000000000000000000000000000000000..2b7b03712b874e29341dcb990f3b8b6163f145d4 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js @@ -0,0 +1,150 @@ +"use strict"; +// translate the various posix character classes into unicode properties +// this works across all unicode locales +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseClass = void 0; +// { : [, /u flag required, negated] +const posixClasses = { + '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], + '[:alpha:]': ['\\p{L}\\p{Nl}', true], + '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], + '[:blank:]': ['\\p{Zs}\\t', true], + '[:cntrl:]': ['\\p{Cc}', true], + '[:digit:]': ['\\p{Nd}', true], + '[:graph:]': ['\\p{Z}\\p{C}', true, true], + '[:lower:]': ['\\p{Ll}', true], + '[:print:]': ['\\p{C}', true], + '[:punct:]': ['\\p{P}', true], + '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], + '[:upper:]': ['\\p{Lu}', true], + '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], + '[:xdigit:]': ['A-Fa-f0-9', false], +}; +// only need to escape a few things inside of brace expressions +// escapes: [ \ ] - +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); +// escape all regexp magic characters +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// everything has already been escaped, we just have to join +const rangesToString = (ranges) => ranges.join(''); +// takes a glob string at a posix brace expression, and returns +// an equivalent regular expression source, and boolean indicating +// whether the /u flag needs to be applied, and the number of chars +// consumed to parse the character class. +// This also removes out of order ranges, and returns ($.) if the +// entire class just no good. +const parseClass = (glob, position) => { + const pos = position; + /* c8 ignore start */ + if (glob.charAt(pos) !== '[') { + throw new Error('not in a brace expression'); + } + /* c8 ignore stop */ + const ranges = []; + const negs = []; + let i = pos + 1; + let sawStart = false; + let uflag = false; + let escaping = false; + let negate = false; + let endPos = pos; + let rangeStart = ''; + WHILE: while (i < glob.length) { + const c = glob.charAt(i); + if ((c === '!' || c === '^') && i === pos + 1) { + negate = true; + i++; + continue; + } + if (c === ']' && sawStart && !escaping) { + endPos = i + 1; + break; + } + sawStart = true; + if (c === '\\') { + if (!escaping) { + escaping = true; + i++; + continue; + } + // escaped \ char, fall through and treat like normal char + } + if (c === '[' && !escaping) { + // either a posix class, a collation equivalent, or just a [ + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { + if (glob.startsWith(cls, i)) { + // invalid, [a-[] is fine, but not [a-[:alpha]] + if (rangeStart) { + return ['$.', false, glob.length - pos, true]; + } + i += cls.length; + if (neg) + negs.push(unip); + else + ranges.push(unip); + uflag = uflag || u; + continue WHILE; + } + } + } + // now it's just a normal character, effectively + escaping = false; + if (rangeStart) { + // throw this range away if it's not valid, but others + // can still match. + if (c > rangeStart) { + ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + } + else if (c === rangeStart) { + ranges.push(braceEscape(c)); + } + rangeStart = ''; + i++; + continue; + } + // now might be the start of a range. + // can be either c-d or c-] or c] or c] at this point + if (glob.startsWith('-]', i + 1)) { + ranges.push(braceEscape(c + '-')); + i += 2; + continue; + } + if (glob.startsWith('-', i + 1)) { + rangeStart = c; + i += 2; + continue; + } + // not the start of a range, just a single character + ranges.push(braceEscape(c)); + i++; + } + if (endPos < i) { + // didn't see the end of the class, not a valid class, + // but might still be valid as a literal match. + return ['', false, 0, false]; + } + // if we got no ranges and no negates, then we have a range that + // cannot possibly match anything, and that poisons the whole glob + if (!ranges.length && !negs.length) { + return ['$.', false, glob.length - pos, true]; + } + // if we got one positive range, and it's a single character, then that's + // not actually a magic pattern, it's just that one literal character. + // we should not treat that as "magic", we should just return the literal + // character. [_] is a perfectly valid way to escape glob magic chars. + if (negs.length === 0 && + ranges.length === 1 && + /^\\?.$/.test(ranges[0]) && + !negate) { + const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; + return [regexpEscape(r), false, endPos - pos, false]; + } + const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; + const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; + const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')' + : ranges.length ? sranges + : snegs; + return [comb, uflag, endPos - pos, true]; +}; +exports.parseClass = parseClass; +//# sourceMappingURL=brace-expressions.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js.map new file mode 100644 index 0000000000000000000000000000000000000000..3cc3b343b530fda9adc37982e4d80d6ac654d673 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/brace-expressions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace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AC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QAClE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;IACxE,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACpE,MAAM,IAAI,GACR,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG;QAChE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;YACzB,CAAC,CAAC,KAAK,CAAA;IAET,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAA;AA9HY,QAAA,UAAU,cA8HtB","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } =\n {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n '[:cntrl:]': ['\\\\p{Cc}', true],\n '[:digit:]': ['\\\\p{Nd}', true],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n '[:lower:]': ['\\\\p{Ll}', true],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}', true],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n '[:upper:]': ['\\\\p{Lu}', true],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n '[:xdigit:]': ['A-Fa-f0-9', false],\n }\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n src: string,\n uFlag: boolean,\n consumed: number,\n hasMagic: boolean,\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n glob: string,\n position: number,\n): ParseClassResult => {\n const pos = position\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression')\n }\n /* c8 ignore stop */\n const ranges: string[] = []\n const negs: string[] = []\n\n let i = pos + 1\n let sawStart = false\n let uflag = false\n let escaping = false\n let negate = false\n let endPos = pos\n let rangeStart = ''\n WHILE: while (i < glob.length) {\n const c = glob.charAt(i)\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true\n i++\n continue\n }\n\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1\n break\n }\n\n sawStart = true\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true\n i++\n continue\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return ['$.', false, glob.length - pos, true]\n }\n i += cls.length\n if (neg) negs.push(unip)\n else ranges.push(unip)\n uflag = uflag || u\n continue WHILE\n }\n }\n }\n\n // now it's just a normal character, effectively\n escaping = false\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (c > rangeStart) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n } else if (c === rangeStart) {\n ranges.push(braceEscape(c))\n }\n rangeStart = ''\n i++\n continue\n }\n\n // now might be the start of a range.\n // can be either c-d or c-] or c] or c] at this point\n if (glob.startsWith('-]', i + 1)) {\n ranges.push(braceEscape(c + '-'))\n i += 2\n continue\n }\n if (glob.startsWith('-', i + 1)) {\n rangeStart = c\n i += 2\n continue\n }\n\n // not the start of a range, just a single character\n ranges.push(braceEscape(c))\n i++\n }\n\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return ['', false, 0, false]\n }\n\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return ['$.', false, glob.length - pos, true]\n }\n\n // if we got one positive range, and it's a single character, then that's\n // not actually a magic pattern, it's just that one literal character.\n // we should not treat that as \"magic\", we should just return the literal\n // character. [_] is a perfectly valid way to escape glob magic chars.\n if (\n negs.length === 0 &&\n ranges.length === 1 &&\n /^\\\\?.$/.test(ranges[0]) &&\n !negate\n ) {\n const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n return [regexpEscape(r), false, endPos - pos, false]\n }\n\n const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n const comb =\n ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs\n\n return [comb, uflag, endPos - pos, true]\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..141024a06bdf747fe6d6ecc48a80675dff795800 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.d.ts @@ -0,0 +1,15 @@ +import type { MinimatchOptions } from './index.js'; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link MinimatchOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + * + * If the {@link MinimatchOptions.magicalBraces} option is used, + * then braces (`{` and `}`) will be escaped. + */ +export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; +//# sourceMappingURL=escape.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..e167e30065a04e54a37b3f6e6b44275c42c3c602 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAazE,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js new file mode 100644 index 0000000000000000000000000000000000000000..83a713a25507707b9071cc1a93be5a8fc20affd9 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.escape = void 0; +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link MinimatchOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + * + * If the {@link MinimatchOptions.magicalBraces} option is used, + * then braces (`{` and `}`) will be escaped. + */ +const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => { + // don't need to escape +@! because we escape the parens + // that make those magic, and escaping ! as [!] isn't valid, + // because [!]] is a valid glob class meaning not ']'. + if (magicalBraces) { + return windowsPathsNoEscape ? + s.replace(/[?*()[\]{}]/g, '[$&]') + : s.replace(/[?*()[\]\\{}]/g, '\\$&'); + } + return windowsPathsNoEscape ? + s.replace(/[?*()[\]]/g, '[$&]') + : s.replace(/[?*()[\]\\]/g, '\\$&'); +}; +exports.escape = escape; +//# sourceMappingURL=escape.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f963f0a14ae877630cc9542b82ee1b5365621c33 --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/escape.js.map @@ -0,0 +1 @@ +{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACI,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA;AAlBY,QAAA,MAAM,UAkBlB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character. In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n s: string,\n {\n windowsPathsNoEscape = false,\n magicalBraces = false,\n }: Pick = {},\n) => {\n // don't need to escape +@! because we escape the parens\n // that make those magic, and escaping ! as [!] isn't valid,\n // because [!]] is a valid glob class meaning not ']'.\n if (magicalBraces) {\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]{}]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n }\n return windowsPathsNoEscape ?\n s.replace(/[?*()[\\]]/g, '[$&]')\n : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e1fc2edaadbe09033faefbd7363f0cba109bafc --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.d.ts @@ -0,0 +1,174 @@ +import { AST } from './ast.js'; +export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd'; +export interface MinimatchOptions { + /** do not expand `{x,y}` style braces */ + nobrace?: boolean; + /** do not treat patterns starting with `#` as a comment */ + nocomment?: boolean; + /** do not treat patterns starting with `!` as a negation */ + nonegate?: boolean; + /** print LOTS of debugging output */ + debug?: boolean; + /** treat `**` the same as `*` */ + noglobstar?: boolean; + /** do not expand extglobs like `+(a|b)` */ + noext?: boolean; + /** return the pattern if nothing matches */ + nonull?: boolean; + /** treat `\\` as a path separator, not an escape character */ + windowsPathsNoEscape?: boolean; + /** + * inverse of {@link MinimatchOptions.windowsPathsNoEscape} + * @deprecated + */ + allowWindowsEscape?: boolean; + /** + * Compare a partial path to a pattern. As long as the parts + * of the path that are present are not contradicted by the + * pattern, it will be treated as a match. This is useful in + * applications where you're walking through a folder structure, + * and don't yet have the full path, but want to ensure that you + * do not walk down paths that can never be a match. + */ + partial?: boolean; + /** allow matches that start with `.` even if the pattern does not */ + dot?: boolean; + /** ignore case */ + nocase?: boolean; + /** ignore case only in wildcard patterns */ + nocaseMagicOnly?: boolean; + /** consider braces to be "magic" for the purpose of `hasMagic` */ + magicalBraces?: boolean; + /** + * If set, then patterns without slashes will be matched + * against the basename of the path if it contains slashes. + * For example, `a?b` would match the path `/xyz/123/acb`, but + * not `/xyz/acb/123`. + */ + matchBase?: boolean; + /** invert the results of negated matches */ + flipNegate?: boolean; + /** do not collapse multiple `/` into a single `/` */ + preserveMultipleSlashes?: boolean; + /** + * A number indicating the level of optimization that should be done + * to the pattern prior to parsing and using it for matches. + */ + optimizationLevel?: number; + /** operating system platform */ + platform?: Platform; + /** + * When a pattern starts with a UNC path or drive letter, and in + * `nocase:true` mode, do not convert the root portions of the + * pattern into a case-insensitive regular expression, and instead + * leave them as strings. + * + * This is the default when the platform is `win32` and + * `nocase:true` is set. + */ + windowsNoMagicRoot?: boolean; + /** + * max number of `{...}` patterns to expand. Default 100_000. + */ + braceExpandMax?: number; + /** + * Max number of non-adjacent `**` patterns to recursively walk down. + * + * The default of 200 is almost certainly high enough for most purposes, + * and can handle absurdly excessive patterns. + */ + maxGlobstarRecursion?: number; + /** + * Max depth to traverse for nested extglobs like `*(a|b|c)` + * + * Default is 2, which is quite low, but any higher value + * swiftly results in punishing performance impacts. Note + * that this is *not* relevant when the globstar types can + * be safely coalesced into a single set. + * + * For example, `*(a|@(b|c)|d)` would be flattened into + * `*(a|b|c|d)`. Thus, many common extglobs will retain good + * performance and never hit this limit, even if they are + * excessively deep and complicated. + * + * If the limit is hit, then the extglob characters are simply + * not parsed, and the pattern effectively switches into + * `noextglob: true` mode for the contents of that nested + * sub-pattern. This will typically _not_ result in a match, + * but is considered a valid trade-off for security and + * performance. + */ + maxExtglobRecursion?: number; +} +export declare const minimatch: { + (p: string, pattern: string, options?: MinimatchOptions): boolean; + sep: Sep; + GLOBSTAR: typeof GLOBSTAR; + filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean; + defaults: (def: MinimatchOptions) => typeof minimatch; + braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; + makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp; + match: (list: string[], pattern: string, options?: MinimatchOptions) => string[]; + AST: typeof AST; + Minimatch: typeof Minimatch; + escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; + unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string; +}; +export type Sep = '\\' | '/'; +export declare const sep: Sep; +export declare const GLOBSTAR: unique symbol; +export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean; +export declare const defaults: (def: MinimatchOptions) => typeof minimatch; +export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[]; +export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp; +export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[]; +export type MMRegExp = RegExp & { + _src?: string; + _glob?: string; +}; +export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR; +export type ParseReturn = ParseReturnFiltered | false; +export declare class Minimatch { + #private; + options: MinimatchOptions; + set: ParseReturnFiltered[][]; + pattern: string; + windowsPathsNoEscape: boolean; + nonegate: boolean; + negate: boolean; + comment: boolean; + empty: boolean; + preserveMultipleSlashes: boolean; + partial: boolean; + globSet: string[]; + globParts: string[][]; + nocase: boolean; + isWindows: boolean; + platform: Platform; + windowsNoMagicRoot: boolean; + maxGlobstarRecursion: number; + regexp: false | null | MMRegExp; + constructor(pattern: string, options?: MinimatchOptions); + hasMagic(): boolean; + debug(..._: unknown[]): void; + make(): void; + preprocess(globParts: string[][]): string[][]; + adjascentGlobstarOptimize(globParts: string[][]): string[][]; + levelOneOptimize(globParts: string[][]): string[][]; + levelTwoFileOptimize(parts: string | string[]): string[]; + firstPhasePreProcess(globParts: string[][]): string[][]; + secondPhasePreProcess(globParts: string[][]): string[][]; + partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[]; + parseNegate(): void; + matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean; + braceExpand(): string[]; + parse(pattern: string): ParseReturn; + makeRe(): false | MMRegExp; + slashSplit(p: string): string[]; + match(f: string, partial?: boolean): boolean; + static defaults(def: MinimatchOptions): typeof Minimatch; +} +export { AST } from './ast.js'; +export { escape } from './escape.js'; +export { unescape } from './unescape.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..7620db91cc81855821dded14c51fdfe9b0cd1d6a --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iCAAiC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,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E,OAAO,GAAE,gBAAqB;IAqC3D,QAAQ,IAAI,OAAO;IAYnB,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE;IAErB,IAAI;IA8FJ,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA8BhC,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAiB/C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IAoBtC,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAoE7C,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE;IA0F1C,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,EAAE;IAkBxD,UAAU,CACR,CAAC,EAAE,MAAM,EAAE,EACX,CAAC,EAAE,MAAM,EAAE,EACX,YAAY,GAAE,OAAe,GAC5B,KAAK,GAAG,MAAM,EAAE;IA+CnB,WAAW;IAqBX,QAAQ,CACN,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,GAAE,OAAe;IAiX1B,WAAW;IAIX,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IA6CnC,MAAM;IAuGN,UAAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAgEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"} \ No newline at end of file diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5a6983481b78583d75c89a17c5a8371b059171ff --- /dev/null +++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js @@ -0,0 +1,1127 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0; +const brace_expansion_1 = require("brace-expansion"); +const assert_valid_pattern_js_1 = require("./assert-valid-pattern.js"); +const ast_js_1 = require("./ast.js"); +const escape_js_1 = require("./escape.js"); +const unescape_js_1 = require("./unescape.js"); +const minimatch = (p, pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false; + } + return new Minimatch(pattern, options).match(p); +}; +exports.minimatch = minimatch; +// Optimized checking for the most common glob patterns. +const starDotExtRE = /^\*+([^+@!?*[(]*)$/; +const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); +const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); +const starDotExtTestNocase = (ext) => { + ext = ext.toLowerCase(); + return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); +}; +const starDotExtTestNocaseDot = (ext) => { + ext = ext.toLowerCase(); + return (f) => f.toLowerCase().endsWith(ext); +}; +const starDotStarRE = /^\*+\.\*+$/; +const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); +const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); +const dotStarRE = /^\.\*+$/; +const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); +const starRE = /^\*+$/; +const starTest = (f) => f.length !== 0 && !f.startsWith('.'); +const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; +const qmarksRE = /^\?+([^+@!?*[(]*)?$/; +const qmarksTestNocase = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestNocaseDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTest = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTestNoExt = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && !f.startsWith('.'); +}; +const qmarksTestNoExtDot = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && f !== '.' && f !== '..'; +}; +/* c8 ignore start */ +const defaultPlatform = (typeof process === 'object' && process ? + (typeof process.env === 'object' && + process.env && + process.env.__MINIMATCH_TESTING_PLATFORM__) || + process.platform + : 'posix'); +const path = { + win32: { sep: '\\' }, + posix: { sep: '/' }, +}; +/* c8 ignore stop */ +exports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep; +exports.minimatch.sep = exports.sep; +exports.GLOBSTAR = Symbol('globstar **'); +exports.minimatch.GLOBSTAR = exports.GLOBSTAR; +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; +const filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options); +exports.filter = filter; +exports.minimatch.filter = exports.filter; +const ext = (a, b = {}) => Object.assign({}, a, b); +const defaults = (def) => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return exports.minimatch; + } + const orig = exports.minimatch; + const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); + return Object.assign(m, { + Minimatch: class Minimatch extends orig.Minimatch { + constructor(pattern, options = {}) { + super(pattern, ext(def, options)); + } + static defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + } + }, + AST: class AST extends orig.AST { + /* c8 ignore start */ + constructor(type, parent, options = {}) { + super(type, parent, ext(def, options)); + } + /* c8 ignore stop */ + static fromGlob(pattern, options = {}) { + return orig.AST.fromGlob(pattern, ext(def, options)); + } + }, + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), + filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), + defaults: (options) => orig.defaults(ext(def, options)), + makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), + braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), + match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), + sep: orig.sep, + GLOBSTAR: exports.GLOBSTAR, + }); +}; +exports.defaults = defaults; +exports.minimatch.defaults = exports.defaults; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +const braceExpand = (pattern, options = {}) => { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern]; + } + return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax }); +}; +exports.braceExpand = braceExpand; +exports.minimatch.braceExpand = exports.braceExpand; +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); +exports.makeRe = makeRe; +exports.minimatch.makeRe = exports.makeRe; +const match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options); + list = list.filter(f => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; +}; +exports.match = match; +exports.minimatch.match = exports.match; +// replace stuff like \* with * +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +class Minimatch { + options; + set; + pattern; + windowsPathsNoEscape; + nonegate; + negate; + comment; + empty; + preserveMultipleSlashes; + partial; + globSet; + globParts; + nocase; + isWindows; + platform; + windowsNoMagicRoot; + maxGlobstarRecursion; + regexp; + constructor(pattern, options = {}) { + (0, assert_valid_pattern_js_1.assertValidPattern)(pattern); + options = options || {}; + this.options = options; + this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200; + this.pattern = pattern; + this.platform = options.platform || defaultPlatform; + this.isWindows = this.platform === 'win32'; + // avoid the annoying deprecation flag lol + const awe = ('allowWindow' + 'sEscape'); + this.windowsPathsNoEscape = + !!options.windowsPathsNoEscape || options[awe] === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/'); + } + this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; + this.regexp = null; + this.negate = false; + this.nonegate = !!options.nonegate; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.nocase = !!this.options.nocase; + this.windowsNoMagicRoot = + options.windowsNoMagicRoot !== undefined ? + options.windowsNoMagicRoot + : !!(this.isWindows && this.nocase); + this.globSet = []; + this.globParts = []; + this.set = []; + // make the set of regexps etc. + this.make(); + } + hasMagic() { + if (this.options.magicalBraces && this.set.length > 1) { + return true; + } + for (const pattern of this.set) { + for (const part of pattern) { + if (typeof part !== 'string') + return true; + } + } + return false; + } + debug(..._) { } + make() { + const pattern = this.pattern; + const options = this.options; + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + // step 1: figure out negation, etc. + this.parseNegate(); + // step 2: expand braces + this.globSet = [...new Set(this.braceExpand())]; + if (options.debug) { + //oxlint-disable-next-line no-console + this.debug = (...args) => console.error(...args); + } + this.debug(this.pattern, this.globSet); + // step 3: now we have a set, so turn each one into a series of + // path-portion matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + // + // First, we preprocess to make the glob pattern sets a bit simpler + // and deduped. There are some perf-killing patterns that can cause + // problems with a glob walk, but we can simplify them down a bit. + const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); + this.globParts = this.preprocess(rawGlobParts); + this.debug(this.pattern, this.globParts); + // glob --> regexps + let set = this.globParts.map((s, _, __) => { + if (this.isWindows && this.windowsNoMagicRoot) { + // check if it's a drive or unc path. + const isUNC = s[0] === '' && + s[1] === '' && + (s[2] === '?' || !globMagic.test(s[2])) && + !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); + if (isUNC) { + return [ + ...s.slice(0, 4), + ...s.slice(4).map(ss => this.parse(ss)), + ]; + } + else if (isDrive) { + return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; + } + } + return s.map(ss => this.parse(ss)); + }); + this.debug(this.pattern, set); + // filter out everything that didn't compile properly. + this.set = set.filter(s => s.indexOf(false) === -1); + // do not treat the ? in UNC paths as magic + if (this.isWindows) { + for (let i = 0; i < this.set.length; i++) { + const p = this.set[i]; + if (p[0] === '' && + p[1] === '' && + this.globParts[i][2] === '?' && + typeof p[3] === 'string' && + /^[a-z]:$/i.test(p[3])) { + p[2] = '?'; + } + } + } + this.debug(this.pattern, this.set); + } + // various transforms to equivalent pattern sets that are + // faster to process in a filesystem walk. The goal is to + // eliminate what we can, and push all ** patterns as far + // to the right as possible, even if it increases the number + // of patterns that we have to process. + preprocess(globParts) { + // if we're not in globstar mode, then turn ** into * + if (this.options.noglobstar) { + for (const partset of globParts) { + for (let j = 0; j < partset.length; j++) { + if (partset[j] === '**') { + partset[j] = '*'; + } + } + } + } + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + // aggressive optimization for the purpose of fs walking + globParts = this.firstPhasePreProcess(globParts); + globParts = this.secondPhasePreProcess(globParts); + } + else if (optimizationLevel >= 1) { + // just basic optimizations to remove some .. parts + globParts = this.levelOneOptimize(globParts); + } + else { + // just collapse multiple ** portions into one + globParts = this.adjascentGlobstarOptimize(globParts); + } + return globParts; + } + // just get rid of adjascent ** portions + adjascentGlobstarOptimize(globParts) { + return globParts.map(parts => { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let i = gs; + while (parts[i + 1] === '**') { + i++; + } + if (i !== gs) { + parts.splice(gs, i - gs); + } + } + return parts; + }); + } + // get rid of adjascent ** and resolve .. portions + levelOneOptimize(globParts) { + return globParts.map(parts => { + parts = parts.reduce((set, part) => { + const prev = set[set.length - 1]; + if (part === '**' && prev === '**') { + return set; + } + if (part === '..') { + if (prev && prev !== '..' && prev !== '.' && prev !== '**') { + set.pop(); + return set; + } + } + set.push(part); + return set; + }, []); + return parts.length === 0 ? [''] : parts; + }); + } + levelTwoFileOptimize(parts) { + if (!Array.isArray(parts)) { + parts = this.slashSplit(parts); + } + let didSomething = false; + do { + didSomething = false; + //

// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p &&
+                    p !== '.' &&
+                    p !== '..' &&
+                    p !== '**' &&
+                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        let fileStartIndex = 0;
+        let patternStartIndex = 0;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3
+                : fileDrive ? 0
+                    : undefined;
+            const pdi = patternUNC ? 3
+                : patternDrive ? 0
+                    : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [
+                    file[fdi],
+                    pattern[pdi],
+                ];
+                // start matching at the drive letter index of each
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    patternStartIndex = pdi;
+                    fileStartIndex = fdi;
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // don't need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        if (pattern.includes(exports.GLOBSTAR)) {
+            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
+        }
+        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
+    }
+    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
+        // split the pattern into head, tail, and middle of ** delimited parts
+        const firstgs = pattern.indexOf(exports.GLOBSTAR, patternIndex);
+        const lastgs = pattern.lastIndexOf(exports.GLOBSTAR);
+        // split the pattern up into globstar-delimited sections
+        // the tail has to be at the end, and the others just have
+        // to be found in order from the head.
+        const [head, body, tail] = partial ?
+            [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1),
+                [],
+            ]
+            : [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1, lastgs),
+                pattern.slice(lastgs + 1),
+            ];
+        // check the head, from the current file/pattern index.
+        if (head.length) {
+            const fileHead = file.slice(fileIndex, fileIndex + head.length);
+            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
+                return false;
+            }
+            fileIndex += head.length;
+            patternIndex += head.length;
+        }
+        // now we know the head matches!
+        // if the last portion is not empty, it MUST match the end
+        // check the tail
+        let fileTailMatch = 0;
+        if (tail.length) {
+            // if head + tail > file, then we cannot possibly match
+            if (tail.length + fileIndex > file.length)
+                return false;
+            // try to match the tail
+            let tailStart = file.length - tail.length;
+            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
+                fileTailMatch = tail.length;
+            }
+            else {
+                // affordance for stuff like a/**/* matching a/b/
+                // if the last file portion is '', and there's more to the pattern
+                // then try without the '' bit.
+                if (file[file.length - 1] !== '' ||
+                    fileIndex + tail.length === file.length) {
+                    return false;
+                }
+                tailStart--;
+                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
+                    return false;
+                }
+                fileTailMatch = tail.length + 1;
+            }
+        }
+        // now we know the tail matches!
+        // the middle is zero or more portions wrapped in **, possibly
+        // containing more ** sections.
+        // so a/**/b/**/c/**/d has become **/b/**/c/**
+        // if it's empty, it means a/**/b, just verify we have no bad dots
+        // if there's no tail, so it ends on /**, then we must have *something*
+        // after the head, or it's not a matc
+        if (!body.length) {
+            let sawSome = !!fileTailMatch;
+            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
+                const f = String(file[i]);
+                sawSome = true;
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            // in partial mode, we just need to get past all file parts
+            return partial || sawSome;
+        }
+        // now we know that there's one or more body sections, which can
+        // be matched anywhere from the 0 index (because the head was pruned)
+        // through to the length-fileTailMatch index.
+        // split the body up into sections, and note the minimum index it can
+        // be found at (start with the length of all previous segments)
+        // [section, before, after]
+        const bodySegments = [[[], 0]];
+        let currentBody = bodySegments[0];
+        let nonGsParts = 0;
+        const nonGsPartsSums = [0];
+        for (const b of body) {
+            if (b === exports.GLOBSTAR) {
+                nonGsPartsSums.push(nonGsParts);
+                currentBody = [[], 0];
+                bodySegments.push(currentBody);
+            }
+            else {
+                currentBody[0].push(b);
+                nonGsParts++;
+            }
+        }
+        let i = bodySegments.length - 1;
+        const fileLength = file.length - fileTailMatch;
+        for (const b of bodySegments) {
+            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
+        }
+        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
+    }
+    // return false for "nope, not matching"
+    // return null for "not matching, cannot keep trying"
+    #matchGlobStarBodySections(file, 
+    // pattern section, last possible position for it
+    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
+        // take the first body segment, and walk from fileIndex to its "after"
+        // value at the end
+        // If it doesn't match at that position, we increment, until we hit
+        // that final possible position, and give up.
+        // If it does match, then advance and try to rest.
+        // If any of them fail we keep walking forward.
+        // this is still a bit recursively painful, but it's more constrained
+        // than previous implementations, because we never test something that
+        // can't possibly be a valid matching condition.
+        const bs = bodySegments[bodyIndex];
+        if (!bs) {
+            // just make sure that there's no bad dots
+            for (let i = fileIndex; i < file.length; i++) {
+                sawTail = true;
+                const f = file[i];
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            return sawTail;
+        }
+        // have a non-globstar body section to test
+        const [body, after] = bs;
+        while (fileIndex <= after) {
+            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
+            // if limit exceeded, no match. intentional false negative,
+            // acceptable break in correctness for security.
+            if (m && globStarDepth < this.maxGlobstarRecursion) {
+                // match! see if the rest match. if so, we're done!
+                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
+                if (sub !== false) {
+                    return sub;
+                }
+            }
+            const f = file[fileIndex];
+            if (f === '.' ||
+                f === '..' ||
+                (!this.options.dot && f.startsWith('.'))) {
+                return false;
+            }
+            fileIndex++;
+        }
+        // walked off. no point continuing
+        return partial || null;
+    }
+    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
+        let fi;
+        let pi;
+        let pl;
+        let fl;
+        for (fi = fileIndex,
+            pi = patternIndex,
+            fl = file.length,
+            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            let p = pattern[pi];
+            let f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false || p === exports.GLOBSTAR) {
+                return false;
+            }
+            /* c8 ignore stop */
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return (0, exports.braceExpand)(this.pattern, this.options);
+    }
+    parse(pattern) {
+        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return exports.GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar ? star
+            : options.dot ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return (typeof p === 'string' ? regExpEscape(p)
+                    : p === exports.GLOBSTAR ? exports.GLOBSTAR
+                        : p._src);
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== exports.GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
+                }
+                else if (next !== exports.GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = exports.GLOBSTAR;
+                }
+            });
+            const filtered = pp.filter(p => p !== exports.GLOBSTAR);
+            // For partial matches, we need to make the pattern match
+            // any prefix of the full path. We do this by generating
+            // alternative patterns that match progressively longer prefixes.
+            if (this.partial && filtered.length >= 1) {
+                const prefixes = [];
+                for (let i = 1; i <= filtered.length; i++) {
+                    prefixes.push(filtered.slice(0, i).join('/'));
+                }
+                return '(?:' + prefixes.join('|') + ')';
+            }
+            return filtered.join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // In partial mode, '/' should always match as it's a valid prefix for any pattern
+        if (this.partial) {
+            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
+        }
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (const pattern of set) {
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return exports.minimatch.defaults(def).Minimatch;
+    }
+}
+exports.Minimatch = Minimatch;
+/* c8 ignore start */
+var ast_js_2 = require("./ast.js");
+Object.defineProperty(exports, "AST", { enumerable: true, get: function () { return ast_js_2.AST; } });
+var escape_js_2 = require("./escape.js");
+Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
+var unescape_js_2 = require("./unescape.js");
+Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return unescape_js_2.unescape; } });
+/* c8 ignore stop */
+exports.minimatch.AST = ast_js_1.AST;
+exports.minimatch.Minimatch = Minimatch;
+exports.minimatch.escape = escape_js_1.escape;
+exports.minimatch.unescape = unescape_js_1.unescape;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..f0b81f03f38174267674c53a3dcd4633518e300f
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAAwC;AACxC,uEAA8D;AAE9D,qCAA8B;AAC9B,2CAAoC;AACpC,+CAAwC;AAqHjC,MAAM,SAAS,GAAG,CACvB,CAAS,EACT,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,IAAA,4CAAkB,EAAC,OAAO,CAAC,CAAA;IAE3B,oCAAoC;IACpC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACpD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,O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AC1B,IAAI,IAAI,GAAG,EAAE,CAAA;YACb,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC9C,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAA;YACnB,CAAC;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;YACjD,IAAI,GAAG,EAAE,CAAC;gBACR,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;oBACvB,OAAO,IAAI,CAAA;gBACb,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAA;YACrB,CAAC;QACH,CAAC;QAED,2DAA2D;QAC3D,8BAA8B;QAC9B,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAqB;QACnC,OAAO,iBAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAA;IAC1C,CAAC;CACF;AAhkCD,8BAgkCC;AACD,qBAAqB;AACrB,mCAA8B;AAArB,6FAAA,GAAG,OAAA;AACZ,yCAAoC;AAA3B,mGAAA,MAAM,OAAA;AACf,6CAAwC;AAA/B,uGAAA,QAAQ,OAAA;AACjB,oBAAoB;AACpB,iBAAS,CAAC,GAAG,GAAG,YAAG,CAAA;AACnB,iBAAS,CAAC,SAAS,GAAG,SAAS,CAAA;AAC/B,iBAAS,CAAC,MAAM,GAAG,kBAAM,CAAA;AACzB,iBAAS,CAAC,QAAQ,GAAG,sBAAQ,CAAA","sourcesContent":["import { expand } from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport type { ExtglobType } from './ast.js'\nimport { AST } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\nexport type Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  /** do not expand `{x,y}` style braces */\n  nobrace?: boolean\n  /** do not treat patterns starting with `#` as a comment */\n  nocomment?: boolean\n  /** do not treat patterns starting with `!` as a negation */\n  nonegate?: boolean\n  /** print LOTS of debugging output */\n  debug?: boolean\n  /** treat `**` the same as `*` */\n  noglobstar?: boolean\n  /** do not expand extglobs like `+(a|b)` */\n  noext?: boolean\n  /** return the pattern if nothing matches */\n  nonull?: boolean\n  /** treat `\\\\` as a path separator, not an escape character */\n  windowsPathsNoEscape?: boolean\n  /**\n   * inverse of {@link MinimatchOptions.windowsPathsNoEscape}\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n  /**\n   * Compare a partial path to a pattern. As long as the parts\n   * of the path that are present are not contradicted by the\n   * pattern, it will be treated as a match. This is useful in\n   * applications where you're walking through a folder structure,\n   * and don't yet have the full path, but want to ensure that you\n   * do not walk down paths that can never be a match.\n   */\n  partial?: boolean\n  /** allow matches that start with `.` even if the pattern does not */\n  dot?: boolean\n  /** ignore case */\n  nocase?: boolean\n  /** ignore case only in wildcard patterns */\n  nocaseMagicOnly?: boolean\n  /** consider braces to be \"magic\" for the purpose of `hasMagic` */\n  magicalBraces?: boolean\n  /**\n   * If set, then patterns without slashes will be matched\n   * against the basename of the path if it contains slashes.\n   * For example, `a?b` would match the path `/xyz/123/acb`, but\n   * not `/xyz/acb/123`.\n   */\n  matchBase?: boolean\n  /** invert the results of negated matches */\n  flipNegate?: boolean\n  /** do not collapse multiple `/` into a single `/` */\n  preserveMultipleSlashes?: boolean\n  /**\n   * A number indicating the level of optimization that should be done\n   * to the pattern prior to parsing and using it for matches.\n   */\n  optimizationLevel?: number\n  /** operating system platform */\n  platform?: Platform\n  /**\n   * When a pattern starts with a UNC path or drive letter, and in\n   * `nocase:true` mode, do not convert the root portions of the\n   * pattern into a case-insensitive regular expression, and instead\n   * leave them as strings.\n   *\n   * This is the default when the platform is `win32` and\n   * `nocase:true` is set.\n   */\n  windowsNoMagicRoot?: boolean\n  /**\n   * max number of `{...}` patterns to expand. Default 100_000.\n   */\n  braceExpandMax?: number\n  /**\n   * Max number of non-adjacent `**` patterns to recursively walk down.\n   *\n   * The default of 200 is almost certainly high enough for most purposes,\n   * and can handle absurdly excessive patterns.\n   */\n  maxGlobstarRecursion?: number\n\n  /**\n   * Max depth to traverse for nested extglobs like `*(a|b|c)`\n   *\n   * Default is 2, which is quite low, but any higher value\n   * swiftly results in punishing performance impacts. Note\n   * that this is *not*  relevant when the globstar types can\n   * be safely coalesced into a single set.\n   *\n   * For example, `*(a|@(b|c)|d)` would be flattened into\n   * `*(a|b|c|d)`. Thus, many common extglobs will retain good\n   * performance and  never hit this limit, even if they are\n   * excessively deep and complicated.\n   *\n   * If the limit is hit, then the extglob characters are simply\n   * not parsed, and the pattern effectively switches into\n   * `noextglob: true` mode for the contents of that nested\n   * sub-pattern. This will typically _not_ result in a match,\n   * but is considered a valid trade-off for security and\n   * performance.\n   */\n  maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) =>\n  !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) =>\n  f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) =>\n  f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process ?\n    (typeof process.env === 'object' &&\n      process.env &&\n      process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n    process.platform\n  : 'posix') as Platform\n\nexport type Sep = '\\\\' | '/'\n\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep =\n  defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {},\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) =>\n      orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (\n      list: string[],\n      pattern: string,\n      options: MinimatchOptions = {},\n    ) => orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li  for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern, { max: options.braceExpandMax })\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n  maxGlobstarRecursion: number\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    // avoid the annoying deprecation flag lol\n    const awe = ('allowWindow' + 'sEscape') as keyof MinimatchOptions\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options[awe] === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined ?\n        options.windowsNoMagicRoot\n      : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: unknown[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      //oxlint-disable-next-line no-console\n      this.debug = (...args: unknown[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [\n            ...s.slice(0, 4),\n            ...s.slice(4).map(ss => this.parse(ss)),\n          ]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1,\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn ** into *\n    if (this.options.noglobstar) {\n      for (const partset of globParts) {\n        for (let j = 0; j < partset.length; j++) {\n          if (partset[j] === '**') {\n            partset[j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n\n    do {\n      didSomething = false\n      // 
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (\n          p &&\n          p !== '.' &&\n          p !== '..' &&\n          p !== '**' &&\n          !(this.isWindows && /^[a-z]:$/i.test(p))\n        ) {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes,\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false,\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false,\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi =\n        fileUNC ? 3\n        : fileDrive ? 0\n        : undefined\n      const pdi =\n        patternUNC ? 3\n        : patternDrive ? 0\n        : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        // start matching at the drive letter index of each\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // don't need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file,\n        pattern,\n        partial,\n        fileStartIndex,\n        patternStartIndex,\n      )\n    }\n\n    return this.#matchOne(\n      file,\n      pattern,\n      partial,\n      fileStartIndex,\n      patternStartIndex,\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    // split the pattern into head, tail, and middle of ** delimited parts\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    // split the pattern up into globstar-delimited sections\n    // the tail has to be at the end, and the others just have\n    // to be found in order from the head.\n    const [head, body, tail] =\n      partial ?\n        [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1),\n          [],\n        ]\n      : [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1, lastgs),\n          pattern.slice(lastgs + 1),\n        ]\n\n    // check the head, from the current file/pattern index.\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n        return false\n      }\n      fileIndex += head.length\n      patternIndex += head.length\n    }\n    // now we know the head matches!\n\n    // if the last portion is not empty, it MUST match the end\n    // check the tail\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      // if head + tail > file, then we cannot possibly match\n      if (tail.length + fileIndex > file.length) return false\n\n      // try to match the tail\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        // affordance for stuff like a/**/* matching a/b/\n        // if the last file portion is '', and there's more to the pattern\n        // then try without the '' bit.\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n          return false\n        }\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    // now we know the tail matches!\n\n    // the middle is zero or more portions wrapped in **, possibly\n    // containing more ** sections.\n    // so a/**/b/**/c/**/d has become **/b/**/c/**\n    // if it's empty, it means a/**/b, just verify we have no bad dots\n    // if there's no tail, so it ends on /**, then we must have *something*\n    // after the head, or it's not a matc\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      // in partial mode, we just need to get past all file parts\n      return partial || sawSome\n    }\n\n    // now we know that there's one or more body sections, which can\n    // be matched anywhere from the 0 index (because the head was pruned)\n    // through to the length-fileTailMatch index.\n    // split the body up into sections, and note the minimum index it can\n    // be found at (start with the length of all previous segments)\n    // [section, before, after]\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file,\n      bodySegments,\n      fileIndex,\n      0,\n      partial,\n      0,\n      !!fileTailMatch,\n    )\n  }\n\n  // return false for \"nope, not matching\"\n  // return null for \"not matching, cannot keep trying\"\n  #matchGlobStarBodySections(\n    file: string[],\n    // pattern section, last possible position for it\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean,\n  ): boolean | null {\n    // take the first body segment, and walk from fileIndex to its \"after\"\n    // value at the end\n    // If it doesn't match at that position, we increment, until we hit\n    // that final possible position, and give up.\n    // If it does match, then advance and try to rest.\n    // If any of them fail we keep walking forward.\n    // this is still a bit recursively painful, but it's more constrained\n    // than previous implementations, because we never test something that\n    // can't possibly be a valid matching condition.\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      // just make sure that there's no bad dots\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    // have a non-globstar body section to test\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body,\n        partial,\n        fileIndex,\n        0,\n      )\n      // if limit exceeded, no match. intentional false negative,\n      // acceptable break in correctness for security.\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        // match! see if the rest match. if so, we're done!\n        const sub = this.#matchGlobStarBodySections(\n          file,\n          bodySegments,\n          fileIndex + body.length,\n          bodyIndex + 1,\n          partial,\n          globStarDepth + 1,\n          sawTail,\n        )\n        if (sub !== false) {\n          return sub\n        }\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' ||\n        f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n\n      fileIndex++\n    }\n    // walked off. no point continuing\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex,\n        pi = patternIndex,\n        fl = file.length,\n        pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            starDotExtTestNocaseDot\n          : starDotExtTestNocase\n        : options.dot ? starDotExtTestDot\n        : starDotExtTest)(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            qmarksTestNocaseDot\n          : qmarksTestNocase\n        : options.dot ? qmarksTestDot\n        : qmarksTest)(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar =\n      options.noglobstar ? star\n      : options.dot ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return (\n            typeof p === 'string' ? regExpEscape(p)\n            : p === GLOBSTAR ? GLOBSTAR\n            : p._src\n          )\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        const filtered = pp.filter(p => p !== GLOBSTAR)\n\n        // For partial matches, we need to make the pattern match\n        // any prefix of the full path. We do this by generating\n        // alternative patterns that match progressively longer prefixes.\n        if (this.partial && filtered.length >= 1) {\n          const prefixes: string[] = []\n          for (let i = 1; i <= filtered.length; i++) {\n            prefixes.push(filtered.slice(0, i).join('/'))\n          }\n          return '(?:' + prefixes.join('|') + ')'\n        }\n\n        return filtered.join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // In partial mode, '/' should always match as it's a valid prefix for any pattern\n    if (this.partial) {\n      re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$'\n    }\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (const pattern of set) {\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/package.json b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..5bbefffbabee392d1855491b84dc0a716b6a3bf2
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "commonjs"
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c4a14473afc706260b914e947fbb636680ddf43f
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.d.ts
@@ -0,0 +1,22 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=unescape.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..09d6eab4e6502cde5495bf5ea51637d6db86999c
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
new file mode 100644
index 0000000000000000000000000000000000000000..ad648fba64d40d27684d091b66282f0bbeb27012
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js
@@ -0,0 +1,38 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.unescape = void 0;
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/\[([^/\\])\]/g, '$1')
+            : s
+                .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
+                .replace(/\\([^/])/g, '$1');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/\[([^/\\{}])\]/g, '$1')
+        : s
+            .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
+            .replace(/\\([^/{}])/g, '$1');
+};
+exports.unescape = unescape;
+//# sourceMappingURL=unescape.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..44387ec58d1bb4950d2869a3c65ff08738fd79ad
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/commonjs/unescape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEI,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = true,\n  }: Pick = {},\n) => {\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/\\[([^/\\\\])\\]/g, '$1')\n      : s\n          .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n          .replace(/\\\\([^/])/g, '$1')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n    : s\n        .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n        .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..34d7a78a0c514479118614db25b5bb9c1b1706f2
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts
@@ -0,0 +1,2 @@
+export declare const assertValidPattern: (pattern: unknown) => void;
+//# sourceMappingURL=assert-valid-pattern.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..30ddcd51f6eae80e97bc753145194c71fd1cbad2
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js
new file mode 100644
index 0000000000000000000000000000000000000000..7b534fc30200bb8e36fc6f85aebb49a8738f711d
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js
@@ -0,0 +1,10 @@
+const MAX_PATTERN_LENGTH = 1024 * 64;
+export const assertValidPattern = (pattern) => {
+    if (typeof pattern !== 'string') {
+        throw new TypeError('invalid pattern');
+    }
+    if (pattern.length > MAX_PATTERN_LENGTH) {
+        throw new TypeError('pattern is too long');
+    }
+};
+//# sourceMappingURL=assert-valid-pattern.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..550f61df5a845c757c260140cd1a83156355d8f4
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/assert-valid-pattern.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n  pattern: unknown,\n): asserts pattern is string => {\n  if (typeof pattern !== 'string') {\n    throw new TypeError('invalid pattern')\n  }\n\n  if (pattern.length > MAX_PATTERN_LENGTH) {\n    throw new TypeError('pattern is too long')\n  }\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..74f2cf9322b97504fa4d6eb29dbe74222a4449ba
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.d.ts
@@ -0,0 +1,22 @@
+import type { MinimatchOptions, MMRegExp } from './index.js';
+export type ExtglobType = '!' | '?' | '+' | '*' | '@';
+export declare class AST {
+    #private;
+    type: ExtglobType | null;
+    id: number;
+    get depth(): number;
+    constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
+    get hasMagic(): boolean | undefined;
+    toString(): string;
+    push(...parts: (string | AST)[]): void;
+    toJSON(): unknown[];
+    isStart(): boolean;
+    isEnd(): boolean;
+    copyIn(part: AST | string): void;
+    clone(parent: AST): AST;
+    static fromGlob(pattern: string, options?: MinimatchOptions): AST;
+    toMMPattern(): MMRegExp | string;
+    get options(): MinimatchOptions;
+    toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean];
+}
+//# sourceMappingURL=ast.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..8965fd6a99ff91e22cd5de1f2c41563a673b8dc0
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js
new file mode 100644
index 0000000000000000000000000000000000000000..f639546593db64ee620281cffd819f3c103fc09b
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js
@@ -0,0 +1,841 @@
+// parse a single path portion
+var _a;
+import { parseClass } from './brace-expressions.js';
+import { unescape } from './unescape.js';
+const types = new Set(['!', '?', '+', '*', '@']);
+const isExtglobType = (c) => types.has(c);
+const isExtglobAST = (c) => isExtglobType(c.type);
+// Map of which extglob types can adopt the children of a nested extglob
+//
+// anything but ! can adopt a matching type:
+// +(a|+(b|c)|d) => +(a|b|c|d)
+// *(a|*(b|c)|d) => *(a|b|c|d)
+// @(a|@(b|c)|d) => @(a|b|c|d)
+// ?(a|?(b|c)|d) => ?(a|b|c|d)
+//
+// * can adopt anything, because 0 or repetition is allowed
+// *(a|?(b|c)|d) => *(a|b|c|d)
+// *(a|+(b|c)|d) => *(a|b|c|d)
+// *(a|@(b|c)|d) => *(a|b|c|d)
+//
+// + can adopt @, because 1 or repetition is allowed
+// +(a|@(b|c)|d) => +(a|b|c|d)
+//
+// + and @ CANNOT adopt *, because 0 would be allowed
+// +(a|*(b|c)|d) => would match "", on *(b|c)
+// @(a|*(b|c)|d) => would match "", on *(b|c)
+//
+// + and @ CANNOT adopt ?, because 0 would be allowed
+// +(a|?(b|c)|d) => would match "", on ?(b|c)
+// @(a|?(b|c)|d) => would match "", on ?(b|c)
+//
+// ? can adopt @, because 0 or 1 is allowed
+// ?(a|@(b|c)|d) => ?(a|b|c|d)
+//
+// ? and @ CANNOT adopt * or +, because >1 would be allowed
+// ?(a|*(b|c)|d) => would match bbb on *(b|c)
+// @(a|*(b|c)|d) => would match bbb on *(b|c)
+// ?(a|+(b|c)|d) => would match bbb on +(b|c)
+// @(a|+(b|c)|d) => would match bbb on +(b|c)
+//
+// ! CANNOT adopt ! (nothing else can either)
+// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)
+//
+// ! can adopt @
+// !(a|@(b|c)|d) => !(a|b|c|d)
+//
+// ! CANNOT adopt *
+// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
+//
+// ! CANNOT adopt +
+// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
+//
+// ! CANNOT adopt ?
+// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x"
+const adoptionMap = new Map([
+    ['!', ['@']],
+    ['?', ['?', '@']],
+    ['@', ['@']],
+    ['*', ['*', '+', '?', '@']],
+    ['+', ['+', '@']],
+]);
+// nested extglobs that can be adopted in, but with the addition of
+// a blank '' element.
+const adoptionWithSpaceMap = new Map([
+    ['!', ['?']],
+    ['@', ['?']],
+    ['+', ['?', '*']],
+]);
+// union of the previous two maps
+const adoptionAnyMap = new Map([
+    ['!', ['?', '@']],
+    ['?', ['?', '@']],
+    ['@', ['?', '@']],
+    ['*', ['*', '+', '?', '@']],
+    ['+', ['+', '@', '?', '*']],
+]);
+// Extglobs that can take over their parent if they are the only child
+// the key is parent, value maps child to resulting extglob parent type
+// '@' is omitted because it's a special case. An `@` extglob with a single
+// member can always be usurped by that subpattern.
+const usurpMap = new Map([
+    ['!', new Map([['!', '@']])],
+    [
+        '?',
+        new Map([
+            ['*', '*'],
+            ['+', '*'],
+        ]),
+    ],
+    [
+        '@',
+        new Map([
+            ['!', '!'],
+            ['?', '?'],
+            ['@', '@'],
+            ['*', '*'],
+            ['+', '+'],
+        ]),
+    ],
+    [
+        '+',
+        new Map([
+            ['?', '*'],
+            ['*', '*'],
+        ]),
+    ],
+]);
+// Patterns that get prepended to bind to the start of either the
+// entire string, or just a single path portion, to prevent dots
+// and/or traversal patterns, when needed.
+// Exts don't need the ^ or / bit, because the root binds that already.
+const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
+const startNoDot = '(?!\\.)';
+// characters that indicate a start of pattern needs the "no dots" bit,
+// because a dot *might* be matched. ( is not in the list, because in
+// the case of a child extglob, it will handle the prevention itself.
+const addPatternStart = new Set(['[', '.']);
+// cases where traversal is A-OK, no dot prevention needed
+const justDots = new Set(['..', '.']);
+const reSpecials = new Set('().*{}+?[]^$\\!');
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// any single thing other than /
+const qmark = '[^/]';
+// * => any number of characters
+const star = qmark + '*?';
+// use + when we need to ensure that *something* matches, because the * is
+// the only thing in the path portion.
+const starNoEmpty = qmark + '+?';
+// remove the \ chars that we added if we end up doing a nonmagic compare
+// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
+let ID = 0;
+export class AST {
+    type;
+    #root;
+    #hasMagic;
+    #uflag = false;
+    #parts = [];
+    #parent;
+    #parentIndex;
+    #negs;
+    #filledNegs = false;
+    #options;
+    #toString;
+    // set to true if it's an extglob with no children
+    // (which really means one child of '')
+    #emptyExt = false;
+    id = ++ID;
+    get depth() {
+        return (this.#parent?.depth ?? -1) + 1;
+    }
+    [Symbol.for('nodejs.util.inspect.custom')]() {
+        return {
+            '@@type': 'AST',
+            id: this.id,
+            type: this.type,
+            root: this.#root.id,
+            parent: this.#parent?.id,
+            depth: this.depth,
+            partsLength: this.#parts.length,
+            parts: this.#parts,
+        };
+    }
+    constructor(type, parent, options = {}) {
+        this.type = type;
+        // extglobs are inherently magical
+        if (type)
+            this.#hasMagic = true;
+        this.#parent = parent;
+        this.#root = this.#parent ? this.#parent.#root : this;
+        this.#options = this.#root === this ? options : this.#root.#options;
+        this.#negs = this.#root === this ? [] : this.#root.#negs;
+        if (type === '!' && !this.#root.#filledNegs)
+            this.#negs.push(this);
+        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
+    }
+    get hasMagic() {
+        /* c8 ignore start */
+        if (this.#hasMagic !== undefined)
+            return this.#hasMagic;
+        /* c8 ignore stop */
+        for (const p of this.#parts) {
+            if (typeof p === 'string')
+                continue;
+            if (p.type || p.hasMagic)
+                return (this.#hasMagic = true);
+        }
+        // note: will be undefined until we generate the regexp src and find out
+        return this.#hasMagic;
+    }
+    // reconstructs the pattern
+    toString() {
+        return (this.#toString !== undefined ? this.#toString
+            : !this.type ?
+                (this.#toString = this.#parts.map(p => String(p)).join(''))
+                : (this.#toString =
+                    this.type +
+                        '(' +
+                        this.#parts.map(p => String(p)).join('|') +
+                        ')'));
+    }
+    #fillNegs() {
+        /* c8 ignore start */
+        if (this !== this.#root)
+            throw new Error('should only call on root');
+        if (this.#filledNegs)
+            return this;
+        /* c8 ignore stop */
+        // call toString() once to fill this out
+        this.toString();
+        this.#filledNegs = true;
+        let n;
+        while ((n = this.#negs.pop())) {
+            if (n.type !== '!')
+                continue;
+            // walk up the tree, appending everthing that comes AFTER parentIndex
+            let p = n;
+            let pp = p.#parent;
+            while (pp) {
+                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
+                    for (const part of n.#parts) {
+                        /* c8 ignore start */
+                        if (typeof part === 'string') {
+                            throw new Error('string part in extglob AST??');
+                        }
+                        /* c8 ignore stop */
+                        part.copyIn(pp.#parts[i]);
+                    }
+                }
+                p = pp;
+                pp = p.#parent;
+            }
+        }
+        return this;
+    }
+    push(...parts) {
+        for (const p of parts) {
+            if (p === '')
+                continue;
+            /* c8 ignore start */
+            if (typeof p !== 'string' &&
+                !(p instanceof _a && p.#parent === this)) {
+                throw new Error('invalid part: ' + p);
+            }
+            /* c8 ignore stop */
+            this.#parts.push(p);
+        }
+    }
+    toJSON() {
+        const ret = this.type === null ?
+            this.#parts
+                .slice()
+                .map(p => (typeof p === 'string' ? p : p.toJSON()))
+            : [this.type, ...this.#parts.map(p => p.toJSON())];
+        if (this.isStart() && !this.type)
+            ret.unshift([]);
+        if (this.isEnd() &&
+            (this === this.#root ||
+                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
+            ret.push({});
+        }
+        return ret;
+    }
+    isStart() {
+        if (this.#root === this)
+            return true;
+        // if (this.type) return !!this.#parent?.isStart()
+        if (!this.#parent?.isStart())
+            return false;
+        if (this.#parentIndex === 0)
+            return true;
+        // if everything AHEAD of this is a negation, then it's still the "start"
+        const p = this.#parent;
+        for (let i = 0; i < this.#parentIndex; i++) {
+            const pp = p.#parts[i];
+            if (!(pp instanceof _a && pp.type === '!')) {
+                return false;
+            }
+        }
+        return true;
+    }
+    isEnd() {
+        if (this.#root === this)
+            return true;
+        if (this.#parent?.type === '!')
+            return true;
+        if (!this.#parent?.isEnd())
+            return false;
+        if (!this.type)
+            return this.#parent?.isEnd();
+        // if not root, it'll always have a parent
+        /* c8 ignore start */
+        const pl = this.#parent ? this.#parent.#parts.length : 0;
+        /* c8 ignore stop */
+        return this.#parentIndex === pl - 1;
+    }
+    copyIn(part) {
+        if (typeof part === 'string')
+            this.push(part);
+        else
+            this.push(part.clone(this));
+    }
+    clone(parent) {
+        const c = new _a(this.type, parent);
+        for (const p of this.#parts) {
+            c.copyIn(p);
+        }
+        return c;
+    }
+    static #parseAST(str, ast, pos, opt, extDepth) {
+        const maxDepth = opt.maxExtglobRecursion ?? 2;
+        let escaping = false;
+        let inBrace = false;
+        let braceStart = -1;
+        let braceNeg = false;
+        if (ast.type === null) {
+            // outside of a extglob, append until we find a start
+            let i = pos;
+            let acc = '';
+            while (i < str.length) {
+                const c = str.charAt(i++);
+                // still accumulate escapes at this point, but we do ignore
+                // starts that are escaped
+                if (escaping || c === '\\') {
+                    escaping = !escaping;
+                    acc += c;
+                    continue;
+                }
+                if (inBrace) {
+                    if (i === braceStart + 1) {
+                        if (c === '^' || c === '!') {
+                            braceNeg = true;
+                        }
+                    }
+                    else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                        inBrace = false;
+                    }
+                    acc += c;
+                    continue;
+                }
+                else if (c === '[') {
+                    inBrace = true;
+                    braceStart = i;
+                    braceNeg = false;
+                    acc += c;
+                    continue;
+                }
+                // we don't have to check for adoption here, because that's
+                // done at the other recursion point.
+                const doRecurse = !opt.noext &&
+                    isExtglobType(c) &&
+                    str.charAt(i) === '(' &&
+                    extDepth <= maxDepth;
+                if (doRecurse) {
+                    ast.push(acc);
+                    acc = '';
+                    const ext = new _a(c, ast);
+                    i = _a.#parseAST(str, ext, i, opt, extDepth + 1);
+                    ast.push(ext);
+                    continue;
+                }
+                acc += c;
+            }
+            ast.push(acc);
+            return i;
+        }
+        // some kind of extglob, pos is at the (
+        // find the next | or )
+        let i = pos + 1;
+        let part = new _a(null, ast);
+        const parts = [];
+        let acc = '';
+        while (i < str.length) {
+            const c = str.charAt(i++);
+            // still accumulate escapes at this point, but we do ignore
+            // starts that are escaped
+            if (escaping || c === '\\') {
+                escaping = !escaping;
+                acc += c;
+                continue;
+            }
+            if (inBrace) {
+                if (i === braceStart + 1) {
+                    if (c === '^' || c === '!') {
+                        braceNeg = true;
+                    }
+                }
+                else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
+                    inBrace = false;
+                }
+                acc += c;
+                continue;
+            }
+            else if (c === '[') {
+                inBrace = true;
+                braceStart = i;
+                braceNeg = false;
+                acc += c;
+                continue;
+            }
+            const doRecurse = !opt.noext &&
+                isExtglobType(c) &&
+                str.charAt(i) === '(' &&
+                /* c8 ignore start - the maxDepth is sufficient here */
+                (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));
+            /* c8 ignore stop */
+            if (doRecurse) {
+                const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
+                part.push(acc);
+                acc = '';
+                const ext = new _a(c, part);
+                part.push(ext);
+                i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
+                continue;
+            }
+            if (c === '|') {
+                part.push(acc);
+                acc = '';
+                parts.push(part);
+                part = new _a(null, ast);
+                continue;
+            }
+            if (c === ')') {
+                if (acc === '' && ast.#parts.length === 0) {
+                    ast.#emptyExt = true;
+                }
+                part.push(acc);
+                acc = '';
+                ast.push(...parts, part);
+                return i;
+            }
+            acc += c;
+        }
+        // unfinished extglob
+        // if we got here, it was a malformed extglob! not an extglob, but
+        // maybe something else in there.
+        ast.type = null;
+        ast.#hasMagic = undefined;
+        ast.#parts = [str.substring(pos - 1)];
+        return i;
+    }
+    #canAdoptWithSpace(child) {
+        return this.#canAdopt(child, adoptionWithSpaceMap);
+    }
+    #canAdopt(child, map = adoptionMap) {
+        if (!child ||
+            typeof child !== 'object' ||
+            child.type !== null ||
+            child.#parts.length !== 1 ||
+            this.type === null) {
+            return false;
+        }
+        const gc = child.#parts[0];
+        if (!gc || typeof gc !== 'object' || gc.type === null) {
+            return false;
+        }
+        return this.#canAdoptType(gc.type, map);
+    }
+    #canAdoptType(c, map = adoptionAnyMap) {
+        return !!map.get(this.type)?.includes(c);
+    }
+    #adoptWithSpace(child, index) {
+        const gc = child.#parts[0];
+        const blank = new _a(null, gc, this.options);
+        blank.#parts.push('');
+        gc.push(blank);
+        this.#adopt(child, index);
+    }
+    #adopt(child, index) {
+        const gc = child.#parts[0];
+        this.#parts.splice(index, 1, ...gc.#parts);
+        for (const p of gc.#parts) {
+            if (typeof p === 'object')
+                p.#parent = this;
+        }
+        this.#toString = undefined;
+    }
+    #canUsurpType(c) {
+        const m = usurpMap.get(this.type);
+        return !!m?.has(c);
+    }
+    #canUsurp(child) {
+        if (!child ||
+            typeof child !== 'object' ||
+            child.type !== null ||
+            child.#parts.length !== 1 ||
+            this.type === null ||
+            this.#parts.length !== 1) {
+            return false;
+        }
+        const gc = child.#parts[0];
+        if (!gc || typeof gc !== 'object' || gc.type === null) {
+            return false;
+        }
+        return this.#canUsurpType(gc.type);
+    }
+    #usurp(child) {
+        const m = usurpMap.get(this.type);
+        const gc = child.#parts[0];
+        const nt = m?.get(gc.type);
+        /* c8 ignore start - impossible */
+        if (!nt)
+            return false;
+        /* c8 ignore stop */
+        this.#parts = gc.#parts;
+        for (const p of this.#parts) {
+            if (typeof p === 'object') {
+                p.#parent = this;
+            }
+        }
+        this.type = nt;
+        this.#toString = undefined;
+        this.#emptyExt = false;
+    }
+    static fromGlob(pattern, options = {}) {
+        const ast = new _a(null, undefined, options);
+        _a.#parseAST(pattern, ast, 0, options, 0);
+        return ast;
+    }
+    // returns the regular expression if there's magic, or the unescaped
+    // string if not.
+    toMMPattern() {
+        // should only be called on root
+        /* c8 ignore start */
+        if (this !== this.#root)
+            return this.#root.toMMPattern();
+        /* c8 ignore stop */
+        const glob = this.toString();
+        const [re, body, hasMagic, uflag] = this.toRegExpSource();
+        // if we're in nocase mode, and not nocaseMagicOnly, then we do
+        // still need a regular expression if we have to case-insensitively
+        // match capital/lowercase characters.
+        const anyMagic = hasMagic ||
+            this.#hasMagic ||
+            (this.#options.nocase &&
+                !this.#options.nocaseMagicOnly &&
+                glob.toUpperCase() !== glob.toLowerCase());
+        if (!anyMagic) {
+            return body;
+        }
+        const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
+        return Object.assign(new RegExp(`^${re}$`, flags), {
+            _src: re,
+            _glob: glob,
+        });
+    }
+    get options() {
+        return this.#options;
+    }
+    // returns the string match, the regexp source, whether there's magic
+    // in the regexp (so a regular expression is required) and whether or
+    // not the uflag is needed for the regular expression (for posix classes)
+    // TODO: instead of injecting the start/end at this point, just return
+    // the BODY of the regexp, along with the start/end portions suitable
+    // for binding the start/end in either a joined full-path makeRe context
+    // (where we bind to (^|/), or a standalone matchPart context (where
+    // we bind to ^, and not /).  Otherwise slashes get duped!
+    //
+    // In part-matching mode, the start is:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: ^(?!\.\.?$)
+    // - if dots allowed or not possible: ^
+    // - if dots possible and not allowed: ^(?!\.)
+    // end is:
+    // - if not isEnd(): nothing
+    // - else: $
+    //
+    // In full-path matching mode, we put the slash at the START of the
+    // pattern, so start is:
+    // - if first pattern: same as part-matching mode
+    // - if not isStart(): nothing
+    // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
+    // - if dots allowed or not possible: /
+    // - if dots possible and not allowed: /(?!\.)
+    // end is:
+    // - if last pattern, same as part-matching mode
+    // - else nothing
+    //
+    // Always put the (?:$|/) on negated tails, though, because that has to be
+    // there to bind the end of the negated pattern portion, and it's easier to
+    // just stick it in now rather than try to inject it later in the middle of
+    // the pattern.
+    //
+    // We can just always return the same end, and leave it up to the caller
+    // to know whether it's going to be used joined or in parts.
+    // And, if the start is adjusted slightly, can do the same there:
+    // - if not isStart: nothing
+    // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
+    // - if dots allowed or not possible: (?:/|^)
+    // - if dots possible and not allowed: (?:/|^)(?!\.)
+    //
+    // But it's better to have a simpler binding without a conditional, for
+    // performance, so probably better to return both start options.
+    //
+    // Then the caller just ignores the end if it's not the first pattern,
+    // and the start always gets applied.
+    //
+    // But that's always going to be $ if it's the ending pattern, or nothing,
+    // so the caller can just attach $ at the end of the pattern when building.
+    //
+    // So the todo is:
+    // - better detect what kind of start is needed
+    // - return both flavors of starting pattern
+    // - attach $ at the end of the pattern when creating the actual RegExp
+    //
+    // Ah, but wait, no, that all only applies to the root when the first pattern
+    // is not an extglob. If the first pattern IS an extglob, then we need all
+    // that dot prevention biz to live in the extglob portions, because eg
+    // +(*|.x*) can match .xy but not .yx.
+    //
+    // So, return the two flavors if it's #root and the first child is not an
+    // AST, otherwise leave it to the child AST to handle it, and there,
+    // use the (?:^|/) style of start binding.
+    //
+    // Even simplified further:
+    // - Since the start for a join is eg /(?!\.) and the start for a part
+    // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
+    // or start or whatever) and prepend ^ or / at the Regexp construction.
+    toRegExpSource(allowDot) {
+        const dot = allowDot ?? !!this.#options.dot;
+        if (this.#root === this) {
+            this.#flatten();
+            this.#fillNegs();
+        }
+        if (!isExtglobAST(this)) {
+            const noEmpty = this.isStart() &&
+                this.isEnd() &&
+                !this.#parts.some(s => typeof s !== 'string');
+            const src = this.#parts
+                .map(p => {
+                const [re, _, hasMagic, uflag] = typeof p === 'string' ?
+                    _a.#parseGlob(p, this.#hasMagic, noEmpty)
+                    : p.toRegExpSource(allowDot);
+                this.#hasMagic = this.#hasMagic || hasMagic;
+                this.#uflag = this.#uflag || uflag;
+                return re;
+            })
+                .join('');
+            let start = '';
+            if (this.isStart()) {
+                if (typeof this.#parts[0] === 'string') {
+                    // this is the string that will match the start of the pattern,
+                    // so we need to protect against dots and such.
+                    // '.' and '..' cannot match unless the pattern is that exactly,
+                    // even if it starts with . or dot:true is set.
+                    const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
+                    if (!dotTravAllowed) {
+                        const aps = addPatternStart;
+                        // check if we have a possibility of matching . or ..,
+                        // and prevent that.
+                        const needNoTrav = 
+                        // dots are allowed, and the pattern starts with [ or .
+                        (dot && aps.has(src.charAt(0))) ||
+                            // the pattern starts with \., and then [ or .
+                            (src.startsWith('\\.') && aps.has(src.charAt(2))) ||
+                            // the pattern starts with \.\., and then [ or .
+                            (src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
+                        // no need to prevent dots if it can't match a dot, or if a
+                        // sub-pattern will be preventing it anyway.
+                        const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
+                        start =
+                            needNoTrav ? startNoTraversal
+                                : needNoDot ? startNoDot
+                                    : '';
+                    }
+                }
+            }
+            // append the "end of path portion" pattern to negation tails
+            let end = '';
+            if (this.isEnd() &&
+                this.#root.#filledNegs &&
+                this.#parent?.type === '!') {
+                end = '(?:$|\\/)';
+            }
+            const final = start + src + end;
+            return [
+                final,
+                unescape(src),
+                (this.#hasMagic = !!this.#hasMagic),
+                this.#uflag,
+            ];
+        }
+        // We need to calculate the body *twice* if it's a repeat pattern
+        // at the start, once in nodot mode, then again in dot mode, so a
+        // pattern like *(?) can match 'x.y'
+        const repeated = this.type === '*' || this.type === '+';
+        // some kind of extglob
+        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
+        let body = this.#partsToRegExp(dot);
+        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
+            // invalid extglob, has to at least be *something* present, if it's
+            // the entire path portion.
+            const s = this.toString();
+            const me = this;
+            me.#parts = [s];
+            me.type = null;
+            me.#hasMagic = undefined;
+            return [s, unescape(this.toString()), false, false];
+        }
+        let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
+            ''
+            : this.#partsToRegExp(true);
+        if (bodyDotAllowed === body) {
+            bodyDotAllowed = '';
+        }
+        if (bodyDotAllowed) {
+            body = `(?:${body})(?:${bodyDotAllowed})*?`;
+        }
+        // an empty !() is exactly equivalent to a starNoEmpty
+        let final = '';
+        if (this.type === '!' && this.#emptyExt) {
+            final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
+        }
+        else {
+            const close = this.type === '!' ?
+                // !() must match something,but !(x) can match ''
+                '))' +
+                    (this.isStart() && !dot && !allowDot ? startNoDot : '') +
+                    star +
+                    ')'
+                : this.type === '@' ? ')'
+                    : this.type === '?' ? ')?'
+                        : this.type === '+' && bodyDotAllowed ? ')'
+                            : this.type === '*' && bodyDotAllowed ? `)?`
+                                : `)${this.type}`;
+            final = start + body + close;
+        }
+        return [
+            final,
+            unescape(body),
+            (this.#hasMagic = !!this.#hasMagic),
+            this.#uflag,
+        ];
+    }
+    #flatten() {
+        if (!isExtglobAST(this)) {
+            for (const p of this.#parts) {
+                if (typeof p === 'object') {
+                    p.#flatten();
+                }
+            }
+        }
+        else {
+            // do up to 10 passes to flatten as much as possible
+            let iterations = 0;
+            let done = false;
+            do {
+                done = true;
+                for (let i = 0; i < this.#parts.length; i++) {
+                    const c = this.#parts[i];
+                    if (typeof c === 'object') {
+                        c.#flatten();
+                        if (this.#canAdopt(c)) {
+                            done = false;
+                            this.#adopt(c, i);
+                        }
+                        else if (this.#canAdoptWithSpace(c)) {
+                            done = false;
+                            this.#adoptWithSpace(c, i);
+                        }
+                        else if (this.#canUsurp(c)) {
+                            done = false;
+                            this.#usurp(c);
+                        }
+                    }
+                }
+            } while (!done && ++iterations < 10);
+        }
+        this.#toString = undefined;
+    }
+    #partsToRegExp(dot) {
+        return this.#parts
+            .map(p => {
+            // extglob ASTs should only contain parent ASTs
+            /* c8 ignore start */
+            if (typeof p === 'string') {
+                throw new Error('string type in extglob ast??');
+            }
+            /* c8 ignore stop */
+            // can ignore hasMagic, because extglobs are already always magic
+            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
+            this.#uflag = this.#uflag || uflag;
+            return re;
+        })
+            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
+            .join('|');
+    }
+    static #parseGlob(glob, hasMagic, noEmpty = false) {
+        let escaping = false;
+        let re = '';
+        let uflag = false;
+        // multiple stars that aren't globstars coalesce into one *
+        let inStar = false;
+        for (let i = 0; i < glob.length; i++) {
+            const c = glob.charAt(i);
+            if (escaping) {
+                escaping = false;
+                re += (reSpecials.has(c) ? '\\' : '') + c;
+                continue;
+            }
+            if (c === '*') {
+                if (inStar)
+                    continue;
+                inStar = true;
+                re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
+                hasMagic = true;
+                continue;
+            }
+            else {
+                inStar = false;
+            }
+            if (c === '\\') {
+                if (i === glob.length - 1) {
+                    re += '\\\\';
+                }
+                else {
+                    escaping = true;
+                }
+                continue;
+            }
+            if (c === '[') {
+                const [src, needUflag, consumed, magic] = parseClass(glob, i);
+                if (consumed) {
+                    re += src;
+                    uflag = uflag || needUflag;
+                    i += consumed - 1;
+                    hasMagic = hasMagic || magic;
+                    continue;
+                }
+            }
+            if (c === '?') {
+                re += qmark;
+                hasMagic = true;
+                continue;
+            }
+            re += regExpEscape(c);
+        }
+        return [re, unescape(glob), !!hasMagic, uflag];
+    }
+}
+_a = AST;
+//# sourceMappingURL=ast.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..f5cc3ee91a072b55b9ff2df2066afd50cf38a6ce
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/ast.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAAA,8BAA8B;;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAwCxC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EA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AO,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport type { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n//   1   2 3   4 5 6      1   2    3   46      5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n//                                 v----- .* because there's more following,\n//                                 v    v  otherwise, .+ because it must be\n//                                 v    v  *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n//   copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string | null): c is ExtglobType =>\n  types.has(c as ExtglobType)\nconst isExtglobAST = (c: AST): c is AST & { type: ExtglobType } =>\n  isExtglobType(c.type)\n\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map([\n  ['!', ['@']],\n  ['?', ['?', '@']],\n  ['@', ['@']],\n  ['*', ['*', '+', '?', '@']],\n  ['+', ['+', '@']],\n])\n\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map([\n  ['!', ['?']],\n  ['@', ['?']],\n  ['+', ['?', '*']],\n])\n\n// union of the previous two maps\nconst adoptionAnyMap = new Map([\n  ['!', ['?', '@']],\n  ['?', ['?', '@']],\n  ['@', ['?', '@']],\n  ['*', ['*', '+', '?', '@']],\n  ['+', ['+', '@', '?', '*']],\n])\n\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map<\n  ExtglobType,\n  Map\n>([\n  ['!', new Map([['!', '@']])],\n  [\n    '?',\n    new Map([\n      ['*', '*'],\n      ['+', '*'],\n    ]),\n  ],\n  [\n    '@',\n    new Map([\n      ['!', '!'],\n      ['?', '?'],\n      ['@', '@'],\n      ['*', '*'],\n      ['+', '+'],\n    ]),\n  ],\n  [\n    '+',\n    new Map([\n      ['?', '*'],\n      ['*', '*'],\n    ]),\n  ],\n])\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nlet ID = 0\nexport class AST {\n  type: ExtglobType | null\n  readonly #root: AST\n\n  #hasMagic?: boolean\n  #uflag: boolean = false\n  #parts: (string | AST)[] = []\n  #parent?: AST\n  #parentIndex: number\n  #negs: AST[]\n  #filledNegs: boolean = false\n  #options: MinimatchOptions\n  #toString?: string\n  // set to true if it's an extglob with no children\n  // (which really means one child of '')\n  #emptyExt: boolean = false\n  id = ++ID\n\n  get depth(): number {\n    return (this.#parent?.depth ?? -1) + 1\n  }\n\n  [Symbol.for('nodejs.util.inspect.custom')]() {\n    return {\n      '@@type': 'AST',\n      id: this.id,\n      type: this.type,\n      root: this.#root.id,\n      parent: this.#parent?.id,\n      depth: this.depth,\n      partsLength: this.#parts.length,\n      parts: this.#parts,\n    }\n  }\n\n  constructor(\n    type: ExtglobType | null,\n    parent?: AST,\n    options: MinimatchOptions = {},\n  ) {\n    this.type = type\n    // extglobs are inherently magical\n    if (type) this.#hasMagic = true\n    this.#parent = parent\n    this.#root = this.#parent ? this.#parent.#root : this\n    this.#options = this.#root === this ? options : this.#root.#options\n    this.#negs = this.#root === this ? [] : this.#root.#negs\n    if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n    this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n  }\n\n  get hasMagic(): boolean | undefined {\n    /* c8 ignore start */\n    if (this.#hasMagic !== undefined) return this.#hasMagic\n    /* c8 ignore stop */\n    for (const p of this.#parts) {\n      if (typeof p === 'string') continue\n      if (p.type || p.hasMagic) return (this.#hasMagic = true)\n    }\n    // note: will be undefined until we generate the regexp src and find out\n    return this.#hasMagic\n  }\n\n  // reconstructs the pattern\n  toString(): string {\n    return (\n      this.#toString !== undefined ? this.#toString\n      : !this.type ?\n        (this.#toString = this.#parts.map(p => String(p)).join(''))\n      : (this.#toString =\n          this.type +\n          '(' +\n          this.#parts.map(p => String(p)).join('|') +\n          ')')\n    )\n  }\n\n  #fillNegs() {\n    /* c8 ignore start */\n    if (this !== this.#root) throw new Error('should only call on root')\n    if (this.#filledNegs) return this\n    /* c8 ignore stop */\n\n    // call toString() once to fill this out\n    this.toString()\n    this.#filledNegs = true\n    let n: AST | undefined\n    while ((n = this.#negs.pop())) {\n      if (n.type !== '!') continue\n      // walk up the tree, appending everthing that comes AFTER parentIndex\n      let p: AST | undefined = n\n      let pp = p.#parent\n      while (pp) {\n        for (\n          let i = p.#parentIndex + 1;\n          !pp.type && i < pp.#parts.length;\n          i++\n        ) {\n          for (const part of n.#parts) {\n            /* c8 ignore start */\n            if (typeof part === 'string') {\n              throw new Error('string part in extglob AST??')\n            }\n            /* c8 ignore stop */\n            part.copyIn(pp.#parts[i])\n          }\n        }\n        p = pp\n        pp = p.#parent\n      }\n    }\n    return this\n  }\n\n  push(...parts: (string | AST)[]) {\n    for (const p of parts) {\n      if (p === '') continue\n      /* c8 ignore start */\n      if (\n        typeof p !== 'string' &&\n        !(p instanceof AST && p.#parent === this)\n      ) {\n        throw new Error('invalid part: ' + p)\n      }\n      /* c8 ignore stop */\n      this.#parts.push(p)\n    }\n  }\n\n  toJSON() {\n    const ret: unknown[] =\n      this.type === null ?\n        this.#parts\n          .slice()\n          .map(p => (typeof p === 'string' ? p : p.toJSON()))\n      : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n    if (this.isStart() && !this.type) ret.unshift([])\n    if (\n      this.isEnd() &&\n      (this === this.#root ||\n        (this.#root.#filledNegs && this.#parent?.type === '!'))\n    ) {\n      ret.push({})\n    }\n    return ret\n  }\n\n  isStart(): boolean {\n    if (this.#root === this) return true\n    // if (this.type) return !!this.#parent?.isStart()\n    if (!this.#parent?.isStart()) return false\n    if (this.#parentIndex === 0) return true\n    // if everything AHEAD of this is a negation, then it's still the \"start\"\n    const p = this.#parent\n    for (let i = 0; i < this.#parentIndex; i++) {\n      const pp = p.#parts[i]\n      if (!(pp instanceof AST && pp.type === '!')) {\n        return false\n      }\n    }\n    return true\n  }\n\n  isEnd(): boolean {\n    if (this.#root === this) return true\n    if (this.#parent?.type === '!') return true\n    if (!this.#parent?.isEnd()) return false\n    if (!this.type) return this.#parent?.isEnd()\n    // if not root, it'll always have a parent\n    /* c8 ignore start */\n    const pl = this.#parent ? this.#parent.#parts.length : 0\n    /* c8 ignore stop */\n    return this.#parentIndex === pl - 1\n  }\n\n  copyIn(part: AST | string) {\n    if (typeof part === 'string') this.push(part)\n    else this.push(part.clone(this))\n  }\n\n  clone(parent: AST) {\n    const c = new AST(this.type, parent)\n    for (const p of this.#parts) {\n      c.copyIn(p)\n    }\n    return c\n  }\n\n  static #parseAST(\n    str: string,\n    ast: AST,\n    pos: number,\n    opt: MinimatchOptions,\n    extDepth: number,\n  ): number {\n    const maxDepth = opt.maxExtglobRecursion ?? 2\n    let escaping = false\n    let inBrace = false\n    let braceStart = -1\n    let braceNeg = false\n    if (ast.type === null) {\n      // outside of a extglob, append until we find a start\n      let i = pos\n      let acc = ''\n      while (i < str.length) {\n        const c = str.charAt(i++)\n        // still accumulate escapes at this point, but we do ignore\n        // starts that are escaped\n        if (escaping || c === '\\\\') {\n          escaping = !escaping\n          acc += c\n          continue\n        }\n\n        if (inBrace) {\n          if (i === braceStart + 1) {\n            if (c === '^' || c === '!') {\n              braceNeg = true\n            }\n          } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n            inBrace = false\n          }\n          acc += c\n          continue\n        } else if (c === '[') {\n          inBrace = true\n          braceStart = i\n          braceNeg = false\n          acc += c\n          continue\n        }\n\n        // we don't have to check for adoption here, because that's\n        // done at the other recursion point.\n        const doRecurse =\n          !opt.noext &&\n          isExtglobType(c) &&\n          str.charAt(i) === '(' &&\n          extDepth <= maxDepth\n        if (doRecurse) {\n          ast.push(acc)\n          acc = ''\n          const ext = new AST(c, ast)\n          i = AST.#parseAST(str, ext, i, opt, extDepth + 1)\n          ast.push(ext)\n          continue\n        }\n        acc += c\n      }\n      ast.push(acc)\n      return i\n    }\n\n    // some kind of extglob, pos is at the (\n    // find the next | or )\n    let i = pos + 1\n    let part = new AST(null, ast)\n    const parts: AST[] = []\n    let acc = ''\n    while (i < str.length) {\n      const c = str.charAt(i++)\n      // still accumulate escapes at this point, but we do ignore\n      // starts that are escaped\n      if (escaping || c === '\\\\') {\n        escaping = !escaping\n        acc += c\n        continue\n      }\n\n      if (inBrace) {\n        if (i === braceStart + 1) {\n          if (c === '^' || c === '!') {\n            braceNeg = true\n          }\n        } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n          inBrace = false\n        }\n        acc += c\n        continue\n      } else if (c === '[') {\n        inBrace = true\n        braceStart = i\n        braceNeg = false\n        acc += c\n        continue\n      }\n\n      const doRecurse =\n        !opt.noext &&\n        isExtglobType(c) &&\n        str.charAt(i) === '(' &&\n        /* c8 ignore start - the maxDepth is sufficient here */\n        (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)))\n      /* c8 ignore stop */\n      if (doRecurse) {\n        const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1\n        part.push(acc)\n        acc = ''\n        const ext = new AST(c, part)\n        part.push(ext)\n        i = AST.#parseAST(str, ext, i, opt, extDepth + depthAdd)\n        continue\n      }\n      if (c === '|') {\n        part.push(acc)\n        acc = ''\n        parts.push(part)\n        part = new AST(null, ast)\n        continue\n      }\n      if (c === ')') {\n        if (acc === '' && ast.#parts.length === 0) {\n          ast.#emptyExt = true\n        }\n        part.push(acc)\n        acc = ''\n        ast.push(...parts, part)\n        return i\n      }\n      acc += c\n    }\n\n    // unfinished extglob\n    // if we got here, it was a malformed extglob! not an extglob, but\n    // maybe something else in there.\n    ast.type = null\n    ast.#hasMagic = undefined\n    ast.#parts = [str.substring(pos - 1)]\n    return i\n  }\n\n  #canAdoptWithSpace(child?: AST | string): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    return this.#canAdopt(child, adoptionWithSpaceMap)\n  }\n\n  #canAdopt(\n    child?: AST | string,\n    map: Map = adoptionMap,\n  ): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    if (\n      !child ||\n      typeof child !== 'object' ||\n      child.type !== null ||\n      child.#parts.length !== 1 ||\n      this.type === null\n    ) {\n      return false\n    }\n    const gc = child.#parts[0]\n    if (!gc || typeof gc !== 'object' || gc.type === null) {\n      return false\n    }\n    return (this as AST & { type: ExtglobType }).#canAdoptType(\n      gc.type,\n      map,\n    )\n  }\n  #canAdoptType(\n    c: string,\n    map: Map = adoptionAnyMap,\n  ): c is ExtglobType {\n    return !!map.get(this.type as ExtglobType)?.includes(c as ExtglobType)\n  }\n\n  #adoptWithSpace(\n    this: AST & { type: ExtglobType },\n    child: AST & {\n      type: null\n    },\n    index: number,\n  ) {\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    const blank = new AST(null, gc, this.options)\n    blank.#parts.push('')\n    gc.push(blank)\n    this.#adopt(child, index)\n  }\n\n  #adopt(\n    child: AST & {\n      type: null\n    },\n    index: number,\n  ) {\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    this.#parts.splice(index, 1, ...gc.#parts)\n    for (const p of gc.#parts) {\n      if (typeof p === 'object') p.#parent = this\n    }\n    this.#toString = undefined\n  }\n\n  #canUsurpType(c: string): boolean {\n    const m = usurpMap.get(this.type as ExtglobType)\n    return !!m?.has(c as ExtglobType)\n  }\n\n  #canUsurp(child?: AST | string): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    if (\n      !child ||\n      typeof child !== 'object' ||\n      child.type !== null ||\n      child.#parts.length !== 1 ||\n      this.type === null ||\n      this.#parts.length !== 1\n    ) {\n      return false\n    }\n    const gc = child.#parts[0]\n    if (!gc || typeof gc !== 'object' || gc.type === null) {\n      return false\n    }\n    return (this as AST & { type: ExtglobType }).#canUsurpType(gc.type)\n  }\n\n  #usurp(this: AST & { type: ExtglobType }, child: AST & { type: null }) {\n    const m = usurpMap.get(this.type as ExtglobType)\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    const nt = m?.get(gc.type)\n    /* c8 ignore start - impossible */\n    if (!nt) return false\n    /* c8 ignore stop */\n    this.#parts = gc.#parts\n    for (const p of this.#parts) {\n      if (typeof p === 'object') {\n        p.#parent = this\n      }\n    }\n    this.type = nt\n    this.#toString = undefined\n    this.#emptyExt = false\n  }\n\n  static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n    const ast = new AST(null, undefined, options)\n    AST.#parseAST(pattern, ast, 0, options, 0)\n    return ast\n  }\n\n  // returns the regular expression if there's magic, or the unescaped\n  // string if not.\n  toMMPattern(): MMRegExp | string {\n    // should only be called on root\n    /* c8 ignore start */\n    if (this !== this.#root) return this.#root.toMMPattern()\n    /* c8 ignore stop */\n    const glob = this.toString()\n    const [re, body, hasMagic, uflag] = this.toRegExpSource()\n    // if we're in nocase mode, and not nocaseMagicOnly, then we do\n    // still need a regular expression if we have to case-insensitively\n    // match capital/lowercase characters.\n    const anyMagic =\n      hasMagic ||\n      this.#hasMagic ||\n      (this.#options.nocase &&\n        !this.#options.nocaseMagicOnly &&\n        glob.toUpperCase() !== glob.toLowerCase())\n    if (!anyMagic) {\n      return body\n    }\n\n    const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n    return Object.assign(new RegExp(`^${re}$`, flags), {\n      _src: re,\n      _glob: glob,\n    })\n  }\n\n  get options() {\n    return this.#options\n  }\n\n  // returns the string match, the regexp source, whether there's magic\n  // in the regexp (so a regular expression is required) and whether or\n  // not the uflag is needed for the regular expression (for posix classes)\n  // TODO: instead of injecting the start/end at this point, just return\n  // the BODY of the regexp, along with the start/end portions suitable\n  // for binding the start/end in either a joined full-path makeRe context\n  // (where we bind to (^|/), or a standalone matchPart context (where\n  // we bind to ^, and not /).  Otherwise slashes get duped!\n  //\n  // In part-matching mode, the start is:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n  // - if dots allowed or not possible: ^\n  // - if dots possible and not allowed: ^(?!\\.)\n  // end is:\n  // - if not isEnd(): nothing\n  // - else: $\n  //\n  // In full-path matching mode, we put the slash at the START of the\n  // pattern, so start is:\n  // - if first pattern: same as part-matching mode\n  // - if not isStart(): nothing\n  // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n  // - if dots allowed or not possible: /\n  // - if dots possible and not allowed: /(?!\\.)\n  // end is:\n  // - if last pattern, same as part-matching mode\n  // - else nothing\n  //\n  // Always put the (?:$|/) on negated tails, though, because that has to be\n  // there to bind the end of the negated pattern portion, and it's easier to\n  // just stick it in now rather than try to inject it later in the middle of\n  // the pattern.\n  //\n  // We can just always return the same end, and leave it up to the caller\n  // to know whether it's going to be used joined or in parts.\n  // And, if the start is adjusted slightly, can do the same there:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n  // - if dots allowed or not possible: (?:/|^)\n  // - if dots possible and not allowed: (?:/|^)(?!\\.)\n  //\n  // But it's better to have a simpler binding without a conditional, for\n  // performance, so probably better to return both start options.\n  //\n  // Then the caller just ignores the end if it's not the first pattern,\n  // and the start always gets applied.\n  //\n  // But that's always going to be $ if it's the ending pattern, or nothing,\n  // so the caller can just attach $ at the end of the pattern when building.\n  //\n  // So the todo is:\n  // - better detect what kind of start is needed\n  // - return both flavors of starting pattern\n  // - attach $ at the end of the pattern when creating the actual RegExp\n  //\n  // Ah, but wait, no, that all only applies to the root when the first pattern\n  // is not an extglob. If the first pattern IS an extglob, then we need all\n  // that dot prevention biz to live in the extglob portions, because eg\n  // +(*|.x*) can match .xy but not .yx.\n  //\n  // So, return the two flavors if it's #root and the first child is not an\n  // AST, otherwise leave it to the child AST to handle it, and there,\n  // use the (?:^|/) style of start binding.\n  //\n  // Even simplified further:\n  // - Since the start for a join is eg /(?!\\.) and the start for a part\n  // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n  // or start or whatever) and prepend ^ or / at the Regexp construction.\n  toRegExpSource(\n    allowDot?: boolean,\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    const dot = allowDot ?? !!this.#options.dot\n    if (this.#root === this) {\n      this.#flatten()\n      this.#fillNegs()\n    }\n    if (!isExtglobAST(this)) {\n      const noEmpty =\n        this.isStart() &&\n        this.isEnd() &&\n        !this.#parts.some(s => typeof s !== 'string')\n      const src = this.#parts\n        .map(p => {\n          const [re, _, hasMagic, uflag] =\n            typeof p === 'string' ?\n              AST.#parseGlob(p, this.#hasMagic, noEmpty)\n            : p.toRegExpSource(allowDot)\n          this.#hasMagic = this.#hasMagic || hasMagic\n          this.#uflag = this.#uflag || uflag\n          return re\n        })\n        .join('')\n\n      let start = ''\n      if (this.isStart()) {\n        if (typeof this.#parts[0] === 'string') {\n          // this is the string that will match the start of the pattern,\n          // so we need to protect against dots and such.\n\n          // '.' and '..' cannot match unless the pattern is that exactly,\n          // even if it starts with . or dot:true is set.\n          const dotTravAllowed =\n            this.#parts.length === 1 && justDots.has(this.#parts[0])\n          if (!dotTravAllowed) {\n            const aps = addPatternStart\n            // check if we have a possibility of matching . or ..,\n            // and prevent that.\n            const needNoTrav =\n              // dots are allowed, and the pattern starts with [ or .\n              (dot && aps.has(src.charAt(0))) ||\n              // the pattern starts with \\., and then [ or .\n              (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n              // the pattern starts with \\.\\., and then [ or .\n              (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n            // no need to prevent dots if it can't match a dot, or if a\n            // sub-pattern will be preventing it anyway.\n            const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n            start =\n              needNoTrav ? startNoTraversal\n              : needNoDot ? startNoDot\n              : ''\n          }\n        }\n      }\n\n      // append the \"end of path portion\" pattern to negation tails\n      let end = ''\n      if (\n        this.isEnd() &&\n        this.#root.#filledNegs &&\n        this.#parent?.type === '!'\n      ) {\n        end = '(?:$|\\\\/)'\n      }\n      const final = start + src + end\n      return [\n        final,\n        unescape(src),\n        (this.#hasMagic = !!this.#hasMagic),\n        this.#uflag,\n      ]\n    }\n\n    // We need to calculate the body *twice* if it's a repeat pattern\n    // at the start, once in nodot mode, then again in dot mode, so a\n    // pattern like *(?) can match 'x.y'\n\n    const repeated = this.type === '*' || this.type === '+'\n    // some kind of extglob\n    const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n    let body = (this as AST & { type: ExtglobType }).#partsToRegExp(dot)\n\n    if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n      // invalid extglob, has to at least be *something* present, if it's\n      // the entire path portion.\n      const s = this.toString()\n      const me = this as AST\n      me.#parts = [s]\n      me.type = null\n      me.#hasMagic = undefined\n      return [s, unescape(this.toString()), false, false]\n    }\n\n    let bodyDotAllowed =\n      !repeated || allowDot || dot || !startNoDot ?\n        ''\n      : this.#partsToRegExp(true)\n    if (bodyDotAllowed === body) {\n      bodyDotAllowed = ''\n    }\n    if (bodyDotAllowed) {\n      body = `(?:${body})(?:${bodyDotAllowed})*?`\n    }\n\n    // an empty !() is exactly equivalent to a starNoEmpty\n    let final = ''\n    if (this.type === '!' && this.#emptyExt) {\n      final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n    } else {\n      const close =\n        this.type === '!' ?\n          // !() must match something,but !(x) can match ''\n          '))' +\n          (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n          star +\n          ')'\n        : this.type === '@' ? ')'\n        : this.type === '?' ? ')?'\n        : this.type === '+' && bodyDotAllowed ? ')'\n        : this.type === '*' && bodyDotAllowed ? `)?`\n        : `)${this.type}`\n      final = start + body + close\n    }\n    return [\n      final,\n      unescape(body),\n      (this.#hasMagic = !!this.#hasMagic),\n      this.#uflag,\n    ]\n  }\n\n  #flatten() {\n    if (!isExtglobAST(this)) {\n      for (const p of this.#parts) {\n        if (typeof p === 'object') {\n          p.#flatten()\n        }\n      }\n    } else {\n      // do up to 10 passes to flatten as much as possible\n      let iterations = 0\n      let done = false\n      do {\n        done = true\n        for (let i = 0; i < this.#parts.length; i++) {\n          const c = this.#parts[i]\n          if (typeof c === 'object') {\n            c.#flatten()\n            if (this.#canAdopt(c)) {\n              done = false\n              this.#adopt(c, i)\n            } else if (this.#canAdoptWithSpace(c)) {\n              done = false\n              ;(this as AST & { type: ExtglobType }).#adoptWithSpace(c, i)\n            } else if (this.#canUsurp(c)) {\n              done = false\n              ;(this as AST & { type: ExtglobType }).#usurp(c)\n            }\n          }\n        }\n      } while (!done && ++iterations < 10)\n    }\n    this.#toString = undefined\n  }\n\n  #partsToRegExp(this: AST & { type: ExtglobType }, dot: boolean) {\n    return this.#parts\n      .map(p => {\n        // extglob ASTs should only contain parent ASTs\n        /* c8 ignore start */\n        if (typeof p === 'string') {\n          throw new Error('string type in extglob ast??')\n        }\n        /* c8 ignore stop */\n        // can ignore hasMagic, because extglobs are already always magic\n        const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n        this.#uflag = this.#uflag || uflag\n        return re\n      })\n      .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n      .join('|')\n  }\n\n  static #parseGlob(\n    glob: string,\n    hasMagic: boolean | undefined,\n    noEmpty: boolean = false,\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    let escaping = false\n    let re = ''\n    let uflag = false\n    // multiple stars that aren't globstars coalesce into one *\n    let inStar = false\n    for (let i = 0; i < glob.length; i++) {\n      const c = glob.charAt(i)\n      if (escaping) {\n        escaping = false\n        re += (reSpecials.has(c) ? '\\\\' : '') + c\n        continue\n      }\n      if (c === '*') {\n        if (inStar) continue\n        inStar = true\n        re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star\n        hasMagic = true\n        continue\n      } else {\n        inStar = false\n      }\n      if (c === '\\\\') {\n        if (i === glob.length - 1) {\n          re += '\\\\\\\\'\n        } else {\n          escaping = true\n        }\n        continue\n      }\n      if (c === '[') {\n        const [src, needUflag, consumed, magic] = parseClass(glob, i)\n        if (consumed) {\n          re += src\n          uflag = uflag || needUflag\n          i += consumed - 1\n          hasMagic = hasMagic || magic\n          continue\n        }\n      }\n      if (c === '?') {\n        re += qmark\n        hasMagic = true\n        continue\n      }\n      re += regExpEscape(c)\n    }\n    return [re, unescape(glob), !!hasMagic, uflag]\n  }\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b1572deb95e2e376474f9fc1e56e4c38a055fbd1
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.d.ts
@@ -0,0 +1,8 @@
+export type ParseClassResult = [
+    src: string,
+    uFlag: boolean,
+    consumed: number,
+    hasMagic: boolean
+];
+export declare const parseClass: (glob: string, position: number) => ParseClassResult;
+//# sourceMappingURL=brace-expressions.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..09b4c11060de7850a23ad17948c7d5d674850576
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js
new file mode 100644
index 0000000000000000000000000000000000000000..4b49d40bd74210708c8afdee944010ca1023fb83
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js
@@ -0,0 +1,146 @@
+// translate the various posix character classes into unicode properties
+// this works across all unicode locales
+// { : [, /u flag required, negated]
+const posixClasses = {
+    '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
+    '[:alpha:]': ['\\p{L}\\p{Nl}', true],
+    '[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
+    '[:blank:]': ['\\p{Zs}\\t', true],
+    '[:cntrl:]': ['\\p{Cc}', true],
+    '[:digit:]': ['\\p{Nd}', true],
+    '[:graph:]': ['\\p{Z}\\p{C}', true, true],
+    '[:lower:]': ['\\p{Ll}', true],
+    '[:print:]': ['\\p{C}', true],
+    '[:punct:]': ['\\p{P}', true],
+    '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
+    '[:upper:]': ['\\p{Lu}', true],
+    '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
+    '[:xdigit:]': ['A-Fa-f0-9', false],
+};
+// only need to escape a few things inside of brace expressions
+// escapes: [ \ ] -
+const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
+// escape all regexp magic characters
+const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+// everything has already been escaped, we just have to join
+const rangesToString = (ranges) => ranges.join('');
+// takes a glob string at a posix brace expression, and returns
+// an equivalent regular expression source, and boolean indicating
+// whether the /u flag needs to be applied, and the number of chars
+// consumed to parse the character class.
+// This also removes out of order ranges, and returns ($.) if the
+// entire class just no good.
+export const parseClass = (glob, position) => {
+    const pos = position;
+    /* c8 ignore start */
+    if (glob.charAt(pos) !== '[') {
+        throw new Error('not in a brace expression');
+    }
+    /* c8 ignore stop */
+    const ranges = [];
+    const negs = [];
+    let i = pos + 1;
+    let sawStart = false;
+    let uflag = false;
+    let escaping = false;
+    let negate = false;
+    let endPos = pos;
+    let rangeStart = '';
+    WHILE: while (i < glob.length) {
+        const c = glob.charAt(i);
+        if ((c === '!' || c === '^') && i === pos + 1) {
+            negate = true;
+            i++;
+            continue;
+        }
+        if (c === ']' && sawStart && !escaping) {
+            endPos = i + 1;
+            break;
+        }
+        sawStart = true;
+        if (c === '\\') {
+            if (!escaping) {
+                escaping = true;
+                i++;
+                continue;
+            }
+            // escaped \ char, fall through and treat like normal char
+        }
+        if (c === '[' && !escaping) {
+            // either a posix class, a collation equivalent, or just a [
+            for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
+                if (glob.startsWith(cls, i)) {
+                    // invalid, [a-[] is fine, but not [a-[:alpha]]
+                    if (rangeStart) {
+                        return ['$.', false, glob.length - pos, true];
+                    }
+                    i += cls.length;
+                    if (neg)
+                        negs.push(unip);
+                    else
+                        ranges.push(unip);
+                    uflag = uflag || u;
+                    continue WHILE;
+                }
+            }
+        }
+        // now it's just a normal character, effectively
+        escaping = false;
+        if (rangeStart) {
+            // throw this range away if it's not valid, but others
+            // can still match.
+            if (c > rangeStart) {
+                ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
+            }
+            else if (c === rangeStart) {
+                ranges.push(braceEscape(c));
+            }
+            rangeStart = '';
+            i++;
+            continue;
+        }
+        // now might be the start of a range.
+        // can be either c-d or c-] or c] or c] at this point
+        if (glob.startsWith('-]', i + 1)) {
+            ranges.push(braceEscape(c + '-'));
+            i += 2;
+            continue;
+        }
+        if (glob.startsWith('-', i + 1)) {
+            rangeStart = c;
+            i += 2;
+            continue;
+        }
+        // not the start of a range, just a single character
+        ranges.push(braceEscape(c));
+        i++;
+    }
+    if (endPos < i) {
+        // didn't see the end of the class, not a valid class,
+        // but might still be valid as a literal match.
+        return ['', false, 0, false];
+    }
+    // if we got no ranges and no negates, then we have a range that
+    // cannot possibly match anything, and that poisons the whole glob
+    if (!ranges.length && !negs.length) {
+        return ['$.', false, glob.length - pos, true];
+    }
+    // if we got one positive range, and it's a single character, then that's
+    // not actually a magic pattern, it's just that one literal character.
+    // we should not treat that as "magic", we should just return the literal
+    // character. [_] is a perfectly valid way to escape glob magic chars.
+    if (negs.length === 0 &&
+        ranges.length === 1 &&
+        /^\\?.$/.test(ranges[0]) &&
+        !negate) {
+        const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
+        return [regexpEscape(r), false, endPos - pos, false];
+    }
+    const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
+    const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
+    const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
+        : ranges.length ? sranges
+            : snegs;
+    return [comb, uflag, endPos - pos, true];
+};
+//# sourceMappingURL=brace-expressions.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..184b5a89c11f4cc9705018a2b11a36cd7acacf02
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/brace-expressions.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,wCAAwC;AAExC,8DAA8D;AAC9D,MAAM,YAAY,GAChB;IACE,WAAW,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC;IAC3C,WAAW,EAAE,C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E,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,KAAK,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,CAAA;IACxE,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACpE,MAAM,IAAI,GACR,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG;QAChE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;YACzB,CAAC,CAAC,KAAK,CAAA;IAET,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAA","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { : [, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } =\n  {\n    '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n    '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n    '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n    '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n    '[:cntrl:]': ['\\\\p{Cc}', true],\n    '[:digit:]': ['\\\\p{Nd}', true],\n    '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n    '[:lower:]': ['\\\\p{Ll}', true],\n    '[:print:]': ['\\\\p{C}', true],\n    '[:punct:]': ['\\\\p{P}', true],\n    '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n    '[:upper:]': ['\\\\p{Lu}', true],\n    '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n    '[:xdigit:]': ['A-Fa-f0-9', false],\n  }\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n  src: string,\n  uFlag: boolean,\n  consumed: number,\n  hasMagic: boolean,\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n  glob: string,\n  position: number,\n): ParseClassResult => {\n  const pos = position\n  /* c8 ignore start */\n  if (glob.charAt(pos) !== '[') {\n    throw new Error('not in a brace expression')\n  }\n  /* c8 ignore stop */\n  const ranges: string[] = []\n  const negs: string[] = []\n\n  let i = pos + 1\n  let sawStart = false\n  let uflag = false\n  let escaping = false\n  let negate = false\n  let endPos = pos\n  let rangeStart = ''\n  WHILE: while (i < glob.length) {\n    const c = glob.charAt(i)\n    if ((c === '!' || c === '^') && i === pos + 1) {\n      negate = true\n      i++\n      continue\n    }\n\n    if (c === ']' && sawStart && !escaping) {\n      endPos = i + 1\n      break\n    }\n\n    sawStart = true\n    if (c === '\\\\') {\n      if (!escaping) {\n        escaping = true\n        i++\n        continue\n      }\n      // escaped \\ char, fall through and treat like normal char\n    }\n    if (c === '[' && !escaping) {\n      // either a posix class, a collation equivalent, or just a [\n      for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n        if (glob.startsWith(cls, i)) {\n          // invalid, [a-[] is fine, but not [a-[:alpha]]\n          if (rangeStart) {\n            return ['$.', false, glob.length - pos, true]\n          }\n          i += cls.length\n          if (neg) negs.push(unip)\n          else ranges.push(unip)\n          uflag = uflag || u\n          continue WHILE\n        }\n      }\n    }\n\n    // now it's just a normal character, effectively\n    escaping = false\n    if (rangeStart) {\n      // throw this range away if it's not valid, but others\n      // can still match.\n      if (c > rangeStart) {\n        ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n      } else if (c === rangeStart) {\n        ranges.push(braceEscape(c))\n      }\n      rangeStart = ''\n      i++\n      continue\n    }\n\n    // now might be the start of a range.\n    // can be either c-d or c-] or c] or c] at this point\n    if (glob.startsWith('-]', i + 1)) {\n      ranges.push(braceEscape(c + '-'))\n      i += 2\n      continue\n    }\n    if (glob.startsWith('-', i + 1)) {\n      rangeStart = c\n      i += 2\n      continue\n    }\n\n    // not the start of a range, just a single character\n    ranges.push(braceEscape(c))\n    i++\n  }\n\n  if (endPos < i) {\n    // didn't see the end of the class, not a valid class,\n    // but might still be valid as a literal match.\n    return ['', false, 0, false]\n  }\n\n  // if we got no ranges and no negates, then we have a range that\n  // cannot possibly match anything, and that poisons the whole glob\n  if (!ranges.length && !negs.length) {\n    return ['$.', false, glob.length - pos, true]\n  }\n\n  // if we got one positive range, and it's a single character, then that's\n  // not actually a magic pattern, it's just that one literal character.\n  // we should not treat that as \"magic\", we should just return the literal\n  // character. [_] is a perfectly valid way to escape glob magic chars.\n  if (\n    negs.length === 0 &&\n    ranges.length === 1 &&\n    /^\\\\?.$/.test(ranges[0]) &&\n    !negate\n  ) {\n    const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n    return [regexpEscape(r), false, endPos - pos, false]\n  }\n\n  const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n  const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n  const comb =\n    ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n    : ranges.length ? sranges\n    : snegs\n\n  return [comb, uflag, endPos - pos, true]\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..141024a06bdf747fe6d6ecc48a80675dff795800
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.d.ts
@@ -0,0 +1,15 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ *
+ * If the {@link MinimatchOptions.magicalBraces} option is used,
+ * then braces (`{` and `}`) will be escaped.
+ */
+export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=escape.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..e167e30065a04e54a37b3f6e6b44275c42c3c602
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"escape.d.ts","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GACjB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAazE,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js
new file mode 100644
index 0000000000000000000000000000000000000000..46d0ec8858e5b3a2fdc692dfb6fbe69fb37c4068
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js
@@ -0,0 +1,26 @@
+/**
+ * Escape all magic characters in a glob pattern.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape}
+ * option is used, then characters are escaped by wrapping in `[]`, because
+ * a magic character wrapped in a character class can only be satisfied by
+ * that exact character.  In this mode, `\` is _not_ escaped, because it is
+ * not interpreted as a magic character, but instead as a path separator.
+ *
+ * If the {@link MinimatchOptions.magicalBraces} option is used,
+ * then braces (`{` and `}`) will be escaped.
+ */
+export const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {
+    // don't need to escape +@! because we escape the parens
+    // that make those magic, and escaping ! as [!] isn't valid,
+    // because [!]] is a valid glob class meaning not ']'.
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/[?*()[\]{}]/g, '[$&]')
+            : s.replace(/[?*()[\]\\{}]/g, '\\$&');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/[?*()[\]]/g, '[$&]')
+        : s.replace(/[?*()[\]\\]/g, '\\$&');
+};
+//# sourceMappingURL=escape.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..4740508f687a904a44be71d42e0e0bf1438ea215
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/escape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character.  In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = false,\n  }: Pick = {},\n) => {\n  // don't need to escape +@! because we escape the parens\n  // that make those magic, and escaping ! as [!] isn't valid,\n  // because [!]] is a valid glob class meaning not ']'.\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/[?*()[\\]{}]/g, '[$&]')\n      : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/[?*()[\\]]/g, '[$&]')\n    : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7e1fc2edaadbe09033faefbd7363f0cba109bafc
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.d.ts
@@ -0,0 +1,174 @@
+import { AST } from './ast.js';
+export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
+export interface MinimatchOptions {
+    /** do not expand `{x,y}` style braces */
+    nobrace?: boolean;
+    /** do not treat patterns starting with `#` as a comment */
+    nocomment?: boolean;
+    /** do not treat patterns starting with `!` as a negation */
+    nonegate?: boolean;
+    /** print LOTS of debugging output */
+    debug?: boolean;
+    /** treat `**` the same as `*` */
+    noglobstar?: boolean;
+    /** do not expand extglobs like `+(a|b)` */
+    noext?: boolean;
+    /** return the pattern if nothing matches */
+    nonull?: boolean;
+    /** treat `\\` as a path separator, not an escape character */
+    windowsPathsNoEscape?: boolean;
+    /**
+     * inverse of {@link MinimatchOptions.windowsPathsNoEscape}
+     * @deprecated
+     */
+    allowWindowsEscape?: boolean;
+    /**
+     * Compare a partial path to a pattern. As long as the parts
+     * of the path that are present are not contradicted by the
+     * pattern, it will be treated as a match. This is useful in
+     * applications where you're walking through a folder structure,
+     * and don't yet have the full path, but want to ensure that you
+     * do not walk down paths that can never be a match.
+     */
+    partial?: boolean;
+    /** allow matches that start with `.` even if the pattern does not */
+    dot?: boolean;
+    /** ignore case */
+    nocase?: boolean;
+    /** ignore case only in wildcard patterns */
+    nocaseMagicOnly?: boolean;
+    /** consider braces to be "magic" for the purpose of `hasMagic` */
+    magicalBraces?: boolean;
+    /**
+     * If set, then patterns without slashes will be matched
+     * against the basename of the path if it contains slashes.
+     * For example, `a?b` would match the path `/xyz/123/acb`, but
+     * not `/xyz/acb/123`.
+     */
+    matchBase?: boolean;
+    /** invert the results of negated matches */
+    flipNegate?: boolean;
+    /** do not collapse multiple `/` into a single `/` */
+    preserveMultipleSlashes?: boolean;
+    /**
+     * A number indicating the level of optimization that should be done
+     * to the pattern prior to parsing and using it for matches.
+     */
+    optimizationLevel?: number;
+    /** operating system platform */
+    platform?: Platform;
+    /**
+     * When a pattern starts with a UNC path or drive letter, and in
+     * `nocase:true` mode, do not convert the root portions of the
+     * pattern into a case-insensitive regular expression, and instead
+     * leave them as strings.
+     *
+     * This is the default when the platform is `win32` and
+     * `nocase:true` is set.
+     */
+    windowsNoMagicRoot?: boolean;
+    /**
+     * max number of `{...}` patterns to expand. Default 100_000.
+     */
+    braceExpandMax?: number;
+    /**
+     * Max number of non-adjacent `**` patterns to recursively walk down.
+     *
+     * The default of 200 is almost certainly high enough for most purposes,
+     * and can handle absurdly excessive patterns.
+     */
+    maxGlobstarRecursion?: number;
+    /**
+     * Max depth to traverse for nested extglobs like `*(a|b|c)`
+     *
+     * Default is 2, which is quite low, but any higher value
+     * swiftly results in punishing performance impacts. Note
+     * that this is *not*  relevant when the globstar types can
+     * be safely coalesced into a single set.
+     *
+     * For example, `*(a|@(b|c)|d)` would be flattened into
+     * `*(a|b|c|d)`. Thus, many common extglobs will retain good
+     * performance and  never hit this limit, even if they are
+     * excessively deep and complicated.
+     *
+     * If the limit is hit, then the extglob characters are simply
+     * not parsed, and the pattern effectively switches into
+     * `noextglob: true` mode for the contents of that nested
+     * sub-pattern. This will typically _not_ result in a match,
+     * but is considered a valid trade-off for security and
+     * performance.
+     */
+    maxExtglobRecursion?: number;
+}
+export declare const minimatch: {
+    (p: string, pattern: string, options?: MinimatchOptions): boolean;
+    sep: Sep;
+    GLOBSTAR: typeof GLOBSTAR;
+    filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
+    defaults: (def: MinimatchOptions) => typeof minimatch;
+    braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
+    makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
+    match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
+    AST: typeof AST;
+    Minimatch: typeof Minimatch;
+    escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+    unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+};
+export type Sep = '\\' | '/';
+export declare const sep: Sep;
+export declare const GLOBSTAR: unique symbol;
+export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
+export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
+export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
+export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
+export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
+export type MMRegExp = RegExp & {
+    _src?: string;
+    _glob?: string;
+};
+export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
+export type ParseReturn = ParseReturnFiltered | false;
+export declare class Minimatch {
+    #private;
+    options: MinimatchOptions;
+    set: ParseReturnFiltered[][];
+    pattern: string;
+    windowsPathsNoEscape: boolean;
+    nonegate: boolean;
+    negate: boolean;
+    comment: boolean;
+    empty: boolean;
+    preserveMultipleSlashes: boolean;
+    partial: boolean;
+    globSet: string[];
+    globParts: string[][];
+    nocase: boolean;
+    isWindows: boolean;
+    platform: Platform;
+    windowsNoMagicRoot: boolean;
+    maxGlobstarRecursion: number;
+    regexp: false | null | MMRegExp;
+    constructor(pattern: string, options?: MinimatchOptions);
+    hasMagic(): boolean;
+    debug(..._: unknown[]): void;
+    make(): void;
+    preprocess(globParts: string[][]): string[][];
+    adjascentGlobstarOptimize(globParts: string[][]): string[][];
+    levelOneOptimize(globParts: string[][]): string[][];
+    levelTwoFileOptimize(parts: string | string[]): string[];
+    firstPhasePreProcess(globParts: string[][]): string[][];
+    secondPhasePreProcess(globParts: string[][]): string[][];
+    partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
+    parseNegate(): void;
+    matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
+    braceExpand(): string[];
+    parse(pattern: string): ParseReturn;
+    makeRe(): false | MMRegExp;
+    slashSplit(p: string): string[];
+    match(f: string, partial?: boolean): boolean;
+    static defaults(def: MinimatchOptions): typeof Minimatch;
+}
+export { AST } from './ast.js';
+export { escape } from './escape.js';
+export { unescape } from './unescape.js';
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..7620db91cc81855821dded14c51fdfe9b0cd1d6a
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC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AC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..a5e6fa88fdc6d6ec05d26ab4975718824cbc8bdc
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js
@@ -0,0 +1,1114 @@
+import { expand } from 'brace-expansion';
+import { assertValidPattern } from './assert-valid-pattern.js';
+import { AST } from './ast.js';
+import { escape } from './escape.js';
+import { unescape } from './unescape.js';
+export const minimatch = (p, pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // shortcut: comments match nothing.
+    if (!options.nocomment && pattern.charAt(0) === '#') {
+        return false;
+    }
+    return new Minimatch(pattern, options).match(p);
+};
+// Optimized checking for the most common glob patterns.
+const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
+const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
+const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
+const starDotExtTestNocase = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
+};
+const starDotExtTestNocaseDot = (ext) => {
+    ext = ext.toLowerCase();
+    return (f) => f.toLowerCase().endsWith(ext);
+};
+const starDotStarRE = /^\*+\.\*+$/;
+const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
+const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
+const dotStarRE = /^\.\*+$/;
+const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
+const starRE = /^\*+$/;
+const starTest = (f) => f.length !== 0 && !f.startsWith('.');
+const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
+const qmarksRE = /^\?+([^+@!?*[(]*)?$/;
+const qmarksTestNocase = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestNocaseDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    if (!ext)
+        return noext;
+    ext = ext.toLowerCase();
+    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
+};
+const qmarksTestDot = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExtDot([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTest = ([$0, ext = '']) => {
+    const noext = qmarksTestNoExt([$0]);
+    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
+};
+const qmarksTestNoExt = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && !f.startsWith('.');
+};
+const qmarksTestNoExtDot = ([$0]) => {
+    const len = $0.length;
+    return (f) => f.length === len && f !== '.' && f !== '..';
+};
+/* c8 ignore start */
+const defaultPlatform = (typeof process === 'object' && process ?
+    (typeof process.env === 'object' &&
+        process.env &&
+        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
+        process.platform
+    : 'posix');
+const path = {
+    win32: { sep: '\\' },
+    posix: { sep: '/' },
+};
+/* c8 ignore stop */
+export const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
+minimatch.sep = sep;
+export const GLOBSTAR = Symbol('globstar **');
+minimatch.GLOBSTAR = GLOBSTAR;
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+const qmark = '[^/]';
+// * => any number of characters
+const star = qmark + '*?';
+// ** when dots are allowed.  Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
+export const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
+minimatch.filter = filter;
+const ext = (a, b = {}) => Object.assign({}, a, b);
+export const defaults = (def) => {
+    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
+        return minimatch;
+    }
+    const orig = minimatch;
+    const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
+    return Object.assign(m, {
+        Minimatch: class Minimatch extends orig.Minimatch {
+            constructor(pattern, options = {}) {
+                super(pattern, ext(def, options));
+            }
+            static defaults(options) {
+                return orig.defaults(ext(def, options)).Minimatch;
+            }
+        },
+        AST: class AST extends orig.AST {
+            /* c8 ignore start */
+            constructor(type, parent, options = {}) {
+                super(type, parent, ext(def, options));
+            }
+            /* c8 ignore stop */
+            static fromGlob(pattern, options = {}) {
+                return orig.AST.fromGlob(pattern, ext(def, options));
+            }
+        },
+        unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
+        escape: (s, options = {}) => orig.escape(s, ext(def, options)),
+        filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
+        defaults: (options) => orig.defaults(ext(def, options)),
+        makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
+        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
+        match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
+        sep: orig.sep,
+        GLOBSTAR: GLOBSTAR,
+    });
+};
+minimatch.defaults = defaults;
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+export const braceExpand = (pattern, options = {}) => {
+    assertValidPattern(pattern);
+    // Thanks to Yeting Li  for
+    // improving this regexp to avoid a ReDOS vulnerability.
+    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
+        // shortcut. no need to expand.
+        return [pattern];
+    }
+    return expand(pattern, { max: options.braceExpandMax });
+};
+minimatch.braceExpand = braceExpand;
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion.  Otherwise, any series
+// of * is equivalent to a single *.  Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+export const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
+minimatch.makeRe = makeRe;
+export const match = (list, pattern, options = {}) => {
+    const mm = new Minimatch(pattern, options);
+    list = list.filter(f => mm.match(f));
+    if (mm.options.nonull && !list.length) {
+        list.push(pattern);
+    }
+    return list;
+};
+minimatch.match = match;
+// replace stuff like \* with *
+const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
+const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
+export class Minimatch {
+    options;
+    set;
+    pattern;
+    windowsPathsNoEscape;
+    nonegate;
+    negate;
+    comment;
+    empty;
+    preserveMultipleSlashes;
+    partial;
+    globSet;
+    globParts;
+    nocase;
+    isWindows;
+    platform;
+    windowsNoMagicRoot;
+    maxGlobstarRecursion;
+    regexp;
+    constructor(pattern, options = {}) {
+        assertValidPattern(pattern);
+        options = options || {};
+        this.options = options;
+        this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
+        this.pattern = pattern;
+        this.platform = options.platform || defaultPlatform;
+        this.isWindows = this.platform === 'win32';
+        // avoid the annoying deprecation flag lol
+        const awe = ('allowWindow' + 'sEscape');
+        this.windowsPathsNoEscape =
+            !!options.windowsPathsNoEscape || options[awe] === false;
+        if (this.windowsPathsNoEscape) {
+            this.pattern = this.pattern.replace(/\\/g, '/');
+        }
+        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
+        this.regexp = null;
+        this.negate = false;
+        this.nonegate = !!options.nonegate;
+        this.comment = false;
+        this.empty = false;
+        this.partial = !!options.partial;
+        this.nocase = !!this.options.nocase;
+        this.windowsNoMagicRoot =
+            options.windowsNoMagicRoot !== undefined ?
+                options.windowsNoMagicRoot
+                : !!(this.isWindows && this.nocase);
+        this.globSet = [];
+        this.globParts = [];
+        this.set = [];
+        // make the set of regexps etc.
+        this.make();
+    }
+    hasMagic() {
+        if (this.options.magicalBraces && this.set.length > 1) {
+            return true;
+        }
+        for (const pattern of this.set) {
+            for (const part of pattern) {
+                if (typeof part !== 'string')
+                    return true;
+            }
+        }
+        return false;
+    }
+    debug(..._) { }
+    make() {
+        const pattern = this.pattern;
+        const options = this.options;
+        // empty patterns and comments match nothing.
+        if (!options.nocomment && pattern.charAt(0) === '#') {
+            this.comment = true;
+            return;
+        }
+        if (!pattern) {
+            this.empty = true;
+            return;
+        }
+        // step 1: figure out negation, etc.
+        this.parseNegate();
+        // step 2: expand braces
+        this.globSet = [...new Set(this.braceExpand())];
+        if (options.debug) {
+            //oxlint-disable-next-line no-console
+            this.debug = (...args) => console.error(...args);
+        }
+        this.debug(this.pattern, this.globSet);
+        // step 3: now we have a set, so turn each one into a series of
+        // path-portion matching patterns.
+        // These will be regexps, except in the case of "**", which is
+        // set to the GLOBSTAR object for globstar behavior,
+        // and will not contain any / characters
+        //
+        // First, we preprocess to make the glob pattern sets a bit simpler
+        // and deduped.  There are some perf-killing patterns that can cause
+        // problems with a glob walk, but we can simplify them down a bit.
+        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
+        this.globParts = this.preprocess(rawGlobParts);
+        this.debug(this.pattern, this.globParts);
+        // glob --> regexps
+        let set = this.globParts.map((s, _, __) => {
+            if (this.isWindows && this.windowsNoMagicRoot) {
+                // check if it's a drive or unc path.
+                const isUNC = s[0] === '' &&
+                    s[1] === '' &&
+                    (s[2] === '?' || !globMagic.test(s[2])) &&
+                    !globMagic.test(s[3]);
+                const isDrive = /^[a-z]:/i.test(s[0]);
+                if (isUNC) {
+                    return [
+                        ...s.slice(0, 4),
+                        ...s.slice(4).map(ss => this.parse(ss)),
+                    ];
+                }
+                else if (isDrive) {
+                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
+                }
+            }
+            return s.map(ss => this.parse(ss));
+        });
+        this.debug(this.pattern, set);
+        // filter out everything that didn't compile properly.
+        this.set = set.filter(s => s.indexOf(false) === -1);
+        // do not treat the ? in UNC paths as magic
+        if (this.isWindows) {
+            for (let i = 0; i < this.set.length; i++) {
+                const p = this.set[i];
+                if (p[0] === '' &&
+                    p[1] === '' &&
+                    this.globParts[i][2] === '?' &&
+                    typeof p[3] === 'string' &&
+                    /^[a-z]:$/i.test(p[3])) {
+                    p[2] = '?';
+                }
+            }
+        }
+        this.debug(this.pattern, this.set);
+    }
+    // various transforms to equivalent pattern sets that are
+    // faster to process in a filesystem walk.  The goal is to
+    // eliminate what we can, and push all ** patterns as far
+    // to the right as possible, even if it increases the number
+    // of patterns that we have to process.
+    preprocess(globParts) {
+        // if we're not in globstar mode, then turn ** into *
+        if (this.options.noglobstar) {
+            for (const partset of globParts) {
+                for (let j = 0; j < partset.length; j++) {
+                    if (partset[j] === '**') {
+                        partset[j] = '*';
+                    }
+                }
+            }
+        }
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            // aggressive optimization for the purpose of fs walking
+            globParts = this.firstPhasePreProcess(globParts);
+            globParts = this.secondPhasePreProcess(globParts);
+        }
+        else if (optimizationLevel >= 1) {
+            // just basic optimizations to remove some .. parts
+            globParts = this.levelOneOptimize(globParts);
+        }
+        else {
+            // just collapse multiple ** portions into one
+            globParts = this.adjascentGlobstarOptimize(globParts);
+        }
+        return globParts;
+    }
+    // just get rid of adjascent ** portions
+    adjascentGlobstarOptimize(globParts) {
+        return globParts.map(parts => {
+            let gs = -1;
+            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
+                let i = gs;
+                while (parts[i + 1] === '**') {
+                    i++;
+                }
+                if (i !== gs) {
+                    parts.splice(gs, i - gs);
+                }
+            }
+            return parts;
+        });
+    }
+    // get rid of adjascent ** and resolve .. portions
+    levelOneOptimize(globParts) {
+        return globParts.map(parts => {
+            parts = parts.reduce((set, part) => {
+                const prev = set[set.length - 1];
+                if (part === '**' && prev === '**') {
+                    return set;
+                }
+                if (part === '..') {
+                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
+                        set.pop();
+                        return set;
+                    }
+                }
+                set.push(part);
+                return set;
+            }, []);
+            return parts.length === 0 ? [''] : parts;
+        });
+    }
+    levelTwoFileOptimize(parts) {
+        if (!Array.isArray(parts)) {
+            parts = this.slashSplit(parts);
+        }
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p &&
+                    p !== '.' &&
+                    p !== '..' &&
+                    p !== '**' &&
+                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        let fileStartIndex = 0;
+        let patternStartIndex = 0;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3
+                : fileDrive ? 0
+                    : undefined;
+            const pdi = patternUNC ? 3
+                : patternDrive ? 0
+                    : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [
+                    file[fdi],
+                    pattern[pdi],
+                ];
+                // start matching at the drive letter index of each
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    patternStartIndex = pdi;
+                    fileStartIndex = fdi;
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // don't need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        if (pattern.includes(GLOBSTAR)) {
+            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
+        }
+        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
+    }
+    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
+        // split the pattern into head, tail, and middle of ** delimited parts
+        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
+        const lastgs = pattern.lastIndexOf(GLOBSTAR);
+        // split the pattern up into globstar-delimited sections
+        // the tail has to be at the end, and the others just have
+        // to be found in order from the head.
+        const [head, body, tail] = partial ?
+            [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1),
+                [],
+            ]
+            : [
+                pattern.slice(patternIndex, firstgs),
+                pattern.slice(firstgs + 1, lastgs),
+                pattern.slice(lastgs + 1),
+            ];
+        // check the head, from the current file/pattern index.
+        if (head.length) {
+            const fileHead = file.slice(fileIndex, fileIndex + head.length);
+            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
+                return false;
+            }
+            fileIndex += head.length;
+            patternIndex += head.length;
+        }
+        // now we know the head matches!
+        // if the last portion is not empty, it MUST match the end
+        // check the tail
+        let fileTailMatch = 0;
+        if (tail.length) {
+            // if head + tail > file, then we cannot possibly match
+            if (tail.length + fileIndex > file.length)
+                return false;
+            // try to match the tail
+            let tailStart = file.length - tail.length;
+            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
+                fileTailMatch = tail.length;
+            }
+            else {
+                // affordance for stuff like a/**/* matching a/b/
+                // if the last file portion is '', and there's more to the pattern
+                // then try without the '' bit.
+                if (file[file.length - 1] !== '' ||
+                    fileIndex + tail.length === file.length) {
+                    return false;
+                }
+                tailStart--;
+                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
+                    return false;
+                }
+                fileTailMatch = tail.length + 1;
+            }
+        }
+        // now we know the tail matches!
+        // the middle is zero or more portions wrapped in **, possibly
+        // containing more ** sections.
+        // so a/**/b/**/c/**/d has become **/b/**/c/**
+        // if it's empty, it means a/**/b, just verify we have no bad dots
+        // if there's no tail, so it ends on /**, then we must have *something*
+        // after the head, or it's not a matc
+        if (!body.length) {
+            let sawSome = !!fileTailMatch;
+            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
+                const f = String(file[i]);
+                sawSome = true;
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            // in partial mode, we just need to get past all file parts
+            return partial || sawSome;
+        }
+        // now we know that there's one or more body sections, which can
+        // be matched anywhere from the 0 index (because the head was pruned)
+        // through to the length-fileTailMatch index.
+        // split the body up into sections, and note the minimum index it can
+        // be found at (start with the length of all previous segments)
+        // [section, before, after]
+        const bodySegments = [[[], 0]];
+        let currentBody = bodySegments[0];
+        let nonGsParts = 0;
+        const nonGsPartsSums = [0];
+        for (const b of body) {
+            if (b === GLOBSTAR) {
+                nonGsPartsSums.push(nonGsParts);
+                currentBody = [[], 0];
+                bodySegments.push(currentBody);
+            }
+            else {
+                currentBody[0].push(b);
+                nonGsParts++;
+            }
+        }
+        let i = bodySegments.length - 1;
+        const fileLength = file.length - fileTailMatch;
+        for (const b of bodySegments) {
+            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
+        }
+        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
+    }
+    // return false for "nope, not matching"
+    // return null for "not matching, cannot keep trying"
+    #matchGlobStarBodySections(file, 
+    // pattern section, last possible position for it
+    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
+        // take the first body segment, and walk from fileIndex to its "after"
+        // value at the end
+        // If it doesn't match at that position, we increment, until we hit
+        // that final possible position, and give up.
+        // If it does match, then advance and try to rest.
+        // If any of them fail we keep walking forward.
+        // this is still a bit recursively painful, but it's more constrained
+        // than previous implementations, because we never test something that
+        // can't possibly be a valid matching condition.
+        const bs = bodySegments[bodyIndex];
+        if (!bs) {
+            // just make sure that there's no bad dots
+            for (let i = fileIndex; i < file.length; i++) {
+                sawTail = true;
+                const f = file[i];
+                if (f === '.' ||
+                    f === '..' ||
+                    (!this.options.dot && f.startsWith('.'))) {
+                    return false;
+                }
+            }
+            return sawTail;
+        }
+        // have a non-globstar body section to test
+        const [body, after] = bs;
+        while (fileIndex <= after) {
+            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
+            // if limit exceeded, no match. intentional false negative,
+            // acceptable break in correctness for security.
+            if (m && globStarDepth < this.maxGlobstarRecursion) {
+                // match! see if the rest match. if so, we're done!
+                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
+                if (sub !== false) {
+                    return sub;
+                }
+            }
+            const f = file[fileIndex];
+            if (f === '.' ||
+                f === '..' ||
+                (!this.options.dot && f.startsWith('.'))) {
+                return false;
+            }
+            fileIndex++;
+        }
+        // walked off. no point continuing
+        return partial || null;
+    }
+    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
+        let fi;
+        let pi;
+        let pl;
+        let fl;
+        for (fi = fileIndex,
+            pi = patternIndex,
+            fl = file.length,
+            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            let p = pattern[pi];
+            let f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false || p === GLOBSTAR) {
+                return false;
+            }
+            /* c8 ignore stop */
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return braceExpand(this.pattern, this.options);
+    }
+    parse(pattern) {
+        assertValidPattern(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase ?
+                options.dot ?
+                    qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar ? star
+            : options.dot ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return (typeof p === 'string' ? regExpEscape(p)
+                    : p === GLOBSTAR ? GLOBSTAR
+                        : p._src);
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== GLOBSTAR || prev === GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
+                }
+                else if (next !== GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = GLOBSTAR;
+                }
+            });
+            const filtered = pp.filter(p => p !== GLOBSTAR);
+            // For partial matches, we need to make the pattern match
+            // any prefix of the full path. We do this by generating
+            // alternative patterns that match progressively longer prefixes.
+            if (this.partial && filtered.length >= 1) {
+                const prefixes = [];
+                for (let i = 1; i <= filtered.length; i++) {
+                    prefixes.push(filtered.slice(0, i).join('/'));
+                }
+                return '(?:' + prefixes.join('|') + ')';
+            }
+            return filtered.join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // In partial mode, '/' should always match as it's a valid prefix for any pattern
+        if (this.partial) {
+            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
+        }
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (const pattern of set) {
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return minimatch.defaults(def).Minimatch;
+    }
+}
+/* c8 ignore start */
+export { AST } from './ast.js';
+export { escape } from './escape.js';
+export { unescape } from './unescape.js';
+/* c8 ignore stop */
+minimatch.AST = AST;
+minimatch.Minimatch = Minimatch;
+minimatch.escape = escape;
+minimatch.unescape = unescape;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..431b3a15a00c29459ae73326910924b895e61885
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names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aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,oBAAoB;AACpB,SAAS,CAAC,GAAG,GAAG,GAAG,CAAA;AACnB,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;AAC/B,SAAS,CAAC,MAAM,GAAG,MAAM,CAAA;AACzB,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAA","sourcesContent":["import { expand } from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport type { ExtglobType } from './ast.js'\nimport { AST } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\nexport type Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  /** do not expand `{x,y}` style braces */\n  nobrace?: boolean\n  /** do not treat patterns starting with `#` as a comment */\n  nocomment?: boolean\n  /** do not treat patterns starting with `!` as a negation */\n  nonegate?: boolean\n  /** print LOTS of debugging output */\n  debug?: boolean\n  /** treat `**` the same as `*` */\n  noglobstar?: boolean\n  /** do not expand extglobs like `+(a|b)` */\n  noext?: boolean\n  /** return the pattern if nothing matches */\n  nonull?: boolean\n  /** treat `\\\\` as a path separator, not an escape character */\n  windowsPathsNoEscape?: boolean\n  /**\n   * inverse of {@link MinimatchOptions.windowsPathsNoEscape}\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n  /**\n   * Compare a partial path to a pattern. As long as the parts\n   * of the path that are present are not contradicted by the\n   * pattern, it will be treated as a match. This is useful in\n   * applications where you're walking through a folder structure,\n   * and don't yet have the full path, but want to ensure that you\n   * do not walk down paths that can never be a match.\n   */\n  partial?: boolean\n  /** allow matches that start with `.` even if the pattern does not */\n  dot?: boolean\n  /** ignore case */\n  nocase?: boolean\n  /** ignore case only in wildcard patterns */\n  nocaseMagicOnly?: boolean\n  /** consider braces to be \"magic\" for the purpose of `hasMagic` */\n  magicalBraces?: boolean\n  /**\n   * If set, then patterns without slashes will be matched\n   * against the basename of the path if it contains slashes.\n   * For example, `a?b` would match the path `/xyz/123/acb`, but\n   * not `/xyz/acb/123`.\n   */\n  matchBase?: boolean\n  /** invert the results of negated matches */\n  flipNegate?: boolean\n  /** do not collapse multiple `/` into a single `/` */\n  preserveMultipleSlashes?: boolean\n  /**\n   * A number indicating the level of optimization that should be done\n   * to the pattern prior to parsing and using it for matches.\n   */\n  optimizationLevel?: number\n  /** operating system platform */\n  platform?: Platform\n  /**\n   * When a pattern starts with a UNC path or drive letter, and in\n   * `nocase:true` mode, do not convert the root portions of the\n   * pattern into a case-insensitive regular expression, and instead\n   * leave them as strings.\n   *\n   * This is the default when the platform is `win32` and\n   * `nocase:true` is set.\n   */\n  windowsNoMagicRoot?: boolean\n  /**\n   * max number of `{...}` patterns to expand. Default 100_000.\n   */\n  braceExpandMax?: number\n  /**\n   * Max number of non-adjacent `**` patterns to recursively walk down.\n   *\n   * The default of 200 is almost certainly high enough for most purposes,\n   * and can handle absurdly excessive patterns.\n   */\n  maxGlobstarRecursion?: number\n\n  /**\n   * Max depth to traverse for nested extglobs like `*(a|b|c)`\n   *\n   * Default is 2, which is quite low, but any higher value\n   * swiftly results in punishing performance impacts. Note\n   * that this is *not*  relevant when the globstar types can\n   * be safely coalesced into a single set.\n   *\n   * For example, `*(a|@(b|c)|d)` would be flattened into\n   * `*(a|b|c|d)`. Thus, many common extglobs will retain good\n   * performance and  never hit this limit, even if they are\n   * excessively deep and complicated.\n   *\n   * If the limit is hit, then the extglob characters are simply\n   * not parsed, and the pattern effectively switches into\n   * `noextglob: true` mode for the contents of that nested\n   * sub-pattern. This will typically _not_ result in a match,\n   * but is considered a valid trade-off for security and\n   * performance.\n   */\n  maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) =>\n  !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) =>\n  f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) =>\n  f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process ?\n    (typeof process.env === 'object' &&\n      process.env &&\n      process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n    process.platform\n  : 'posix') as Platform\n\nexport type Sep = '\\\\' | '/'\n\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep =\n  defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {},\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) =>\n      orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (\n      list: string[],\n      pattern: string,\n      options: MinimatchOptions = {},\n    ) => orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li  for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern, { max: options.braceExpandMax })\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n  maxGlobstarRecursion: number\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    // avoid the annoying deprecation flag lol\n    const awe = ('allowWindow' + 'sEscape') as keyof MinimatchOptions\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options[awe] === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined ?\n        options.windowsNoMagicRoot\n      : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: unknown[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      //oxlint-disable-next-line no-console\n      this.debug = (...args: unknown[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [\n            ...s.slice(0, 4),\n            ...s.slice(4).map(ss => this.parse(ss)),\n          ]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1,\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn ** into *\n    if (this.options.noglobstar) {\n      for (const partset of globParts) {\n        for (let j = 0; j < partset.length; j++) {\n          if (partset[j] === '**') {\n            partset[j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n\n    do {\n      didSomething = false\n      // 
// -> 
/\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // 
/

/../ ->

/\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (\n          p &&\n          p !== '.' &&\n          p !== '..' &&\n          p !== '**' &&\n          !(this.isWindows && /^[a-z]:$/i.test(p))\n        ) {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // 
 is 1 or more portions\n  //  is 1 or more portions\n  // 

is any portion other than ., .., '', or **\n // is . or ''\n //\n // **/.. is *brutal* for filesystem walking performance, because\n // it effectively resets the recursive walk each time it occurs,\n // and ** cannot be reduced out by a .. pattern part like a regexp\n // or most strings (other than .., ., and '') can be.\n //\n //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n //

// -> 
/\n  // 
/

/../ ->

/\n  // **/**/ -> **/\n  //\n  // **/*/ -> */**/ <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/}\n for (let parts of globParts) {\n let gs: number = -1\n while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n let gss: number = gs\n while (parts[gss + 1] === '**') {\n //

/**/**/ -> 
/**/\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // 
// -> 
/\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // 
/

/../ ->

/\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {
/*/,
/

/} ->

/*/\n  // {
/,
/} -> 
/\n  // {
/**/,
/} -> 
/**/\n  //\n  // {
/**/,
/**/

/} ->

/**/\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes,\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false,\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false,\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi =\n        fileUNC ? 3\n        : fileDrive ? 0\n        : undefined\n      const pdi =\n        patternUNC ? 3\n        : patternDrive ? 0\n        : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        // start matching at the drive letter index of each\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // don't need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file,\n        pattern,\n        partial,\n        fileStartIndex,\n        patternStartIndex,\n      )\n    }\n\n    return this.#matchOne(\n      file,\n      pattern,\n      partial,\n      fileStartIndex,\n      patternStartIndex,\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    // split the pattern into head, tail, and middle of ** delimited parts\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    // split the pattern up into globstar-delimited sections\n    // the tail has to be at the end, and the others just have\n    // to be found in order from the head.\n    const [head, body, tail] =\n      partial ?\n        [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1),\n          [],\n        ]\n      : [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1, lastgs),\n          pattern.slice(lastgs + 1),\n        ]\n\n    // check the head, from the current file/pattern index.\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n        return false\n      }\n      fileIndex += head.length\n      patternIndex += head.length\n    }\n    // now we know the head matches!\n\n    // if the last portion is not empty, it MUST match the end\n    // check the tail\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      // if head + tail > file, then we cannot possibly match\n      if (tail.length + fileIndex > file.length) return false\n\n      // try to match the tail\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        // affordance for stuff like a/**/* matching a/b/\n        // if the last file portion is '', and there's more to the pattern\n        // then try without the '' bit.\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n          return false\n        }\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    // now we know the tail matches!\n\n    // the middle is zero or more portions wrapped in **, possibly\n    // containing more ** sections.\n    // so a/**/b/**/c/**/d has become **/b/**/c/**\n    // if it's empty, it means a/**/b, just verify we have no bad dots\n    // if there's no tail, so it ends on /**, then we must have *something*\n    // after the head, or it's not a matc\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      // in partial mode, we just need to get past all file parts\n      return partial || sawSome\n    }\n\n    // now we know that there's one or more body sections, which can\n    // be matched anywhere from the 0 index (because the head was pruned)\n    // through to the length-fileTailMatch index.\n    // split the body up into sections, and note the minimum index it can\n    // be found at (start with the length of all previous segments)\n    // [section, before, after]\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file,\n      bodySegments,\n      fileIndex,\n      0,\n      partial,\n      0,\n      !!fileTailMatch,\n    )\n  }\n\n  // return false for \"nope, not matching\"\n  // return null for \"not matching, cannot keep trying\"\n  #matchGlobStarBodySections(\n    file: string[],\n    // pattern section, last possible position for it\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean,\n  ): boolean | null {\n    // take the first body segment, and walk from fileIndex to its \"after\"\n    // value at the end\n    // If it doesn't match at that position, we increment, until we hit\n    // that final possible position, and give up.\n    // If it does match, then advance and try to rest.\n    // If any of them fail we keep walking forward.\n    // this is still a bit recursively painful, but it's more constrained\n    // than previous implementations, because we never test something that\n    // can't possibly be a valid matching condition.\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      // just make sure that there's no bad dots\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    // have a non-globstar body section to test\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body,\n        partial,\n        fileIndex,\n        0,\n      )\n      // if limit exceeded, no match. intentional false negative,\n      // acceptable break in correctness for security.\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        // match! see if the rest match. if so, we're done!\n        const sub = this.#matchGlobStarBodySections(\n          file,\n          bodySegments,\n          fileIndex + body.length,\n          bodyIndex + 1,\n          partial,\n          globStarDepth + 1,\n          sawTail,\n        )\n        if (sub !== false) {\n          return sub\n        }\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' ||\n        f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n\n      fileIndex++\n    }\n    // walked off. no point continuing\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex,\n        pi = patternIndex,\n        fl = file.length,\n        pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            starDotExtTestNocaseDot\n          : starDotExtTestNocase\n        : options.dot ? starDotExtTestDot\n        : starDotExtTest)(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            qmarksTestNocaseDot\n          : qmarksTestNocase\n        : options.dot ? qmarksTestDot\n        : qmarksTest)(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar =\n      options.noglobstar ? star\n      : options.dot ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return (\n            typeof p === 'string' ? regExpEscape(p)\n            : p === GLOBSTAR ? GLOBSTAR\n            : p._src\n          )\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        const filtered = pp.filter(p => p !== GLOBSTAR)\n\n        // For partial matches, we need to make the pattern match\n        // any prefix of the full path. We do this by generating\n        // alternative patterns that match progressively longer prefixes.\n        if (this.partial && filtered.length >= 1) {\n          const prefixes: string[] = []\n          for (let i = 1; i <= filtered.length; i++) {\n            prefixes.push(filtered.slice(0, i).join('/'))\n          }\n          return '(?:' + prefixes.join('|') + ')'\n        }\n\n        return filtered.join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // In partial mode, '/' should always match as it's a valid prefix for any pattern\n    if (this.partial) {\n      re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$'\n    }\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (const pattern of set) {\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/package.json b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..3dbc1ca591c0557e35b6004aeba250e6a70b56e3
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+  "type": "module"
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.d.ts b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c4a14473afc706260b914e947fbb636680ddf43f
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.d.ts
@@ -0,0 +1,22 @@
+import type { MinimatchOptions } from './index.js';
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick) => string;
+//# sourceMappingURL=unescape.d.ts.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.d.ts.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.d.ts.map
new file mode 100644
index 0000000000000000000000000000000000000000..09d6eab4e6502cde5495bf5ea51637d6db86999c
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
new file mode 100644
index 0000000000000000000000000000000000000000..19ce86e7c86052265346584cd65e620cf2fcb377
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js
@@ -0,0 +1,34 @@
+/**
+ * Un-escape a string that has been escaped with {@link escape}.
+ *
+ * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
+ * square-bracket escapes are removed, but not backslash escapes.
+ *
+ * For example, it will turn the string `'[*]'` into `*`, but it will not
+ * turn `'\\*'` into `'*'`, because `\` is a path separator in
+ * `windowsPathsNoEscape` mode.
+ *
+ * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
+ * backslash escapes are removed.
+ *
+ * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
+ * or unescaped.
+ *
+ * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
+ * unescaped.
+ */
+export const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
+    if (magicalBraces) {
+        return windowsPathsNoEscape ?
+            s.replace(/\[([^/\\])\]/g, '$1')
+            : s
+                .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
+                .replace(/\\([^/])/g, '$1');
+    }
+    return windowsPathsNoEscape ?
+        s.replace(/\[([^/\\{}])\]/g, '$1')
+        : s
+            .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
+            .replace(/\\([^/{}])/g, '$1');
+};
+//# sourceMappingURL=unescape.js.map
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js.map b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js.map
new file mode 100644
index 0000000000000000000000000000000000000000..6d507391171b5f7ccb04fd8da59e829d2715c260
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/dist/esm/unescape.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = true,\n  }: Pick = {},\n) => {\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/\\[([^/\\\\])\\]/g, '$1')\n      : s\n          .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n          .replace(/\\\\([^/])/g, '$1')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n    : s\n        .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n        .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/package.json b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..211875c62b724978194945224d6d845c48d44955
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch/package.json
@@ -0,0 +1,73 @@
+{
+  "author": "Isaac Z. Schlueter  (http://blog.izs.me)",
+  "name": "minimatch",
+  "description": "a glob matcher in javascript",
+  "version": "10.2.5",
+  "repository": {
+    "type": "git",
+    "url": "git@github.com:isaacs/minimatch"
+  },
+  "main": "./dist/commonjs/index.js",
+  "types": "./dist/commonjs/index.d.ts",
+  "exports": {
+    "./package.json": "./package.json",
+    ".": {
+      "import": {
+        "types": "./dist/esm/index.d.ts",
+        "default": "./dist/esm/index.js"
+      },
+      "require": {
+        "types": "./dist/commonjs/index.d.ts",
+        "default": "./dist/commonjs/index.js"
+      }
+    }
+  },
+  "files": [
+    "dist"
+  ],
+  "scripts": {
+    "preversion": "npm test",
+    "postversion": "npm publish",
+    "prepublishOnly": "git push origin --follow-tags",
+    "prepare": "tshy",
+    "pretest": "npm run prepare",
+    "presnap": "npm run prepare",
+    "test": "tap",
+    "snap": "tap",
+    "format": "prettier --write .",
+    "benchmark": "node benchmark/index.js",
+    "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
+    "lint": "oxlint --fix src test",
+    "postsnap": "npm run lint",
+    "postlint": "npm run format"
+  },
+  "engines": {
+    "node": "18 || 20 || >=22"
+  },
+  "devDependencies": {
+    "@types/node": "^25.5.0",
+    "mkdirp": "^3.0.1",
+    "oxlint": "^1.57.0",
+    "oxlint-tsgolint": "^0.18.1",
+    "prettier": "^3.8.1",
+    "tap": "^21.6.2",
+    "tshy": "^4.0.0",
+    "typedoc": "^0.28.18"
+  },
+  "funding": {
+    "url": "https://github.com/sponsors/isaacs"
+  },
+  "license": "BlueOak-1.0.0",
+  "tshy": {
+    "exports": {
+      "./package.json": "./package.json",
+      ".": "./src/index.ts"
+    },
+    "selfLink": false
+  },
+  "type": "module",
+  "module": "./dist/esm/index.js",
+  "dependencies": {
+    "brace-expansion": "^5.0.5"
+  }
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/typescript-estree/package.json b/tools/ui/node_modules/@typescript-eslint/typescript-estree/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..bea6c320ce7e39b7cdb300ced1b46dae5bb89195
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/typescript-estree/package.json
@@ -0,0 +1,95 @@
+{
+  "name": "@typescript-eslint/typescript-estree",
+  "version": "8.60.1",
+  "description": "A parser that converts TypeScript source code into an ESTree compatible form",
+  "files": [
+    "dist",
+    "!**/*.tsbuildinfo",
+    "README.md",
+    "LICENSE"
+  ],
+  "type": "commonjs",
+  "exports": {
+    ".": {
+      "types": "./dist/index.d.ts",
+      "default": "./dist/index.js"
+    },
+    "./package.json": "./package.json",
+    "./use-at-your-own-risk": {
+      "types": "./dist/use-at-your-own-risk.d.ts",
+      "default": "./dist/use-at-your-own-risk.js"
+    }
+  },
+  "types": "./dist/index.d.ts",
+  "engines": {
+    "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/typescript-eslint/typescript-eslint.git",
+    "directory": "packages/typescript-estree"
+  },
+  "bugs": {
+    "url": "https://github.com/typescript-eslint/typescript-eslint/issues"
+  },
+  "homepage": "https://typescript-eslint.io/packages/typescript-estree",
+  "license": "MIT",
+  "keywords": [
+    "ast",
+    "estree",
+    "ecmascript",
+    "javascript",
+    "typescript",
+    "parser",
+    "syntax"
+  ],
+  "dependencies": {
+    "debug": "^4.4.3",
+    "minimatch": "^10.2.2",
+    "semver": "^7.7.3",
+    "tinyglobby": "^0.2.15",
+    "ts-api-utils": "^2.5.0",
+    "@typescript-eslint/project-service": "8.60.1",
+    "@typescript-eslint/tsconfig-utils": "8.60.1",
+    "@typescript-eslint/types": "8.60.1",
+    "@typescript-eslint/visitor-keys": "8.60.1"
+  },
+  "devDependencies": {
+    "@typescript/native-preview": "7.0.0-dev.20260518.1",
+    "@vitest/coverage-v8": "^4.0.18",
+    "eslint": "^10.0.0",
+    "glob": "^11.1.0",
+    "rimraf": "^5.0.10",
+    "typescript": ">=4.8.4 <6.1.0",
+    "vitest": "^4.0.18",
+    "yaml": "^2.8.2"
+  },
+  "peerDependencies": {
+    "typescript": ">=4.8.4 <6.1.0"
+  },
+  "funding": {
+    "type": "opencollective",
+    "url": "https://opencollective.com/typescript-eslint"
+  },
+  "nx": {
+    "name": "typescript-estree",
+    "includedScripts": [
+      "clean"
+    ],
+    "targets": {
+      "lint": {
+        "command": "eslint"
+      },
+      "typecheck:tsgo": {}
+    }
+  },
+  "scripts": {
+    "build": "pnpm exec nx build",
+    "clean": "rimraf dist/ coverage/",
+    "format": "pnpm -w run format",
+    "lint": "pnpm -w exec nx lint",
+    "test": "pnpm -w exec nx test",
+    "typecheck": "pnpm -w exec nx typecheck",
+    "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo"
+  }
+}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/LICENSE b/tools/ui/node_modules/@typescript-eslint/utils/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..a1164108d4d6037cb976384c16e5493917d87157
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 typescript-eslint and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/README.md b/tools/ui/node_modules/@typescript-eslint/utils/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..7ba750090e9bce0db5eac316be4808f087b09582
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/README.md
@@ -0,0 +1,12 @@
+# `@typescript-eslint/utils`
+
+> Utilities for working with TypeScript + ESLint together.
+
+[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils)
+[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils)
+
+👉 See **https://typescript-eslint.io/packages/utils** for documentation on this package.
+
+> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code.
+
+
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..504d01959c5de0fd3dad058d3d60c3ecc283f984
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.d.ts
@@ -0,0 +1,47 @@
+interface PatternMatcher {
+    /**
+     * Replace all matched parts by a given replacer.
+     *
+     * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-symbol-replace}
+     * @example
+     * const { PatternMatcher } = require("eslint-utils")
+     * const matcher = new PatternMatcher(/\\p{Script=Greek}/g)
+     *
+     * module.exports = {
+     *     meta: {},
+     *     create(context) {
+     *         return {
+     *             "Literal[regex]"(node) {
+     *                 const replacedPattern = node.regex.pattern.replace(
+     *                     matcher,
+     *                     "[\\u0370-\\u0373\\u0375-\\u0377\\u037A-\\u037D\\u037F\\u0384\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03E1\\u03F0-\\u03FF\\u1D26-\\u1D2A\\u1D5D-\\u1D61\\u1D66-\\u1D6A\\u1DBF\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FC4\\u1FC6-\\u1FD3\\u1FD6-\\u1FDB\\u1FDD-\\u1FEF\\u1FF2-\\u1FF4\\u1FF6-\\u1FFE\\u2126\\uAB65]|\\uD800[\\uDD40-\\uDD8E\\uDDA0]|\\uD834[\\uDE00-\\uDE45]"
+     *                 )
+     *             },
+     *         }
+     *     },
+     * }
+     */
+    [Symbol.replace](str: string, replacer: string | ((...strs: string[]) => string)): string;
+    /**
+     * Iterate all matched parts in a given string.
+     *
+     * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-execall}
+     */
+    execAll(str: string): IterableIterator;
+    /**
+     * Check whether this pattern matches a given string or not.
+     *
+     * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#matcher-test}
+     */
+    test(str: string): boolean;
+}
+/**
+ * The class to find a pattern in strings as handling escape sequences.
+ * It ignores the found pattern if it's escaped with `\`.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#patternmatcher-class}
+ */
+export declare const PatternMatcher: new (pattern: RegExp, options?: {
+    escaped?: boolean;
+}) => PatternMatcher;
+export {};
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.js
new file mode 100644
index 0000000000000000000000000000000000000000..a31b5f5a131e2840789f40a93bb3e9431e5435c8
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/PatternMatcher.js
@@ -0,0 +1,44 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.PatternMatcher = void 0;
+const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
+/**
+ * The class to find a pattern in strings as handling escape sequences.
+ * It ignores the found pattern if it's escaped with `\`.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#patternmatcher-class}
+ */
+exports.PatternMatcher = eslintUtils.PatternMatcher;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a0a5dd47e095e20475adea9908e9f423cd11ee18
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts
@@ -0,0 +1,71 @@
+import type * as TSESLint from '../../ts-eslint';
+import type { TSESTree } from '../../ts-estree';
+declare const ReferenceTrackerREAD: symbol;
+declare const ReferenceTrackerCALL: symbol;
+declare const ReferenceTrackerCONSTRUCT: symbol;
+declare const ReferenceTrackerESM: symbol;
+interface ReferenceTracker {
+    /**
+     * Iterate the references that the given `traceMap` determined.
+     * This method starts to search from `require()` expression.
+     *
+     * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#tracker-iteratecjsreferences}
+     */
+    iterateCjsReferences(traceMap: ReferenceTracker.TraceMap): IterableIterator>;
+    /**
+     * Iterate the references that the given `traceMap` determined.
+     * This method starts to search from `import`/`export` declarations.
+     *
+     * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#tracker-iterateesmreferences}
+     */
+    iterateEsmReferences(traceMap: ReferenceTracker.TraceMap): IterableIterator>;
+    /**
+     * Iterate the references that the given `traceMap` determined.
+     * This method starts to search from global variables.
+     *
+     * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#tracker-iterateglobalreferences}
+     */
+    iterateGlobalReferences(traceMap: ReferenceTracker.TraceMap): IterableIterator>;
+}
+interface ReferenceTrackerStatic {
+    readonly CALL: typeof ReferenceTrackerCALL;
+    readonly CONSTRUCT: typeof ReferenceTrackerCONSTRUCT;
+    readonly ESM: typeof ReferenceTrackerESM;
+    new (globalScope: TSESLint.Scope.Scope, options?: {
+        /**
+         * The name list of Global Object. Optional. Default is `["global", "globalThis", "self", "window"]`.
+         */
+        globalObjectNames?: readonly string[];
+        /**
+         * The mode which determines how the `tracker.iterateEsmReferences()` method scans CommonJS modules.
+         * If this is `"strict"`, the method binds CommonJS modules to the default export. Otherwise, the method binds
+         * CommonJS modules to both the default export and named exports. Optional. Default is `"strict"`.
+         */
+        mode?: 'legacy' | 'strict';
+    }): ReferenceTracker;
+    readonly READ: typeof ReferenceTrackerREAD;
+}
+declare namespace ReferenceTracker {
+    type READ = ReferenceTrackerStatic['READ'];
+    type CALL = ReferenceTrackerStatic['CALL'];
+    type CONSTRUCT = ReferenceTrackerStatic['CONSTRUCT'];
+    type ESM = ReferenceTrackerStatic['ESM'];
+    type ReferenceType = symbol;
+    type TraceMap = Record>;
+    interface TraceMapElement {
+        [key: string]: TraceMapElement;
+    }
+    interface FoundReference {
+        info: T;
+        node: TSESTree.Node;
+        path: readonly string[];
+        type: ReferenceType;
+    }
+}
+/**
+ * The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class}
+ */
+export declare const ReferenceTracker: ReferenceTrackerStatic;
+export {};
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.js
new file mode 100644
index 0000000000000000000000000000000000000000..43c127dff5b271c2dc42dc5b61143f7d70b59f22
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/ReferenceTracker.js
@@ -0,0 +1,48 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ReferenceTracker = void 0;
+/* eslint-disable @typescript-eslint/no-namespace */
+const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
+const ReferenceTrackerREAD = eslintUtils.ReferenceTracker.READ;
+const ReferenceTrackerCALL = eslintUtils.ReferenceTracker.CALL;
+const ReferenceTrackerCONSTRUCT = eslintUtils.ReferenceTracker.CONSTRUCT;
+const ReferenceTrackerESM = eslintUtils.ReferenceTracker.ESM;
+/**
+ * The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class}
+ */
+exports.ReferenceTracker = eslintUtils.ReferenceTracker;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..67f879248f4fe892bc21f2b508ff11f2240556f6
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.d.ts
@@ -0,0 +1,83 @@
+import type * as TSESLint from '../../ts-eslint';
+import type { TSESTree } from '../../ts-estree';
+/**
+ * Get the proper location of a given function node to report.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation}
+ */
+export declare const getFunctionHeadLocation: (node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation;
+/**
+ * Get the name and kind of a given function node.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind}
+ */
+export declare const getFunctionNameWithKind: (node: TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, sourceCode?: TSESLint.SourceCode) => string;
+/**
+ * Get the property name of a given property node.
+ * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname}
+ * @returns The property name of the node. If the property name is not constant then it returns `null`.
+ */
+export declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.MethodDefinition | TSESTree.Property | TSESTree.PropertyDefinition, initialScope?: TSESLint.Scope.Scope) => string | null;
+/**
+ * Get the value of a given node if it can decide the value statically.
+ * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
+ * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
+ * not been modified.
+ * For example, it considers `Symbol.iterator`, `Symbol.for('k')`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static, but `Symbol('k')` is not static.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue}
+ * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
+ * static value of the node, it returns `null`.
+ */
+export declare const getStaticValue: (node: TSESTree.Node, initialScope?: TSESLint.Scope.Scope) => {
+    value: unknown;
+} | null;
+/**
+ * Get the string value of a given node.
+ * This function is a tiny wrapper of the getStaticValue function.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant}
+ */
+export declare const getStringIfConstant: (node: TSESTree.Node, initialScope?: TSESLint.Scope.Scope) => string | null;
+/**
+ * Check whether a given node has any side effect or not.
+ * The side effect means that it may modify a certain variable or object member. This function considers the node which
+ * contains the following types as the node which has side effects:
+ * - `AssignmentExpression`
+ * - `AwaitExpression`
+ * - `CallExpression`
+ * - `ImportExpression`
+ * - `NewExpression`
+ * - `UnaryExpression([operator = "delete"])`
+ * - `UpdateExpression`
+ * - `YieldExpression`
+ * - When `options.considerGetters` is `true`:
+ *   - `MemberExpression`
+ * - When `options.considerImplicitTypeConversion` is `true`:
+ *   - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
+ *   - `MemberExpression([computed = true])`
+ *   - `MethodDefinition([computed = true])`
+ *   - `Property([computed = true])`
+ *   - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect}
+ */
+export declare const hasSideEffect: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode, options?: {
+    considerGetters?: boolean;
+    considerImplicitTypeConversion?: boolean;
+}) => boolean;
+export declare const isParenthesized: {
+    (times: number, node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
+    /**
+     * Check whether a given node is parenthesized or not.
+     * This function detects it correctly even if it's parenthesized by specific syntax.
+     *
+     * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#isparenthesized}
+     * @returns `true` if the node is parenthesized.
+     * If `times` was given, it returns `true` only if the node is parenthesized the `times` times.
+     * For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`.
+     */
+    (node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
+};
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.js
new file mode 100644
index 0000000000000000000000000000000000000000..29a0369755ad0b38d2c0d75a110344e03b5edc1e
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/astUtilities.js
@@ -0,0 +1,101 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isParenthesized = exports.hasSideEffect = exports.getStringIfConstant = exports.getStaticValue = exports.getPropertyName = exports.getFunctionNameWithKind = exports.getFunctionHeadLocation = void 0;
+const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
+/**
+ * Get the proper location of a given function node to report.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionheadlocation}
+ */
+exports.getFunctionHeadLocation = eslintUtils.getFunctionHeadLocation;
+/**
+ * Get the name and kind of a given function node.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getfunctionnamewithkind}
+ */
+exports.getFunctionNameWithKind = eslintUtils.getFunctionNameWithKind;
+/**
+ * Get the property name of a given property node.
+ * If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getpropertyname}
+ * @returns The property name of the node. If the property name is not constant then it returns `null`.
+ */
+exports.getPropertyName = eslintUtils.getPropertyName;
+/**
+ * Get the value of a given node if it can decide the value statically.
+ * If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
+ * given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
+ * not been modified.
+ * For example, it considers `Symbol.iterator`, `Symbol.for('k')`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static, but `Symbol('k')` is not static.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue}
+ * @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
+ * static value of the node, it returns `null`.
+ */
+exports.getStaticValue = eslintUtils.getStaticValue;
+/**
+ * Get the string value of a given node.
+ * This function is a tiny wrapper of the getStaticValue function.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstringifconstant}
+ */
+exports.getStringIfConstant = eslintUtils.getStringIfConstant;
+/**
+ * Check whether a given node has any side effect or not.
+ * The side effect means that it may modify a certain variable or object member. This function considers the node which
+ * contains the following types as the node which has side effects:
+ * - `AssignmentExpression`
+ * - `AwaitExpression`
+ * - `CallExpression`
+ * - `ImportExpression`
+ * - `NewExpression`
+ * - `UnaryExpression([operator = "delete"])`
+ * - `UpdateExpression`
+ * - `YieldExpression`
+ * - When `options.considerGetters` is `true`:
+ *   - `MemberExpression`
+ * - When `options.considerImplicitTypeConversion` is `true`:
+ *   - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
+ *   - `MemberExpression([computed = true])`
+ *   - `MethodDefinition([computed = true])`
+ *   - `Property([computed = true])`
+ *   - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/ast-utils.html#hassideeffect}
+ */
+exports.hasSideEffect = eslintUtils.hasSideEffect;
+exports.isParenthesized = eslintUtils.isParenthesized;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4a41363d1a34147fd4f93a9662316857ba2c45ca
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.d.ts
@@ -0,0 +1,5 @@
+export * from './astUtilities';
+export * from './PatternMatcher';
+export * from './predicates';
+export * from './ReferenceTracker';
+export * from './scopeAnalysis';
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..d2e9a645e7db5ddf3eb1bc3603581be5dc3927c4
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/index.js
@@ -0,0 +1,21 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (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 });
+__exportStar(require("./astUtilities"), exports);
+__exportStar(require("./PatternMatcher"), exports);
+__exportStar(require("./predicates"), exports);
+__exportStar(require("./ReferenceTracker"), exports);
+__exportStar(require("./scopeAnalysis"), exports);
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..64b662eabc75b67ede43e07b120c8f388f00f8ea
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.d.ts
@@ -0,0 +1,31 @@
+import type { TSESTree } from '../../ts-estree';
+type IsSpecificTokenFunction = (token: TSESTree.Token) => token is SpecificToken;
+type IsNotSpecificTokenFunction = (token: TSESTree.Token) => token is Exclude;
+type PunctuatorTokenWithValue = {
+    value: Value;
+} & TSESTree.PunctuatorToken;
+type IsPunctuatorTokenWithValueFunction = IsSpecificTokenFunction>;
+type IsNotPunctuatorTokenWithValueFunction = IsNotSpecificTokenFunction>;
+export declare const isArrowToken: IsPunctuatorTokenWithValueFunction<"=>">;
+export declare const isNotArrowToken: IsNotPunctuatorTokenWithValueFunction<"=>">;
+export declare const isClosingBraceToken: IsPunctuatorTokenWithValueFunction<"}">;
+export declare const isNotClosingBraceToken: IsNotPunctuatorTokenWithValueFunction<"}">;
+export declare const isClosingBracketToken: IsPunctuatorTokenWithValueFunction<"]">;
+export declare const isNotClosingBracketToken: IsNotPunctuatorTokenWithValueFunction<"]">;
+export declare const isClosingParenToken: IsPunctuatorTokenWithValueFunction<")">;
+export declare const isNotClosingParenToken: IsNotPunctuatorTokenWithValueFunction<")">;
+export declare const isColonToken: IsPunctuatorTokenWithValueFunction<":">;
+export declare const isNotColonToken: IsNotPunctuatorTokenWithValueFunction<":">;
+export declare const isCommaToken: IsPunctuatorTokenWithValueFunction<",">;
+export declare const isNotCommaToken: IsNotPunctuatorTokenWithValueFunction<",">;
+export declare const isCommentToken: IsSpecificTokenFunction;
+export declare const isNotCommentToken: IsNotSpecificTokenFunction;
+export declare const isOpeningBraceToken: IsPunctuatorTokenWithValueFunction<"{">;
+export declare const isNotOpeningBraceToken: IsNotPunctuatorTokenWithValueFunction<"{">;
+export declare const isOpeningBracketToken: IsPunctuatorTokenWithValueFunction<"[">;
+export declare const isNotOpeningBracketToken: IsNotPunctuatorTokenWithValueFunction<"[">;
+export declare const isOpeningParenToken: IsPunctuatorTokenWithValueFunction<"(">;
+export declare const isNotOpeningParenToken: IsNotPunctuatorTokenWithValueFunction<"(">;
+export declare const isSemicolonToken: IsPunctuatorTokenWithValueFunction<";">;
+export declare const isNotSemicolonToken: IsNotPunctuatorTokenWithValueFunction<";">;
+export {};
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.js
new file mode 100644
index 0000000000000000000000000000000000000000..6ca12796f9858fcbb89561439124ab7928f0d3e7
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/predicates.js
@@ -0,0 +1,59 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isNotSemicolonToken = exports.isSemicolonToken = exports.isNotOpeningParenToken = exports.isOpeningParenToken = exports.isNotOpeningBracketToken = exports.isOpeningBracketToken = exports.isNotOpeningBraceToken = exports.isOpeningBraceToken = exports.isNotCommentToken = exports.isCommentToken = exports.isNotCommaToken = exports.isCommaToken = exports.isNotColonToken = exports.isColonToken = exports.isNotClosingParenToken = exports.isClosingParenToken = exports.isNotClosingBracketToken = exports.isClosingBracketToken = exports.isNotClosingBraceToken = exports.isClosingBraceToken = exports.isNotArrowToken = exports.isArrowToken = void 0;
+const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
+exports.isArrowToken = eslintUtils.isArrowToken;
+exports.isNotArrowToken = eslintUtils.isNotArrowToken;
+exports.isClosingBraceToken = eslintUtils.isClosingBraceToken;
+exports.isNotClosingBraceToken = eslintUtils.isNotClosingBraceToken;
+exports.isClosingBracketToken = eslintUtils.isClosingBracketToken;
+exports.isNotClosingBracketToken = eslintUtils.isNotClosingBracketToken;
+exports.isClosingParenToken = eslintUtils.isClosingParenToken;
+exports.isNotClosingParenToken = eslintUtils.isNotClosingParenToken;
+exports.isColonToken = eslintUtils.isColonToken;
+exports.isNotColonToken = eslintUtils.isNotColonToken;
+exports.isCommaToken = eslintUtils.isCommaToken;
+exports.isNotCommaToken = eslintUtils.isNotCommaToken;
+exports.isCommentToken = eslintUtils.isCommentToken;
+exports.isNotCommentToken = eslintUtils.isNotCommentToken;
+exports.isOpeningBraceToken = eslintUtils.isOpeningBraceToken;
+exports.isNotOpeningBraceToken = eslintUtils.isNotOpeningBraceToken;
+exports.isOpeningBracketToken = eslintUtils.isOpeningBracketToken;
+exports.isNotOpeningBracketToken = eslintUtils.isNotOpeningBracketToken;
+exports.isOpeningParenToken = eslintUtils.isOpeningParenToken;
+exports.isNotOpeningParenToken = eslintUtils.isNotOpeningParenToken;
+exports.isSemicolonToken = eslintUtils.isSemicolonToken;
+exports.isNotSemicolonToken = eslintUtils.isNotSemicolonToken;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8d6348e04a566079cee4bcc8000c5ffce8c61840
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts
@@ -0,0 +1,16 @@
+import type * as TSESLint from '../../ts-eslint';
+import type { TSESTree } from '../../ts-estree';
+/**
+ * Get the variable of a given name.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#findvariable}
+ */
+export declare const findVariable: (initialScope: TSESLint.Scope.Scope, nameOrNode: string | TSESTree.Identifier) => TSESLint.Scope.Variable | null;
+/**
+ * Get the innermost scope which contains a given node.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#getinnermostscope}
+ * @returns The innermost scope which contains the given node.
+ * If such scope doesn't exist then it returns the 1st argument `initialScope`.
+ */
+export declare const getInnermostScope: (initialScope: TSESLint.Scope.Scope, node: TSESTree.Node) => TSESLint.Scope.Scope;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.js
new file mode 100644
index 0000000000000000000000000000000000000000..5bc874e5a093ff6dfd8e8935c6895f1fc8a48113
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/eslint-utils/scopeAnalysis.js
@@ -0,0 +1,51 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getInnermostScope = exports.findVariable = void 0;
+const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));
+/**
+ * Get the variable of a given name.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#findvariable}
+ */
+exports.findVariable = eslintUtils.findVariable;
+/**
+ * Get the innermost scope which contains a given node.
+ *
+ * @see {@link https://eslint-community.github.io/eslint-utils/api/scope-utils.html#getinnermostscope}
+ * @returns The innermost scope which contains the given node.
+ * If such scope doesn't exist then it returns the 1st argument `initialScope`.
+ */
+exports.getInnermostScope = eslintUtils.getInnermostScope;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9df9cdd86641e4a2c12d07fb2fe2f70416c57337
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.d.ts
@@ -0,0 +1,18 @@
+import type { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from '../ts-estree';
+export declare const isNodeOfType: (nodeType: NodeType) => (node: TSESTree.Node | null | undefined) => node is Extract;
+export declare const isNodeOfTypes: (nodeTypes: NodeTypes) => (node: TSESTree.Node | null | undefined) => node is Extract;
+export declare const isNodeOfTypeWithConditions: , Conditions extends Partial>(nodeType: NodeType, conditions: Conditions) => ((node: TSESTree.Node | null | undefined) => node is Conditions & ExtractedNode);
+export declare const isTokenOfTypeWithConditions: , Conditions extends Partial<{
+    type: TokenType;
+} & TSESTree.Token>>(tokenType: TokenType, conditions: Conditions) => ((token: TSESTree.Token | null | undefined) => token is Conditions & ExtractedToken);
+export declare const isNotTokenOfTypeWithConditions: , Conditions extends Partial>(tokenType: TokenType, conditions: Conditions) => ((token: TSESTree.Token | null | undefined) => token is Exclude);
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.js
new file mode 100644
index 0000000000000000000000000000000000000000..d1d7a8c8c2da4d37dac91e8ecbacf20308f3141a
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/helpers.js
@@ -0,0 +1,21 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isNotTokenOfTypeWithConditions = exports.isTokenOfTypeWithConditions = exports.isNodeOfTypeWithConditions = exports.isNodeOfTypes = exports.isNodeOfType = void 0;
+const isNodeOfType = (nodeType) => (node) => node?.type === nodeType;
+exports.isNodeOfType = isNodeOfType;
+const isNodeOfTypes = (nodeTypes) => (node) => !!node && nodeTypes.includes(node.type);
+exports.isNodeOfTypes = isNodeOfTypes;
+const isNodeOfTypeWithConditions = (nodeType, conditions) => {
+    const entries = Object.entries(conditions);
+    return (node) => node?.type === nodeType &&
+        entries.every(([key, value]) => node[key] === value);
+};
+exports.isNodeOfTypeWithConditions = isNodeOfTypeWithConditions;
+const isTokenOfTypeWithConditions = (tokenType, conditions) => {
+    const entries = Object.entries(conditions);
+    return (token) => token?.type === tokenType &&
+        entries.every(([key, value]) => token[key] === value);
+};
+exports.isTokenOfTypeWithConditions = isTokenOfTypeWithConditions;
+const isNotTokenOfTypeWithConditions = (tokenType, conditions) => (token) => !(0, exports.isTokenOfTypeWithConditions)(tokenType, conditions)(token);
+exports.isNotTokenOfTypeWithConditions = isNotTokenOfTypeWithConditions;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/index.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..66e528aa3e34b2199d9f4c1e4e5d8cb7828cfcbe
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/index.d.ts
@@ -0,0 +1,4 @@
+export * from './eslint-utils';
+export * from './helpers';
+export * from './misc';
+export * from './predicates';
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/index.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..5442939bc33f9c2dcb1cbccb317e0e73b5f89a1a
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/index.js
@@ -0,0 +1,20 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (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 });
+__exportStar(require("./eslint-utils"), exports);
+__exportStar(require("./helpers"), exports);
+__exportStar(require("./misc"), exports);
+__exportStar(require("./predicates"), exports);
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..48a6a56d9e18ddf4b9652a12b68202ded94d6ecd
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.d.ts
@@ -0,0 +1,10 @@
+import type { TSESTree } from '../ts-estree';
+/**
+ * A regular expression to match line terminators.
+ * @see https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html#prod-LineTerminator
+ */
+export declare const LINEBREAK_MATCHER: RegExp;
+/**
+ * Determines whether two adjacent tokens are on the same line
+ */
+export declare function isTokenOnSameLine(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token): boolean;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.js
new file mode 100644
index 0000000000000000000000000000000000000000..5842a2bf333bcfaa304bee83d8cbd528db6454e6
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/misc.js
@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.LINEBREAK_MATCHER = void 0;
+exports.isTokenOnSameLine = isTokenOnSameLine;
+/**
+ * A regular expression to match line terminators.
+ * @see https://tc39.es/ecma262/multipage/ecmascript-language-lexical-grammar.html#prod-LineTerminator
+ */
+exports.LINEBREAK_MATCHER = /\r\n|[\r\n\u2028\u2029]/;
+/**
+ * Determines whether two adjacent tokens are on the same line
+ */
+function isTokenOnSameLine(left, right) {
+    return left.loc.end.line === right.loc.start.line;
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..71fc9b2d00e730dbc29dc4adb3b7c83ce35f1705
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.d.ts
@@ -0,0 +1,68 @@
+import type { TSESTree } from '../ts-estree';
+export declare const isOptionalChainPunctuator: (token: TSESTree.Token | null | undefined) => token is {
+    value: "?.";
+} & TSESTree.PunctuatorToken;
+export declare const isNotOptionalChainPunctuator: (token: TSESTree.Token | null | undefined) => token is TSESTree.BooleanToken | TSESTree.BlockComment | TSESTree.LineComment | TSESTree.IdentifierToken | TSESTree.JSXIdentifierToken | TSESTree.JSXTextToken | TSESTree.KeywordToken | TSESTree.NullToken | TSESTree.NumericToken | TSESTree.PrivateIdentifierToken | TSESTree.PunctuatorToken | TSESTree.RegularExpressionToken | TSESTree.StringToken | TSESTree.TemplateToken;
+export declare const isNonNullAssertionPunctuator: (token: TSESTree.Token | null | undefined) => token is {
+    value: "!";
+} & TSESTree.PunctuatorToken;
+export declare const isNotNonNullAssertionPunctuator: (token: TSESTree.Token | null | undefined) => token is TSESTree.BooleanToken | TSESTree.BlockComment | TSESTree.LineComment | TSESTree.IdentifierToken | TSESTree.JSXIdentifierToken | TSESTree.JSXTextToken | TSESTree.KeywordToken | TSESTree.NullToken | TSESTree.NumericToken | TSESTree.PrivateIdentifierToken | TSESTree.PunctuatorToken | TSESTree.RegularExpressionToken | TSESTree.StringToken | TSESTree.TemplateToken;
+/**
+ * Returns true if and only if the node represents: foo?.() or foo.bar?.()
+ */
+export declare const isOptionalCallExpression: (node: TSESTree.Node | null | undefined) => node is {
+    optional: boolean;
+} & TSESTree.CallExpression;
+/**
+ * Returns true if and only if the node represents logical OR
+ */
+export declare const isLogicalOrOperator: (node: TSESTree.Node | null | undefined) => node is Partial & TSESTree.LogicalExpression;
+/**
+ * Checks if a node is a type assertion:
+ * ```
+ * x as foo
+ * x
+ * ```
+ */
+export declare const isTypeAssertion: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSAsExpression | TSESTree.TSTypeAssertion;
+export declare const isVariableDeclarator: (node: TSESTree.Node | null | undefined) => node is TSESTree.VariableDeclaratorDefiniteAssignment | TSESTree.VariableDeclaratorMaybeInit | TSESTree.VariableDeclaratorNoInit | TSESTree.UsingInForOfDeclarator | TSESTree.UsingInNormalContextDeclarator;
+export declare const isFunction: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression;
+export declare const isFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSDeclareFunctionNoDeclare | TSESTree.TSDeclareFunctionWithDeclare | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName;
+export declare const isFunctionOrFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclarationWithName | TSESTree.FunctionDeclarationWithOptionalName | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSDeclareFunctionNoDeclare | TSESTree.TSDeclareFunctionWithDeclare | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName;
+export declare const isTSFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSFunctionType;
+export declare const isTSConstructorType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSConstructorType;
+export declare const isClassOrTypeElement: (node: TSESTree.Node | null | undefined) => node is TSESTree.FunctionExpression | TSESTree.MethodDefinitionComputedName | TSESTree.MethodDefinitionNonComputedName | TSESTree.PropertyDefinitionComputedName | TSESTree.PropertyDefinitionNonComputedName | TSESTree.TSAbstractMethodDefinitionComputedName | TSESTree.TSAbstractMethodDefinitionNonComputedName | TSESTree.TSAbstractPropertyDefinitionComputedName | TSESTree.TSAbstractPropertyDefinitionNonComputedName | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSIndexSignature | TSESTree.TSMethodSignatureComputedName | TSESTree.TSMethodSignatureNonComputedName | TSESTree.TSPropertySignatureComputedName | TSESTree.TSPropertySignatureNonComputedName;
+/**
+ * Checks if a node is a constructor method.
+ */
+export declare const isConstructor: (node: TSESTree.Node | null | undefined) => node is Partial & (TSESTree.MethodDefinitionComputedName | TSESTree.MethodDefinitionNonComputedName);
+/**
+ * Checks if a node is a setter method.
+ */
+export declare function isSetter(node: TSESTree.Node | undefined): node is {
+    kind: 'set';
+} & (TSESTree.MethodDefinition | TSESTree.Property);
+export declare const isIdentifier: (node: TSESTree.Node | null | undefined) => node is TSESTree.Identifier;
+/**
+ * Checks if a node represents an `await …` expression.
+ */
+export declare const isAwaitExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.AwaitExpression;
+/**
+ * Checks if a possible token is the `await` keyword.
+ */
+export declare const isAwaitKeyword: (token: TSESTree.Token | null | undefined) => token is {
+    value: "await";
+} & TSESTree.IdentifierToken;
+/**
+ * Checks if a possible token is the `type` keyword.
+ */
+export declare const isTypeKeyword: (token: TSESTree.Token | null | undefined) => token is {
+    value: "type";
+} & TSESTree.IdentifierToken;
+/**
+ * Checks if a possible token is the `import` keyword.
+ */
+export declare const isImportKeyword: (token: TSESTree.Token | null | undefined) => token is {
+    value: "import";
+} & TSESTree.KeywordToken;
+export declare const isLoop: (node: TSESTree.Node | null | undefined) => node is TSESTree.DoWhileStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.ForStatement | TSESTree.WhileStatement;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.js
new file mode 100644
index 0000000000000000000000000000000000000000..7b867603cc1574049dfbcee0cee150bb86767c43
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ast-utils/predicates.js
@@ -0,0 +1,108 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isLoop = exports.isImportKeyword = exports.isTypeKeyword = exports.isAwaitKeyword = exports.isAwaitExpression = exports.isIdentifier = exports.isConstructor = exports.isClassOrTypeElement = exports.isTSConstructorType = exports.isTSFunctionType = exports.isFunctionOrFunctionType = exports.isFunctionType = exports.isFunction = exports.isVariableDeclarator = exports.isTypeAssertion = exports.isLogicalOrOperator = exports.isOptionalCallExpression = exports.isNotNonNullAssertionPunctuator = exports.isNonNullAssertionPunctuator = exports.isNotOptionalChainPunctuator = exports.isOptionalChainPunctuator = void 0;
+exports.isSetter = isSetter;
+const ts_estree_1 = require("../ts-estree");
+const helpers_1 = require("./helpers");
+exports.isOptionalChainPunctuator = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: '?.' });
+exports.isNotOptionalChainPunctuator = (0, helpers_1.isNotTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: '?.' });
+exports.isNonNullAssertionPunctuator = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: '!' });
+exports.isNotNonNullAssertionPunctuator = (0, helpers_1.isNotTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Punctuator, { value: '!' });
+/**
+ * Returns true if and only if the node represents: foo?.() or foo.bar?.()
+ */
+exports.isOptionalCallExpression = (0, helpers_1.isNodeOfTypeWithConditions)(ts_estree_1.AST_NODE_TYPES.CallExpression, 
+// this flag means the call expression itself is option
+// i.e. it is foo.bar?.() and not foo?.bar()
+{ optional: true });
+/**
+ * Returns true if and only if the node represents logical OR
+ */
+exports.isLogicalOrOperator = (0, helpers_1.isNodeOfTypeWithConditions)(ts_estree_1.AST_NODE_TYPES.LogicalExpression, { operator: '||' });
+/**
+ * Checks if a node is a type assertion:
+ * ```
+ * x as foo
+ * x
+ * ```
+ */
+exports.isTypeAssertion = (0, helpers_1.isNodeOfTypes)([
+    ts_estree_1.AST_NODE_TYPES.TSAsExpression,
+    ts_estree_1.AST_NODE_TYPES.TSTypeAssertion,
+]);
+exports.isVariableDeclarator = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.VariableDeclarator);
+const functionTypes = [
+    ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression,
+    ts_estree_1.AST_NODE_TYPES.FunctionDeclaration,
+    ts_estree_1.AST_NODE_TYPES.FunctionExpression,
+];
+exports.isFunction = (0, helpers_1.isNodeOfTypes)(functionTypes);
+const functionTypeTypes = [
+    ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
+    ts_estree_1.AST_NODE_TYPES.TSConstructorType,
+    ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
+    ts_estree_1.AST_NODE_TYPES.TSDeclareFunction,
+    ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
+    ts_estree_1.AST_NODE_TYPES.TSFunctionType,
+    ts_estree_1.AST_NODE_TYPES.TSMethodSignature,
+];
+exports.isFunctionType = (0, helpers_1.isNodeOfTypes)(functionTypeTypes);
+exports.isFunctionOrFunctionType = (0, helpers_1.isNodeOfTypes)([
+    ...functionTypes,
+    ...functionTypeTypes,
+]);
+exports.isTSFunctionType = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.TSFunctionType);
+exports.isTSConstructorType = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.TSConstructorType);
+exports.isClassOrTypeElement = (0, helpers_1.isNodeOfTypes)([
+    // ClassElement
+    ts_estree_1.AST_NODE_TYPES.PropertyDefinition,
+    ts_estree_1.AST_NODE_TYPES.FunctionExpression,
+    ts_estree_1.AST_NODE_TYPES.MethodDefinition,
+    ts_estree_1.AST_NODE_TYPES.TSAbstractPropertyDefinition,
+    ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition,
+    ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
+    ts_estree_1.AST_NODE_TYPES.TSIndexSignature,
+    // TypeElement
+    ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
+    ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
+    // AST_NODE_TYPES.TSIndexSignature,
+    ts_estree_1.AST_NODE_TYPES.TSMethodSignature,
+    ts_estree_1.AST_NODE_TYPES.TSPropertySignature,
+]);
+/**
+ * Checks if a node is a constructor method.
+ */
+exports.isConstructor = (0, helpers_1.isNodeOfTypeWithConditions)(ts_estree_1.AST_NODE_TYPES.MethodDefinition, { kind: 'constructor' });
+/**
+ * Checks if a node is a setter method.
+ */
+function isSetter(node) {
+    return (!!node &&
+        (node.type === ts_estree_1.AST_NODE_TYPES.MethodDefinition ||
+            node.type === ts_estree_1.AST_NODE_TYPES.Property) &&
+        node.kind === 'set');
+}
+exports.isIdentifier = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.Identifier);
+/**
+ * Checks if a node represents an `await …` expression.
+ */
+exports.isAwaitExpression = (0, helpers_1.isNodeOfType)(ts_estree_1.AST_NODE_TYPES.AwaitExpression);
+/**
+ * Checks if a possible token is the `await` keyword.
+ */
+exports.isAwaitKeyword = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Identifier, { value: 'await' });
+/**
+ * Checks if a possible token is the `type` keyword.
+ */
+exports.isTypeKeyword = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Identifier, { value: 'type' });
+/**
+ * Checks if a possible token is the `import` keyword.
+ */
+exports.isImportKeyword = (0, helpers_1.isTokenOfTypeWithConditions)(ts_estree_1.AST_TOKEN_TYPES.Keyword, { value: 'import' });
+exports.isLoop = (0, helpers_1.isNodeOfTypes)([
+    ts_estree_1.AST_NODE_TYPES.DoWhileStatement,
+    ts_estree_1.AST_NODE_TYPES.ForStatement,
+    ts_estree_1.AST_NODE_TYPES.ForInStatement,
+    ts_estree_1.AST_NODE_TYPES.ForOfStatement,
+    ts_estree_1.AST_NODE_TYPES.WhileStatement,
+]);
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..093a2d907f2e2479b270487d44bff4cc1eb9ab72
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.d.ts
@@ -0,0 +1,9 @@
+import type { RuleCreateFunction, RuleModule } from '../ts-eslint';
+/**
+ * Uses type inference to fetch the Options type from the given RuleModule
+ */
+export type InferOptionsTypeFromRule = T extends RuleModule ? Options : T extends RuleCreateFunction ? Options : unknown;
+/**
+ * Uses type inference to fetch the MessageIds type from the given RuleModule
+ */
+export type InferMessageIdsTypeFromRule = T extends RuleModule ? MessageIds : T extends RuleCreateFunction ? MessageIds : unknown;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/InferTypesFromRule.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e6a75e2ba7166df745cc0243e77d931baaa39748
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.d.ts
@@ -0,0 +1,32 @@
+import type { RuleContext, RuleListener, RuleMetaData, RuleMetaDataDocs, RuleModule } from '../ts-eslint/Rule';
+export type NamedCreateRuleMetaDocs = Omit;
+export type NamedCreateRuleMeta = {
+    docs: PluginDocs & RuleMetaDataDocs;
+} & Omit, 'docs'>;
+export interface RuleCreateAndOptions {
+    create: (context: Readonly>, optionsWithDefault: Readonly) => RuleListener;
+    /** @deprecated Use meta.defaultOptions instead */
+    defaultOptions?: Readonly;
+}
+export interface RuleWithMeta extends RuleCreateAndOptions {
+    meta: RuleMetaData;
+    name?: string;
+}
+export interface RuleWithMetaAndName extends RuleCreateAndOptions {
+    meta: NamedCreateRuleMeta;
+    name: string;
+}
+type RuleModuleWithName = RuleModule & {
+    name: string;
+};
+/**
+ * Creates reusable function to create rules with default options and docs URLs.
+ *
+ * @param urlCreator Creates a documentation URL for a given rule name.
+ * @returns Function to create a rule with the docs URL format.
+ */
+export declare function RuleCreator(urlCreator: (ruleName: string) => string): ({ meta, name, ...rule }: Readonly>) => RuleModuleWithName;
+export declare namespace RuleCreator {
+    var withoutDocs: (args: Readonly>) => RuleModule;
+}
+export { type RuleListener, type RuleModule } from '../ts-eslint/Rule';
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js
new file mode 100644
index 0000000000000000000000000000000000000000..eb8ccf27457735e36168427e9362ca4df52f1b91
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js
@@ -0,0 +1,54 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.RuleCreator = RuleCreator;
+const applyDefault_1 = require("./applyDefault");
+/**
+ * Creates reusable function to create rules with default options and docs URLs.
+ *
+ * @param urlCreator Creates a documentation URL for a given rule name.
+ * @returns Function to create a rule with the docs URL format.
+ */
+function RuleCreator(urlCreator) {
+    // This function will get much easier to call when this is merged https://github.com/Microsoft/TypeScript/pull/26349
+    // TODO - when the above PR lands; add type checking for the context.report `data` property
+    return function createNamedRule({ meta, name, ...rule }) {
+        const ruleWithDocs = createRule({
+            meta: {
+                ...meta,
+                docs: {
+                    ...meta.docs,
+                    url: urlCreator(name),
+                },
+            },
+            name,
+            ...rule,
+        });
+        return ruleWithDocs;
+    };
+}
+function createRule({ create, 
+// Keep accepting deprecated defaultOptions for backward compatibility.
+// eslint-disable-next-line @typescript-eslint/no-deprecated
+defaultOptions, meta, name, }) {
+    const resolvedDefaultOptions = (meta.defaultOptions ??
+        defaultOptions ??
+        []);
+    return {
+        create(context) {
+            const optionsWithDefault = (0, applyDefault_1.applyDefault)(resolvedDefaultOptions, context.options);
+            return create(context, optionsWithDefault);
+        },
+        defaultOptions,
+        meta,
+        name,
+    };
+}
+/**
+ * Creates a well-typed TSESLint custom ESLint rule without a docs URL.
+ *
+ * @returns Well-typed TSESLint custom ESLint rule.
+ * @remarks It is generally better to provide a docs URL function to RuleCreator.
+ */
+RuleCreator.withoutDocs = function withoutDocs(args) {
+    return createRule(args);
+};
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..72deb69b9b0b9fc749dbd79bb851e85781cda26f
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.d.ts
@@ -0,0 +1,8 @@
+/**
+ * Pure function - doesn't mutate either parameter!
+ * Uses the default options and overrides with the options provided by the user
+ * @param defaultOptions the defaults
+ * @param userOptions the user opts
+ * @returns the options with defaults
+ */
+export declare function applyDefault(defaultOptions: Readonly, userOptions: Readonly | null): Default;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js
new file mode 100644
index 0000000000000000000000000000000000000000..7f1b395f913c0c0b25de5100375a92bdb1abeeda
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/applyDefault.js
@@ -0,0 +1,33 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.applyDefault = applyDefault;
+const deepMerge_1 = require("./deepMerge");
+/**
+ * Pure function - doesn't mutate either parameter!
+ * Uses the default options and overrides with the options provided by the user
+ * @param defaultOptions the defaults
+ * @param userOptions the user opts
+ * @returns the options with defaults
+ */
+function applyDefault(defaultOptions, userOptions) {
+    // clone defaults
+    const options = structuredClone(defaultOptions);
+    if (userOptions == null) {
+        return options;
+    }
+    // For avoiding the type error
+    //   `This expression is not callable. Type 'unknown' has no call signatures.ts(2349)`
+    options.forEach((opt, i) => {
+        // eslint-disable-next-line @typescript-eslint/internal/eqeq-nullish
+        if (userOptions[i] !== undefined) {
+            const userOpt = userOptions[i];
+            if ((0, deepMerge_1.isObjectNotArray)(userOpt) && (0, deepMerge_1.isObjectNotArray)(opt)) {
+                options[i] = (0, deepMerge_1.deepMerge)(opt, userOpt);
+            }
+            else {
+                options[i] = userOpt;
+            }
+        }
+    });
+    return options;
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b5d31ffbc36b0255bc04f9f07bf7a81dafec92c6
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.d.ts
@@ -0,0 +1,14 @@
+export type ObjectLike = Record;
+/**
+ * Check if the variable contains an object strictly rejecting arrays
+ * @returns `true` if obj is an object
+ */
+export declare function isObjectNotArray(obj: unknown): obj is ObjectLike;
+/**
+ * Pure function - doesn't mutate either parameter!
+ * Merges two objects together deeply, overwriting the properties in first with the properties in second
+ * @param first The first object
+ * @param second The second object
+ * @returns a new object
+ */
+export declare function deepMerge(first?: ObjectLike, second?: ObjectLike): Record;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js
new file mode 100644
index 0000000000000000000000000000000000000000..81017121a179be21205e8a7bfc7e48f1ddac734e
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/deepMerge.js
@@ -0,0 +1,46 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isObjectNotArray = isObjectNotArray;
+exports.deepMerge = deepMerge;
+/**
+ * Check if the variable contains an object strictly rejecting arrays
+ * @returns `true` if obj is an object
+ */
+function isObjectNotArray(obj) {
+    return typeof obj === 'object' && obj != null && !Array.isArray(obj);
+}
+/**
+ * Pure function - doesn't mutate either parameter!
+ * Merges two objects together deeply, overwriting the properties in first with the properties in second
+ * @param first The first object
+ * @param second The second object
+ * @returns a new object
+ */
+function deepMerge(first = {}, second = {}) {
+    // get the unique set of keys across both objects
+    const keys = new Set([...Object.keys(first), ...Object.keys(second)]);
+    return Object.fromEntries([...keys].map(key => {
+        const firstHasKey = key in first;
+        const secondHasKey = key in second;
+        const firstValue = first[key];
+        const secondValue = second[key];
+        let value;
+        if (firstHasKey && secondHasKey) {
+            if (isObjectNotArray(firstValue) && isObjectNotArray(secondValue)) {
+                // object type
+                value = deepMerge(firstValue, secondValue);
+            }
+            else {
+                // value type
+                value = secondValue;
+            }
+        }
+        else if (firstHasKey) {
+            value = firstValue;
+        }
+        else {
+            value = secondValue;
+        }
+        return [key, value];
+    }));
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a6a91ff62d985c3dcd190ea71b097d1dd13858b5
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.d.ts
@@ -0,0 +1,22 @@
+import type * as TSESLint from '../ts-eslint';
+import type { ParserServices, ParserServicesWithTypeInformation } from '../ts-estree';
+/**
+ * Try to retrieve type-aware parser service from context.
+ * This **_will_** throw if it is not available.
+ */
+export declare function getParserServices(context: Readonly>): ParserServicesWithTypeInformation;
+/**
+ * Try to retrieve type-aware parser service from context.
+ * This **_will_** throw if it is not available.
+ */
+export declare function getParserServices(context: Readonly>, allowWithoutFullTypeInformation: false): ParserServicesWithTypeInformation;
+/**
+ * Try to retrieve type-aware parser service from context.
+ * This **_will not_** throw if it is not available.
+ */
+export declare function getParserServices(context: Readonly>, allowWithoutFullTypeInformation: true): ParserServices;
+/**
+ * Try to retrieve type-aware parser service from context.
+ * This may or may not throw if it is not available, depending on if `allowWithoutFullTypeInformation` is `true`
+ */
+export declare function getParserServices(context: Readonly>, allowWithoutFullTypeInformation: boolean): ParserServices;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js
new file mode 100644
index 0000000000000000000000000000000000000000..5489d1b0a5d509b7b2bd2b6df42fa015904c197d
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js
@@ -0,0 +1,41 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getParserServices = getParserServices;
+const parserSeemsToBeTSESLint_1 = require("./parserSeemsToBeTSESLint");
+const ERROR_MESSAGE_REQUIRES_PARSER_SERVICES = "You have used a rule which requires type information, but don't have parserOptions set to generate type information for this file. See https://tseslint.com/typed-linting for enabling linting with type information.";
+const ERROR_MESSAGE_UNKNOWN_PARSER = 'Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.';
+function getParserServices(context, allowWithoutFullTypeInformation = false) {
+    const parser = 
+    // eslint-disable-next-line @typescript-eslint/no-deprecated -- For compatibility with ESLint 8
+    context.parserPath || context.languageOptions.parser?.meta?.name;
+    // This check is unnecessary if the user is using the latest version of our parser.
+    //
+    // However the world isn't perfect:
+    // - Users often use old parser versions.
+    //   Old versions of the parser would not return any parserServices unless parserOptions.project was set.
+    // - Users sometimes use parsers that aren't @typescript-eslint/parser
+    //   Other parsers won't return the parser services we expect (if they return any at all).
+    //
+    // This check allows us to handle bad user setups whilst providing a nice user-facing
+    // error message explaining the problem.
+    if (context.sourceCode.parserServices?.esTreeNodeToTSNodeMap == null ||
+        context.sourceCode.parserServices.tsNodeToESTreeNodeMap == null) {
+        throwError(parser);
+    }
+    // if a rule requires full type information, then hard fail if it doesn't exist
+    // this forces the user to supply parserOptions.project
+    if (context.sourceCode.parserServices.program == null &&
+        !allowWithoutFullTypeInformation) {
+        throwError(parser);
+    }
+    return context.sourceCode.parserServices;
+}
+/* eslint-enable @typescript-eslint/unified-signatures */
+function throwError(parser) {
+    const messages = [
+        ERROR_MESSAGE_REQUIRES_PARSER_SERVICES,
+        `Parser: ${parser || '(unknown)'}`,
+        !(0, parserSeemsToBeTSESLint_1.parserSeemsToBeTSESLint)(parser) && ERROR_MESSAGE_UNKNOWN_PARSER,
+    ].filter(Boolean);
+    throw new Error(messages.join('\n'));
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..632b6e051981ecd3cd3ca1b6d6bc5a52243decaf
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.d.ts
@@ -0,0 +1,6 @@
+export * from './applyDefault';
+export * from './deepMerge';
+export * from './getParserServices';
+export * from './InferTypesFromRule';
+export * from './nullThrows';
+export * from './RuleCreator';
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..c07bc84f634cb6af147db13c75669547cc91639d
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/index.js
@@ -0,0 +1,22 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (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 });
+__exportStar(require("./applyDefault"), exports);
+__exportStar(require("./deepMerge"), exports);
+__exportStar(require("./getParserServices"), exports);
+__exportStar(require("./InferTypesFromRule"), exports);
+__exportStar(require("./nullThrows"), exports);
+__exportStar(require("./RuleCreator"), exports);
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..26f4979a6bc82de09ef6f08a6679a145cf111055
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.d.ts
@@ -0,0 +1,12 @@
+/**
+ * A set of common reasons for calling nullThrows
+ */
+export declare const NullThrowsReasons: {
+    readonly MissingParent: "Expected node to have a parent.";
+    readonly MissingToken: (token: string, thing: string) => string;
+};
+/**
+ * Assert that a value must not be null or undefined.
+ * This is a nice explicit alternative to the non-null assertion operator.
+ */
+export declare function nullThrows(value: T, message: string): NonNullable;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js
new file mode 100644
index 0000000000000000000000000000000000000000..89e93828b755e22a2c4b3702152f93720972ab47
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js
@@ -0,0 +1,21 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.NullThrowsReasons = void 0;
+exports.nullThrows = nullThrows;
+/**
+ * A set of common reasons for calling nullThrows
+ */
+exports.NullThrowsReasons = {
+    MissingParent: 'Expected node to have a parent.',
+    MissingToken: (token, thing) => `Expected to find a ${token} for the ${thing}.`,
+};
+/**
+ * Assert that a value must not be null or undefined.
+ * This is a nice explicit alternative to the non-null assertion operator.
+ */
+function nullThrows(value, message) {
+    if (value == null) {
+        throw new Error(`Non-null Assertion Failed: ${message}`);
+    }
+    return value;
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..16b5d8be878553ddb8258ee9b1237c50f4331066
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.d.ts
@@ -0,0 +1 @@
+export declare function parserSeemsToBeTSESLint(parser: string | undefined): boolean;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js
new file mode 100644
index 0000000000000000000000000000000000000000..c976b6c0eaf1faf68b1c67b9be2450e2636be9f7
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/eslint-utils/parserSeemsToBeTSESLint.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.parserSeemsToBeTSESLint = parserSeemsToBeTSESLint;
+function parserSeemsToBeTSESLint(parser) {
+    return !!parser && /(?:typescript-eslint|\.\.)[\w/\\]*parser/.test(parser);
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/index.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f7301058167f38936c161f4099f84f1b3013bd29
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/index.d.ts
@@ -0,0 +1,6 @@
+export * as ASTUtils from './ast-utils';
+export * as ESLintUtils from './eslint-utils';
+export * as JSONSchema from './json-schema';
+export * as TSESLint from './ts-eslint';
+export * from './ts-estree';
+export * as TSUtils from './ts-utils';
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/index.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..8008ec2fa0d36ff5a966dfd2951deaee757c3d63
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/index.js
@@ -0,0 +1,45 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+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.TSUtils = exports.TSESLint = exports.JSONSchema = exports.ESLintUtils = exports.ASTUtils = void 0;
+exports.ASTUtils = __importStar(require("./ast-utils"));
+exports.ESLintUtils = __importStar(require("./eslint-utils"));
+exports.JSONSchema = __importStar(require("./json-schema"));
+exports.TSESLint = __importStar(require("./ts-eslint"));
+__exportStar(require("./ts-estree"), exports);
+exports.TSUtils = __importStar(require("./ts-utils"));
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/json-schema.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/json-schema.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a266e7c66419a3a370d9fdb87bc2f371643c2a1f
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/json-schema.d.ts
@@ -0,0 +1,387 @@
+/**
+ * This is a fork of https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13f63c2eb8d7479caf01ab8d72f9e3683368a8f5/types/json-schema/index.d.ts
+ * We intentionally fork this because:
+ * - ESLint ***ONLY*** supports JSONSchema v4
+ * - We want to provide stricter types
+ */
+/**
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
+ */
+export type JSONSchema4TypeName = 'any' | 'array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string';
+/**
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
+ */
+export type JSONSchema4Type = boolean | number | string | null;
+export type JSONSchema4TypeExtended = JSONSchema4Array | JSONSchema4Object | JSONSchema4Type;
+export interface JSONSchema4Object {
+    [key: string]: JSONSchema4TypeExtended;
+}
+export interface JSONSchema4Array extends Array {
+}
+/**
+ * Meta schema
+ *
+ * Recommended values:
+ * - 'http://json-schema.org/schema#'
+ * - 'http://json-schema.org/hyper-schema#'
+ * - 'http://json-schema.org/draft-04/schema#'
+ * - 'http://json-schema.org/draft-04/hyper-schema#'
+ * - 'http://json-schema.org/draft-03/schema#'
+ * - 'http://json-schema.org/draft-03/hyper-schema#'
+ *
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
+ */
+export type JSONSchema4Version = string;
+/**
+ * JSON Schema V4
+ * @see https://tools.ietf.org/html/draft-zyp-json-schema-04
+ */
+export type JSONSchema4 = JSONSchema4AllOfSchema | JSONSchema4AnyOfSchema | JSONSchema4AnySchema | JSONSchema4ArraySchema | JSONSchema4BooleanSchema | JSONSchema4MultiSchema | JSONSchema4NullSchema | JSONSchema4NumberSchema | JSONSchema4ObjectSchema | JSONSchema4OneOfSchema | JSONSchema4RefSchema | JSONSchema4StringSchema;
+interface JSONSchema4Base {
+    /**
+     * Reusable definitions that can be referenced via `$ref`
+     */
+    $defs?: Record | undefined;
+    /**
+     * Path to a schema defined in `definitions`/`$defs` that will form the base
+     * for this schema.
+     *
+     * If you are defining an "array" schema (`schema: [ ... ]`) for your rule
+     * then you should prefix this with `items/0` so that the validator can find
+     * your definitions.
+     *
+     * eg: `'#/items/0/definitions/myDef'`
+     *
+     * Otherwise if you are defining an "object" schema (`schema: { ... }`) for
+     * your rule you can directly reference your definitions
+     *
+     * eg: `'#/definitions/myDef'`
+     */
+    $ref?: string | undefined;
+    $schema?: JSONSchema4Version | undefined;
+    /**
+     * (AND) Must be valid against all of the sub-schemas
+     */
+    allOf?: JSONSchema4[] | undefined;
+    /**
+     * (OR) Must be valid against any of the sub-schemas
+     */
+    anyOf?: JSONSchema4[] | undefined;
+    /**
+     * The default value for the item if not present
+     */
+    default?: JSONSchema4TypeExtended | undefined;
+    /**
+     * Reusable definitions that can be referenced via `$ref`
+     */
+    definitions?: Record | undefined;
+    /**
+     * This attribute is a string that provides a full description of the of
+     * purpose the instance property.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
+     */
+    description?: string | undefined;
+    /**
+     * The value of this property MUST be another schema which will provide
+     * a base schema which the current schema will inherit from.  The
+     * inheritance rules are such that any instance that is valid according
+     * to the current schema MUST be valid according to the referenced
+     * schema.  This MAY also be an array, in which case, the instance MUST
+     * be valid for all the schemas in the array.  A schema that extends
+     * another schema MAY define additional attributes, constrain existing
+     * attributes, or add other constraints.
+     *
+     * Conceptually, the behavior of extends can be seen as validating an
+     * instance against all constraints in the extending schema as well as
+     * the extended schema(s).
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
+     */
+    extends?: string | string[] | undefined;
+    id?: string | undefined;
+    /**
+     * (NOT) Must not be valid against the given schema
+     */
+    not?: JSONSchema4 | undefined;
+    /**
+     * (XOR) Must be valid against exactly one of the sub-schemas
+     */
+    oneOf?: JSONSchema4[] | undefined;
+    /**
+     * This attribute indicates if the instance must have a value, and not
+     * be undefined. This is false by default, making the instance
+     * optional.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
+     */
+    required?: boolean | string[] | undefined;
+    /**
+     * This attribute is a string that provides a short description of the
+     * instance property.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
+     */
+    title?: string | undefined;
+    /**
+     * A single type, or a union of simple types
+     */
+    type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
+}
+export interface JSONSchema4RefSchema extends JSONSchema4Base {
+    $ref: string;
+    type?: undefined;
+}
+export interface JSONSchema4AllOfSchema extends JSONSchema4Base {
+    allOf: JSONSchema4[];
+    type?: undefined;
+}
+export interface JSONSchema4AnyOfSchema extends JSONSchema4Base {
+    anyOf: JSONSchema4[];
+    type?: undefined;
+}
+export interface JSONSchema4OneOfSchema extends JSONSchema4Base {
+    oneOf: JSONSchema4[];
+    type?: undefined;
+}
+export interface JSONSchema4MultiSchema extends Omit, Omit, Omit, Omit, Omit, Omit, Omit {
+    /**
+     * This provides an enumeration of all possible values that are valid
+     * for the instance property. This MUST be an array, and each item in
+     * the array represents a possible value for the instance value. If
+     * this attribute is defined, the instance value MUST be one of the
+     * values in the array in order for the schema to be valid.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
+     */
+    enum?: JSONSchema4Type[];
+    type: JSONSchema4TypeName[];
+}
+/**
+ * @see https://json-schema.org/understanding-json-schema/reference/object.html
+ */
+export interface JSONSchema4ObjectSchema extends JSONSchema4Base {
+    /**
+     * This attribute defines a schema for all properties that are not
+     * explicitly defined in an object type definition. If specified, the
+     * value MUST be a schema or a boolean. If false is provided, no
+     * additional properties are allowed beyond the properties defined in
+     * the schema. The default value is an empty schema which allows any
+     * value for additional properties.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
+     */
+    additionalProperties?: boolean | JSONSchema4 | undefined;
+    /**
+     * The `dependencies` keyword conditionally applies a sub-schema when a given
+     * property is present. This schema is applied in the same way `allOf` applies
+     * schemas. Nothing is merged or extended. Both schemas apply independently.
+     */
+    dependencies?: Record | undefined;
+    /**
+     * The maximum number of properties allowed for record-style schemas
+     */
+    maxProperties?: number | undefined;
+    /**
+     * The minimum number of properties required for record-style schemas
+     */
+    minProperties?: number | undefined;
+    /**
+     * This attribute is an object that defines the schema for a set of
+     * property names of an object instance. The name of each property of
+     * this attribute's object is a regular expression pattern in the ECMA
+     * 262/Perl 5 format, while the value is a schema. If the pattern
+     * matches the name of a property on the instance object, the value of
+     * the instance's property MUST be valid against the pattern name's
+     * schema value.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
+     */
+    patternProperties?: Record | undefined;
+    /**
+     * This attribute is an object with property definitions that define the
+     * valid values of instance object property values. When the instance
+     * value is an object, the property values of the instance object MUST
+     * conform to the property definitions in this object. In this object,
+     * each property definition's value MUST be a schema, and the property's
+     * name MUST be the name of the instance property that it defines.  The
+     * instance property value MUST be valid according to the schema from
+     * the property definition. Properties are considered unordered, the
+     * order of the instance properties MAY be in any order.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
+     */
+    properties?: Record | undefined;
+    type: 'object';
+}
+/**
+ * @see https://json-schema.org/understanding-json-schema/reference/array.html
+ */
+export interface JSONSchema4ArraySchema extends JSONSchema4Base {
+    /**
+     * May only be defined when "items" is defined, and is a tuple of JSONSchemas.
+     *
+     * This provides a definition for additional items in an array instance
+     * when tuple definitions of the items is provided.  This can be false
+     * to indicate additional items in the array are not allowed, or it can
+     * be a schema that defines the schema of the additional items.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
+     */
+    additionalItems?: boolean | JSONSchema4 | undefined;
+    /**
+     * This attribute defines the allowed items in an instance array, and
+     * MUST be a schema or an array of schemas.  The default value is an
+     * empty schema which allows any value for items in the instance array.
+     *
+     * When this attribute value is a schema and the instance value is an
+     * array, then all the items in the array MUST be valid according to the
+     * schema.
+     *
+     * When this attribute value is an array of schemas and the instance
+     * value is an array, each position in the instance array MUST conform
+     * to the schema in the corresponding position for this array.  This
+     * called tuple typing.  When tuple typing is used, additional items are
+     * allowed, disallowed, or constrained by the "additionalItems"
+     * (Section 5.6) attribute using the same rules as
+     * "additionalProperties" (Section 5.4) for objects.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
+     */
+    items?: JSONSchema4 | JSONSchema4[] | undefined;
+    /**
+     * Defines the maximum length of an array
+     */
+    maxItems?: number | undefined;
+    /**
+     * Defines the minimum length of an array
+     */
+    minItems?: number | undefined;
+    type: 'array';
+    /**
+     * Enforces that all items in the array are unique
+     */
+    uniqueItems?: boolean | undefined;
+}
+/**
+ * @see https://json-schema.org/understanding-json-schema/reference/string.html
+ */
+export interface JSONSchema4StringSchema extends JSONSchema4Base {
+    enum?: string[] | undefined;
+    /**
+     * The `format` keyword allows for basic semantic identification of certain
+     * kinds of string values that are commonly used.
+     *
+     * For example, because JSON doesn’t have a “DateTime” type, dates need to be
+     * encoded as strings. `format` allows the schema author to indicate that the
+     * string value should be interpreted as a date.
+     *
+     * ajv v6 provides a few built-in formats - all other strings will cause AJV
+     * to throw during schema compilation
+     */
+    format?: 'date' | 'date-time' | 'email' | 'hostname' | 'ipv4' | 'ipv6' | 'json-pointer' | 'json-pointer-uri-fragment' | 'regex' | 'relative-json-pointer' | 'time' | 'uri' | 'uri-reference' | 'uri-template' | 'url' | 'uuid' | undefined;
+    /**
+     * The maximum allowed length for the string
+     */
+    maxLength?: number | undefined;
+    /**
+     * The minimum allowed length for the string
+     */
+    minLength?: number | undefined;
+    /**
+     * The `pattern` keyword is used to restrict a string to a particular regular
+     * expression. The regular expression syntax is the one defined in JavaScript
+     * (ECMA 262 specifically) with Unicode support.
+     *
+     * When defining the regular expressions, it’s important to note that the
+     * string is considered valid if the expression matches anywhere within the
+     * string. For example, the regular expression "p" will match any string with
+     * a p in it, such as "apple" not just a string that is simply "p". Therefore,
+     * it is usually less confusing, as a matter of course, to surround the
+     * regular expression in ^...$, for example, "^p$", unless there is a good
+     * reason not to do so.
+     */
+    pattern?: string | undefined;
+    type: 'string';
+}
+/**
+ * @see https://json-schema.org/understanding-json-schema/reference/numeric.html
+ */
+export interface JSONSchema4NumberSchema extends JSONSchema4Base {
+    /**
+     * This provides an enumeration of all possible values that are valid
+     * for the instance property. This MUST be an array, and each item in
+     * the array represents a possible value for the instance value. If
+     * this attribute is defined, the instance value MUST be one of the
+     * values in the array in order for the schema to be valid.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
+     */
+    enum?: number[] | undefined;
+    /**
+     * The exclusive minimum allowed value for the number
+     * - `true` = `x < maximum`
+     * - `false` = `x <= maximum`
+     *
+     * Default is `false`
+     */
+    exclusiveMaximum?: boolean | undefined;
+    /**
+     * Indicates whether or not `minimum` is the inclusive or exclusive minimum
+     * - `true` = `x > minimum`
+     * - `false` = `x ≥ minimum`
+     *
+     * Default is `false`
+     */
+    exclusiveMinimum?: boolean | undefined;
+    /**
+     * The maximum allowed value for the number
+     */
+    maximum?: number | undefined;
+    /**
+     * The minimum allowed value for the number
+     */
+    minimum?: number | undefined;
+    /**
+     * Numbers can be restricted to a multiple of a given number, using the
+     * `multipleOf` keyword. It may be set to any positive number.
+     */
+    multipleOf?: number | undefined;
+    type: 'integer' | 'number';
+}
+/**
+ * @see https://json-schema.org/understanding-json-schema/reference/boolean.html
+ */
+export interface JSONSchema4BooleanSchema extends JSONSchema4Base {
+    /**
+     * This provides an enumeration of all possible values that are valid
+     * for the instance property. This MUST be an array, and each item in
+     * the array represents a possible value for the instance value. If
+     * this attribute is defined, the instance value MUST be one of the
+     * values in the array in order for the schema to be valid.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
+     */
+    enum?: boolean[] | undefined;
+    type: 'boolean';
+}
+/**
+ * @see https://json-schema.org/understanding-json-schema/reference/null.html
+ */
+export interface JSONSchema4NullSchema extends JSONSchema4Base {
+    /**
+     * This provides an enumeration of all possible values that are valid
+     * for the instance property. This MUST be an array, and each item in
+     * the array represents a possible value for the instance value. If
+     * this attribute is defined, the instance value MUST be one of the
+     * values in the array in order for the schema to be valid.
+     *
+     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
+     */
+    enum?: null[] | undefined;
+    type: 'null';
+}
+export interface JSONSchema4AnySchema extends JSONSchema4Base {
+    type: 'any';
+}
+export {};
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/json-schema.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/json-schema.js
new file mode 100644
index 0000000000000000000000000000000000000000..2a79849ed9e64c614bd85f2d3f713379fb79128d
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/json-schema.js
@@ -0,0 +1,8 @@
+"use strict";
+/**
+ * This is a fork of https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13f63c2eb8d7479caf01ab8d72f9e3683368a8f5/types/json-schema/index.d.ts
+ * We intentionally fork this because:
+ * - ESLint ***ONLY*** supports JSONSchema v4
+ * - We want to provide stricter types
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..18f6b38856137bbcfdbf3d5e29115aaedb530617
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.d.ts
@@ -0,0 +1,8 @@
+import type { AST_TOKEN_TYPES, TSESTree } from '../ts-estree';
+declare namespace AST {
+    type TokenType = AST_TOKEN_TYPES;
+    type Token = TSESTree.Token;
+    type SourceLocation = TSESTree.SourceLocation;
+    type Range = TSESTree.Range;
+}
+export type { AST };
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.js
new file mode 100644
index 0000000000000000000000000000000000000000..d89703d6b520c5002f9327b5bf4d89ede4f2b8b0
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/AST.js
@@ -0,0 +1,3 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace, no-restricted-syntax */
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a255825fe208b7f682e15a9483cb32a2ebc56b51
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.d.ts
@@ -0,0 +1,291 @@
+import type { Parser as ParserType } from './Parser';
+import type * as ParserOptionsTypes from './ParserOptions';
+import type { Processor as ProcessorType } from './Processor';
+import type { LooseRuleDefinition, SharedConfigurationSettings } from './Rule';
+/** @internal */
+export declare namespace SharedConfig {
+    type Severity = 0 | 1 | 2;
+    type SeverityString = 'error' | 'off' | 'warn';
+    type RuleLevel = Severity | SeverityString;
+    type RuleLevelAndOptions = [RuleLevel, ...unknown[]];
+    type RuleEntry = RuleLevel | RuleLevelAndOptions;
+    type RulesRecord = Partial>;
+    type GlobalVariableOptionBase = 'off' | /** @deprecated use `'readonly'` */ 'readable' | 'readonly' | 'writable' | /** @deprecated use `'writable'` */ 'writeable';
+    type GlobalVariableOptionBoolean = /** @deprecated use `'readonly'` */ false | /** @deprecated use `'writable'` */ true;
+    type GlobalVariableOption = GlobalVariableOptionBase | GlobalVariableOptionBoolean;
+    interface GlobalsConfig {
+        [name: string]: GlobalVariableOption;
+    }
+    interface EnvironmentConfig {
+        [name: string]: boolean;
+    }
+    type ParserOptions = ParserOptionsTypes.ParserOptions;
+    interface PluginMeta {
+        /**
+         * The meta.name property should match the npm package name for your plugin.
+         */
+        name: string;
+        /**
+         * If you followed the classic style to name your package
+         * (e.g. `eslint-plugin-X`, `@X/eslint-plugin`, or `@X/eslint-plugin-Y`),
+         * then this should match the classic namespace inferred for your package
+         * (e.g. `X`, `@X`, or `@X/Y`, respectively).
+         */
+        namespace?: string;
+        /**
+         * The meta.version property should match the npm package version for your plugin.
+         */
+        version: string;
+    }
+}
+export declare namespace ClassicConfig {
+    export type EnvironmentConfig = SharedConfig.EnvironmentConfig;
+    export type GlobalsConfig = SharedConfig.GlobalsConfig;
+    export type GlobalVariableOption = SharedConfig.GlobalVariableOption;
+    export type GlobalVariableOptionBase = SharedConfig.GlobalVariableOptionBase;
+    export type ParserOptions = SharedConfig.ParserOptions;
+    export type RuleEntry = SharedConfig.RuleEntry;
+    export type RuleLevel = SharedConfig.RuleLevel;
+    export type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
+    export type RulesRecord = SharedConfig.RulesRecord;
+    export type Severity = SharedConfig.Severity;
+    export type SeverityString = SharedConfig.SeverityString;
+    interface BaseConfig {
+        $schema?: string;
+        /**
+         * The environment settings.
+         */
+        env?: EnvironmentConfig;
+        /**
+         * The path to other config files or the package name of shareable configs.
+         */
+        extends?: string | string[];
+        /**
+         * The global variable settings.
+         */
+        globals?: GlobalsConfig;
+        /**
+         * The flag that disables comment directives.
+         */
+        noInlineConfig?: boolean;
+        /**
+         * The override settings per kind of files.
+         */
+        overrides?: ConfigOverride[];
+        /**
+         * The path to a parser or the package name of a parser.
+         */
+        parser?: string | null;
+        /**
+         * The parser options.
+         */
+        parserOptions?: ParserOptions;
+        /**
+         * The plugin specifiers.
+         */
+        plugins?: string[];
+        /**
+         * The processor specifier.
+         */
+        processor?: string;
+        /**
+         * The flag to report unused `eslint-disable` comments.
+         */
+        reportUnusedDisableDirectives?: boolean;
+        /**
+         * The rule settings.
+         */
+        rules?: RulesRecord;
+        /**
+         * The shared settings.
+         */
+        settings?: SharedConfigurationSettings;
+    }
+    export interface ConfigOverride extends BaseConfig {
+        excludedFiles?: string | string[];
+        files: string | string[];
+    }
+    export interface Config extends BaseConfig {
+        /**
+         * The glob patterns that ignore to lint.
+         */
+        ignorePatterns?: string | string[];
+        /**
+         * The root flag.
+         */
+        root?: boolean;
+    }
+    export {};
+}
+export declare namespace FlatConfig {
+    type EcmaVersion = ParserOptionsTypes.EcmaVersion;
+    type GlobalsConfig = SharedConfig.GlobalsConfig;
+    type Parser = ParserType.LooseParserModule;
+    type ParserOptions = SharedConfig.ParserOptions;
+    type PluginMeta = SharedConfig.PluginMeta;
+    type Processor = ProcessorType.LooseProcessorModule;
+    type RuleEntry = SharedConfig.RuleEntry;
+    type RuleLevel = SharedConfig.RuleLevel;
+    type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
+    type Rules = SharedConfig.RulesRecord;
+    type Settings = SharedConfigurationSettings;
+    type Severity = SharedConfig.Severity;
+    type SeverityString = SharedConfig.SeverityString;
+    type SourceType = 'commonjs' | ParserOptionsTypes.SourceType;
+    interface SharedConfigs {
+        [key: string]: Config | ConfigArray;
+    }
+    interface Plugin {
+        /**
+         * Shared configurations bundled with the plugin.
+         * Users will reference these directly in their config (i.e. `plugin.configs.recommended`).
+         */
+        configs?: SharedConfigs;
+        /**
+         * Metadata about your plugin for easier debugging and more effective caching of plugins.
+         */
+        meta?: {
+            [K in keyof PluginMeta]?: PluginMeta[K] | undefined;
+        };
+        /**
+         * The definition of plugin processors.
+         * Users can stringly reference the processor using the key in their config (i.e., `"pluginName/processorName"`).
+         */
+        processors?: Partial> | undefined;
+        /**
+         * The definition of plugin rules.
+         * The key must be the name of the rule that users will use
+         * Users can stringly reference the rule using the key they registered the plugin under combined with the rule name.
+         * i.e. for the user config `plugins: { foo: pluginReference }` - the reference would be `"foo/ruleName"`.
+         */
+        rules?: Record | undefined;
+    }
+    interface Plugins {
+        /**
+         * We intentionally omit the `configs` key from this object because it avoids
+         * type conflicts with old plugins that haven't updated their configs to flat configs yet.
+         * It's valid to reference these old plugins because ESLint won't access the
+         * `.config` property of a plugin when evaluating a flat config.
+         */
+        [pluginAlias: string]: Omit;
+    }
+    interface LinterOptions {
+        /**
+         * A Boolean value indicating if inline configuration is allowed.
+         */
+        noInlineConfig?: boolean;
+        /**
+         * A severity string indicating if and how unused disable and enable
+         * directives should be tracked and reported. For legacy compatibility, `true`
+         * is equivalent to `"warn"` and `false` is equivalent to `"off"`.
+         * @default "warn"
+         */
+        reportUnusedDisableDirectives?: boolean | SharedConfig.Severity | SharedConfig.SeverityString;
+        /**
+         * A severity string indicating if and how unused inline directives
+         * should be tracked and reported.
+         *
+         * since ESLint 9.19.0
+         * @default "off"
+         */
+        reportUnusedInlineConfigs?: SharedConfig.Severity | SharedConfig.SeverityString;
+    }
+    interface LanguageOptions {
+        /**
+         * The version of ECMAScript to support.
+         * May be any year (i.e., `2022`) or version (i.e., `5`).
+         * Set to `"latest"` for the most recent supported version.
+         * @default "latest"
+         */
+        ecmaVersion?: EcmaVersion | undefined;
+        /**
+         * An object specifying additional objects that should be added to the global scope during linting.
+         */
+        globals?: GlobalsConfig | undefined;
+        /**
+         * An object containing a `parse()` method or a `parseForESLint()` method.
+         * @default
+         * ```
+         * // https://github.com/eslint/espree
+         * require('espree')
+         * ```
+         */
+        parser?: Parser | undefined;
+        /**
+         * An object specifying additional options that are passed directly to the parser.
+         * The available options are parser-dependent.
+         */
+        parserOptions?: ParserOptions | undefined;
+        /**
+         * The type of JavaScript source code.
+         * Possible values are `"script"` for traditional script files, `"module"` for ECMAScript modules (ESM), and `"commonjs"` for CommonJS files.
+         * @default
+         * ```
+         * // for `.js` and `.mjs` files
+         * "module"
+         * // for `.cjs` files
+         * "commonjs"
+         * ```
+         */
+        sourceType?: SourceType | undefined;
+    }
+    interface Config {
+        /**
+         * The base path for files and ignores.
+         *
+         * Note that this is not permitted inside an `extends` array.
+         *
+         * Since ESLint 9.30.0
+         */
+        basePath?: string;
+        /**
+         * An array of glob patterns indicating the files that the configuration object should apply to.
+         * If not specified, the configuration object applies to all files matched by any other configuration object.
+         */
+        files?: (string | string[])[];
+        /**
+         * An array of glob patterns indicating the files that the configuration object should not apply to.
+         * If not specified, the configuration object applies to all files matched by files.
+         */
+        ignores?: string[];
+        /**
+         * Language specifier in the form `namespace/language-name` where `namespace` is a plugin name set in the `plugins` field.
+         */
+        language?: string;
+        /**
+         * An object containing settings related to how JavaScript is configured for linting.
+         */
+        languageOptions?: LanguageOptions;
+        /**
+         * An object containing settings related to the linting process.
+         */
+        linterOptions?: LinterOptions;
+        /**
+         * An string to identify the configuration object. Used in error messages and inspection tools.
+         */
+        name?: string;
+        /**
+         * An object containing a name-value mapping of plugin names to plugin objects.
+         * When `files` is specified, these plugins are only available to the matching files.
+         */
+        plugins?: Plugins;
+        /**
+         * Either an object containing `preprocess()` and `postprocess()` methods or
+         * a string indicating the name of a processor inside of a plugin
+         * (i.e., `"pluginName/processorName"`).
+         */
+        processor?: string | Processor;
+        /**
+         * An object containing the configured rules.
+         * When `files` or `ignores` are specified, these rule configurations are only available to the matching files.
+         */
+        rules?: Rules;
+        /**
+         * An object containing name-value pairs of information that should be available to all rules.
+         */
+        settings?: Settings;
+    }
+    type ConfigArray = Config[];
+    type ConfigPromise = Promise;
+    type ConfigFile = ConfigArray | ConfigPromise;
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.js
new file mode 100644
index 0000000000000000000000000000000000000000..8e47a1b2633a8579e269b85dcd17d85c5f483b39
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Config.js
@@ -0,0 +1,3 @@
+"use strict";
+/* eslint-disable  @typescript-eslint/consistent-indexed-object-style,  @typescript-eslint/no-namespace */
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0b43dba7672bd53f2afb8320371d614a64b7301b
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.d.ts
@@ -0,0 +1,7 @@
+export { FlatESLint } from './eslint/FlatESLint';
+export { FlatESLint as ESLint } from './eslint/FlatESLint';
+export { 
+/**
+ * @deprecated - use ESLint instead
+ */
+LegacyESLint, } from './eslint/LegacyESLint';
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.js
new file mode 100644
index 0000000000000000000000000000000000000000..479507408b10c361a77fd15eacedbe5e07d36c1a
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ESLint.js
@@ -0,0 +1,13 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.LegacyESLint = exports.ESLint = exports.FlatESLint = void 0;
+var FlatESLint_1 = require("./eslint/FlatESLint");
+Object.defineProperty(exports, "FlatESLint", { enumerable: true, get: function () { return FlatESLint_1.FlatESLint; } });
+var FlatESLint_2 = require("./eslint/FlatESLint");
+Object.defineProperty(exports, "ESLint", { enumerable: true, get: function () { return FlatESLint_2.FlatESLint; } });
+var LegacyESLint_1 = require("./eslint/LegacyESLint");
+// TODO(typescript-eslint@v9) - remove this in the next major release
+/**
+ * @deprecated - use ESLint instead
+ */
+Object.defineProperty(exports, "LegacyESLint", { enumerable: true, get: function () { return LegacyESLint_1.LegacyESLint; } });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..12b34b8ff3a0e878ca146c625c60f0eecdbb9b22
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.d.ts
@@ -0,0 +1,255 @@
+import type { ClassicConfig, FlatConfig, SharedConfig } from './Config';
+import type { Parser } from './Parser';
+import type { Processor as ProcessorType } from './Processor';
+import type { AnyRuleCreateFunction, AnyRuleModule, RuleCreateFunction, RuleFix, RuleModule } from './Rule';
+import type { SourceCode } from './SourceCode';
+export type MinimalRuleModule = Partial, 'create'>> & Pick, 'create'>;
+declare class LinterBase {
+    /**
+     * The version from package.json.
+     */
+    readonly version: string;
+    /**
+     * Initialize the Linter.
+     * @param config the config object
+     */
+    constructor(config?: Linter.LinterOptions);
+    /**
+     * Define a new parser module
+     * @param parserId Name of the parser
+     * @param parserModule The parser object
+     */
+    defineParser(parserId: string, parserModule: Parser.LooseParserModule): void;
+    /**
+     * Defines a new linting rule.
+     * @param ruleId A unique rule identifier
+     * @param ruleModule Function from context to object mapping AST node types to event handlers
+     */
+    defineRule(ruleId: string, ruleModule: MinimalRuleModule | RuleCreateFunction): void;
+    /**
+     * Defines many new linting rules.
+     * @param rulesToDefine map from unique rule identifier to rule
+     */
+    defineRules(rulesToDefine: Record | RuleCreateFunction>): void;
+    /**
+     * Gets an object with all loaded rules.
+     * @returns All loaded rules
+     */
+    getRules(): Map>;
+    /**
+     * Gets the `SourceCode` object representing the parsed source.
+     * @returns The `SourceCode` object.
+     */
+    getSourceCode(): SourceCode;
+    /**
+     * Verifies the text against the rules specified by the second argument.
+     * @param textOrSourceCode The text to parse or a SourceCode object.
+     * @param config An ESLintConfig instance to configure everything.
+     * @param filenameOrOptions The optional filename of the file being checked.
+     *        If this is not set, the filename will default to '' in the rule context.
+     *        If this is an object, then it has "filename", "allowInlineConfig", and some properties.
+     * @returns The results as an array of messages or an empty array if no messages.
+     */
+    verify(textOrSourceCode: string | SourceCode, config: Linter.ConfigType, filenameOrOptions?: string | Linter.VerifyOptions): Linter.LintMessage[];
+    /**
+     * The version from package.json.
+     */
+    static readonly version: string;
+    /**
+     * Performs multiple autofix passes over the text until as many fixes as possible have been applied.
+     * @param code The source text to apply fixes to.
+     * @param config The ESLint config object to use.
+     * @param options The ESLint options object to use.
+     * @returns The result of the fix operation as returned from the SourceCodeFixer.
+     */
+    verifyAndFix(code: string, config: Linter.ConfigType, options: Linter.FixOptions): Linter.FixReport;
+}
+declare namespace Linter {
+    interface LinterOptions {
+        /**
+         * Which config format to use.
+         * @default 'flat'
+         */
+        configType?: ConfigTypeSpecifier;
+        /**
+         * path to a directory that should be considered as the current working directory.
+         */
+        cwd?: string;
+    }
+    type ConfigTypeSpecifier = 'eslintrc' | 'flat';
+    type EnvironmentConfig = SharedConfig.EnvironmentConfig;
+    type GlobalsConfig = SharedConfig.GlobalsConfig;
+    type GlobalVariableOption = SharedConfig.GlobalVariableOption;
+    type GlobalVariableOptionBase = SharedConfig.GlobalVariableOptionBase;
+    type ParserOptions = SharedConfig.ParserOptions;
+    type PluginMeta = SharedConfig.PluginMeta;
+    type RuleEntry = SharedConfig.RuleEntry;
+    type RuleLevel = SharedConfig.RuleLevel;
+    type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
+    type RulesRecord = SharedConfig.RulesRecord;
+    type Severity = SharedConfig.Severity;
+    type SeverityString = SharedConfig.SeverityString;
+    /** @deprecated use {@link Linter.ConfigType} instead */
+    type Config = ClassicConfig.Config;
+    type ConfigType = ClassicConfig.Config | FlatConfig.Config | FlatConfig.ConfigArray;
+    /** @deprecated use {@link ClassicConfig.ConfigOverride} instead */
+    type ConfigOverride = ClassicConfig.ConfigOverride;
+    interface VerifyOptions {
+        /**
+         * Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied.
+         * Useful if you want to validate JS without comments overriding rules.
+         */
+        allowInlineConfig?: boolean;
+        /**
+         * if `true` then the linter doesn't make `fix` properties into the lint result.
+         */
+        disableFixes?: boolean;
+        /**
+         * the filename of the source code.
+         */
+        filename?: string;
+        /**
+         * the predicate function that selects adopt code blocks.
+         */
+        filterCodeBlock?: (filename: string, text: string) => boolean;
+        /**
+         * postprocessor for report messages.
+         * If provided, this should accept an array of the message lists
+         * for each code block returned from the preprocessor, apply a mapping to
+         * the messages as appropriate, and return a one-dimensional array of
+         * messages.
+         */
+        postprocess?: ProcessorType.PostProcess;
+        /**
+         * preprocessor for source text.
+         * If provided, this should accept a string of source text, and return an array of code blocks to lint.
+         */
+        preprocess?: ProcessorType.PreProcess;
+        /**
+         * Adds reported errors for unused `eslint-disable` directives.
+         */
+        reportUnusedDisableDirectives?: boolean | SeverityString;
+    }
+    interface FixOptions extends VerifyOptions {
+        /**
+         * Determines whether fixes should be applied.
+         */
+        fix?: boolean;
+    }
+    interface LintSuggestion {
+        desc: string;
+        fix: RuleFix;
+        messageId?: string;
+    }
+    interface LintMessage {
+        /**
+         * The 1-based column number.
+         */
+        column: number;
+        /**
+         * The 1-based column number of the end location.
+         */
+        endColumn?: number;
+        /**
+         * The 1-based line number of the end location.
+         */
+        endLine?: number;
+        /**
+         * If `true` then this is a fatal error.
+         */
+        fatal?: true;
+        /**
+         * Information for autofix.
+         */
+        fix?: RuleFix;
+        /**
+         * The 1-based line number.
+         */
+        line: number;
+        /**
+         * The error message.
+         */
+        message: string;
+        messageId?: string;
+        /**
+         * @deprecated `nodeType` is deprecated and will be removed in the next major version.
+         */
+        nodeType?: string;
+        /**
+         * The ID of the rule which makes this message.
+         */
+        ruleId: string | null;
+        /**
+         * The severity of this message.
+         */
+        severity: Severity;
+        source: string | null;
+        /**
+         * Information for suggestions
+         */
+        suggestions?: LintSuggestion[];
+    }
+    interface FixReport {
+        /**
+         * True, if the code was fixed
+         */
+        fixed: boolean;
+        /**
+         * Collection of all messages for the given code
+         */
+        messages: LintMessage[];
+        /**
+         * Fixed code text (might be the same as input if no fixes were applied).
+         */
+        output: string;
+    }
+    /** @deprecated use {@link Parser.ParserModule} */
+    type ParserModule = Parser.LooseParserModule;
+    /** @deprecated use {@link Parser.ParseResult} */
+    type ESLintParseResult = Parser.ParseResult;
+    /** @deprecated use {@link ProcessorType.ProcessorModule} */
+    type Processor = ProcessorType.ProcessorModule;
+    interface Environment {
+        /**
+         * The definition of global variables.
+         */
+        globals?: GlobalsConfig;
+        /**
+         * The parser options that will be enabled under this environment.
+         */
+        parserOptions?: ParserOptions;
+    }
+    type LegacyPluginRules = Record;
+    type PluginRules = Record;
+    interface Plugin {
+        /**
+         * The definition of plugin configs.
+         */
+        configs?: Record;
+        /**
+         * The definition of plugin environments.
+         */
+        environments?: Record;
+        /**
+         * Metadata about your plugin for easier debugging and more effective caching of plugins.
+         */
+        meta?: PluginMeta;
+        /**
+         * The definition of plugin processors.
+         */
+        processors?: Record;
+        /**
+         * The definition of plugin rules.
+         */
+        rules?: LegacyPluginRules;
+    }
+}
+declare const Linter_base: typeof LinterBase;
+/**
+ * The Linter object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it
+ * simply parses and reports on the code. In particular, the Linter object does not process configuration objects
+ * or files.
+ */
+declare class Linter extends Linter_base {
+}
+export { Linter };
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.js
new file mode 100644
index 0000000000000000000000000000000000000000..7fe7076e218442c8ca6c1d4e2e31145bc857a5eb
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Linter.js
@@ -0,0 +1,13 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace, no-restricted-syntax */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Linter = void 0;
+const eslint_1 = require("eslint");
+/**
+ * The Linter object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it
+ * simply parses and reports on the code. In particular, the Linter object does not process configuration objects
+ * or files.
+ */
+class Linter extends eslint_1.Linter {
+}
+exports.Linter = Linter;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9638ff10ec83df9d2c60eedeafeefea23b17e71f
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.d.ts
@@ -0,0 +1,94 @@
+import type { ParserServices, TSESTree } from '../ts-estree';
+import type { ParserOptions } from './ParserOptions';
+import type { Scope } from './Scope';
+export declare namespace Parser {
+    interface ParserMeta {
+        /**
+         * The unique name of the parser.
+         */
+        name: string;
+        /**
+         * The a string identifying the version of the parser.
+         */
+        version?: string;
+    }
+    /**
+     * A loose definition of the ParserModule type for use with configs
+     * This type intended to relax validation of configs so that parsers that have
+     * different AST types or scope managers can still be passed to configs
+     *
+     * @see {@link LooseRuleDefinition}, {@link LooseProcessorModule}
+     */
+    type LooseParserModule = {
+        /**
+         * Information about the parser to uniquely identify it when serializing.
+         */
+        meta?: {
+            [K in keyof ParserMeta]?: ParserMeta[K] | undefined;
+        };
+        /**
+         * Parses the given text into an AST
+         */
+        parseForESLint(text: string, options?: unknown): {
+            [k in keyof ParseResult]: unknown;
+        };
+    } | {
+        /**
+         * Information about the parser to uniquely identify it when serializing.
+         */
+        meta?: {
+            [K in keyof ParserMeta]?: ParserMeta[K] | undefined;
+        };
+        /**
+         * Parses the given text into an ESTree AST
+         */
+        parse(text: string, options?: unknown): unknown;
+    };
+    type ParserModule = {
+        /**
+         * Information about the parser to uniquely identify it when serializing.
+         */
+        meta?: ParserMeta;
+        /**
+         * Parses the given text into an AST
+         */
+        parseForESLint(text: string, options?: ParserOptions): ParseResult;
+    } | {
+        /**
+         * Information about the parser to uniquely identify it when serializing.
+         */
+        meta?: ParserMeta;
+        /**
+         * Parses the given text into an ESTree AST
+         */
+        parse(text: string, options?: ParserOptions): TSESTree.Program;
+    };
+    interface ParseResult {
+        /**
+         * The ESTree AST
+         */
+        ast: TSESTree.Program;
+        /**
+         * A `ScopeManager` object.
+         * Custom parsers can use customized scope analysis for experimental/enhancement syntaxes.
+         * The default is the `ScopeManager` object which is created by `eslint-scope`.
+         */
+        scopeManager?: Scope.ScopeManager;
+        /**
+         * Any parser-dependent services (such as type checkers for nodes).
+         * The value of the services property is available to rules as `context.sourceCode.parserServices`.
+         * The default is an empty object.
+         */
+        services?: ParserServices;
+        /**
+         * An object to customize AST traversal.
+         * The keys of the object are the type of AST nodes.
+         * Each value is an array of the property names which should be traversed.
+         * The default is `KEYS` of `eslint-visitor-keys`.
+         */
+        visitorKeys?: VisitorKeys;
+    }
+    interface VisitorKeys {
+        [nodeType: string]: readonly string[];
+    }
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.js
new file mode 100644
index 0000000000000000000000000000000000000000..0d0ae6b0c34e9869b6519e8813dd22c7eebbbe8d
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Parser.js
@@ -0,0 +1,3 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace */
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a2fdf43da0a66cb4a701170549b1a95e69c509eb
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.d.ts
@@ -0,0 +1 @@
+export type { DebugLevel, EcmaVersion, ParserOptions, SourceType, } from '@typescript-eslint/types';
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/ParserOptions.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d976dacc736125b98d8b087dd328c8180535841d
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.d.ts
@@ -0,0 +1,63 @@
+import type { Linter } from './Linter';
+export declare namespace Processor {
+    interface ProcessorMeta {
+        /**
+         * The unique name of the processor.
+         */
+        name: string;
+        /**
+         * The a string identifying the version of the processor.
+         */
+        version?: string;
+    }
+    type PreProcess = (text: string, filename: string) => (string | {
+        filename: string;
+        text: string;
+    })[];
+    type PostProcess = (messagesList: Linter.LintMessage[][], filename: string) => Linter.LintMessage[];
+    interface ProcessorModule {
+        /**
+         * Information about the processor to uniquely identify it when serializing.
+         */
+        meta?: ProcessorMeta;
+        /**
+         * The function to merge messages.
+         */
+        postprocess?: PostProcess;
+        /**
+         * The function to extract code blocks.
+         */
+        preprocess?: PreProcess;
+        /**
+         * If `true` then it means the processor supports autofix.
+         */
+        supportsAutofix?: boolean;
+    }
+    /**
+     * A loose definition of the ParserModule type for use with configs
+     * This type intended to relax validation of configs so that parsers that have
+     * different AST types or scope managers can still be passed to configs
+     *
+     * @see {@link LooseRuleDefinition}, {@link LooseParserModule}
+     */
+    interface LooseProcessorModule {
+        /**
+         * Information about the processor to uniquely identify it when serializing.
+         */
+        meta?: {
+            [K in keyof ProcessorMeta]?: ProcessorMeta[K] | undefined;
+        };
+        /**
+         * The function to merge messages.
+         */
+        postprocess?: (messagesList: any, filename: string) => any;
+        /**
+         * The function to extract code blocks.
+         */
+        preprocess?: (text: string, filename: string) => any;
+        /**
+         * If `true` then it means the processor supports autofix.
+         */
+        supportsAutofix?: boolean | undefined;
+    }
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.js
new file mode 100644
index 0000000000000000000000000000000000000000..0d0ae6b0c34e9869b6519e8813dd22c7eebbbe8d
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Processor.js
@@ -0,0 +1,3 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace */
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4dbd12ee6242763f914fe65bc2a91bcfe49dee59
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.d.ts
@@ -0,0 +1,614 @@
+import type { JSONSchema4 } from '../json-schema';
+import type { ParserServices, TSESTree } from '../ts-estree';
+import type { AST } from './AST';
+import type { FlatConfig } from './Config';
+import type { Linter } from './Linter';
+import type { Scope } from './Scope';
+import type { SourceCode } from './SourceCode';
+export type RuleRecommendation = 'recommended' | 'strict' | 'stylistic';
+export interface RuleRecommendationAcrossConfigs {
+    recommended?: true;
+    strict: Partial;
+}
+export interface RuleMetaDataDocs {
+    /**
+     * Concise description of the rule.
+     */
+    description: string;
+    /**
+     * The URL of the rule's docs.
+     */
+    url?: string;
+    /**
+     * Mark this rule as feature-frozen.
+     */
+    frozen?: boolean;
+}
+export interface ExternalSpecifier {
+    /**
+     * Name of the referenced plugin / rule.
+     */
+    name?: string;
+    /**
+     * URL pointing to documentation for the plugin / rule.
+     */
+    url?: string;
+}
+export interface ReplacedByInfo {
+    /**
+     * General message presented to the user, e.g. how to replace the rule
+     */
+    message?: string;
+    /**
+     * URL to more information about this replacement in general
+     */
+    url?: string;
+    /**
+     * Name should be "eslint" if the replacement is an ESLint core rule. Omit
+     * the property if the replacement is in the same plugin.
+     */
+    plugin?: ExternalSpecifier;
+    /**
+     * Name and documentation of the replacement rule
+     */
+    rule?: ExternalSpecifier;
+}
+export interface DeprecatedInfo {
+    /**
+     * General message presented to the user, e.g. for the key rule why the rule
+     * is deprecated or for info how to replace the rule.
+     */
+    message?: string;
+    /**
+     * URL to more information about this deprecation in general.
+     */
+    url?: string;
+    /**
+     * An empty array explicitly states that there is no replacement.
+     */
+    replacedBy?: ReplacedByInfo[];
+    /**
+     * The package version since when the rule is deprecated (should use full
+     * semver without a leading "v").
+     */
+    deprecatedSince?: string;
+    /**
+     * The estimated version when the rule is removed (probably the next major
+     * version). null means the rule is "frozen" (will be available but will not
+     * be changed).
+     */
+    availableUntil?: string | null;
+}
+export interface RuleMetaData {
+    /**
+     * True if the rule is deprecated, false otherwise
+     */
+    deprecated?: boolean | DeprecatedInfo;
+    /**
+     * Documentation for the rule
+     */
+    docs?: PluginDocs & RuleMetaDataDocs;
+    /**
+     * The fixer category. Omit if there is no fixer
+     */
+    fixable?: 'code' | 'whitespace';
+    /**
+     * Specifies whether rules can return suggestions. Omit if there is no suggestions
+     */
+    hasSuggestions?: boolean;
+    /**
+     * A map of messages which the rule can report.
+     * The key is the messageId, and the string is the parameterised error string.
+     * See: https://eslint.org/docs/developer-guide/working-with-rules#messageids
+     */
+    messages: Record;
+    /**
+     * The name of the rule this rule was replaced by, if it was deprecated.
+     *
+     * @deprecated since eslint 9.21.0, in favor of `RuleMetaData#deprecated.replacedBy`
+     */
+    replacedBy?: readonly string[];
+    /**
+     * The options schema. Supply an empty array if there are no options.
+     */
+    schema: JSONSchema4 | readonly JSONSchema4[];
+    /**
+     * The type of rule.
+     * - `"problem"` means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve.
+     * - `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn’t changed.
+     * - `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts of the program that determine how the code looks rather than how it executes. These rules work on parts of the code that aren’t specified in the AST.
+     */
+    type: 'layout' | 'problem' | 'suggestion';
+    /**
+     * Specifies default options for the rule. If present, any user-provided options in their config will be merged on top of them recursively.
+     * This merging will be applied directly to `context.options`.
+     * If you want backwards-compatible support for earlier ESLint version, consider using the top-level `defaultOptions` instead.
+     *
+     * since ESLint 9.15.0
+     */
+    defaultOptions?: Options;
+}
+export interface RuleMetaDataWithDocs extends RuleMetaData {
+    /**
+     * Documentation for the rule
+     */
+    docs: PluginDocs & RuleMetaDataDocs;
+}
+export interface RuleFix {
+    range: Readonly;
+    text: string;
+}
+export interface RuleFixer {
+    insertTextAfter(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix;
+    insertTextAfterRange(range: Readonly, text: string): RuleFix;
+    insertTextBefore(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix;
+    insertTextBeforeRange(range: Readonly, text: string): RuleFix;
+    remove(nodeOrToken: TSESTree.Node | TSESTree.Token): RuleFix;
+    removeRange(range: Readonly): RuleFix;
+    replaceText(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix;
+    replaceTextRange(range: Readonly, text: string): RuleFix;
+}
+export interface SuggestionReportDescriptor extends Omit, 'fix'> {
+    readonly fix: ReportFixFunction;
+}
+export type ReportFixFunction = (fixer: RuleFixer) => IterableIterator | readonly RuleFix[] | RuleFix | null;
+export type ReportSuggestionArray = SuggestionReportDescriptor[];
+export type ReportDescriptorMessageData = Readonly>;
+interface ReportDescriptorBase {
+    /**
+     * The parameters for the message string associated with `messageId`.
+     */
+    readonly data?: ReportDescriptorMessageData;
+    /**
+     * The fixer function.
+     */
+    readonly fix?: ReportFixFunction | null;
+    /**
+     * The messageId which is being reported.
+     */
+    readonly messageId: MessageIds;
+}
+interface ReportDescriptorWithSuggestion extends ReportDescriptorBase {
+    /**
+     * 6.7's Suggestions API
+     */
+    readonly suggest?: Readonly> | null;
+}
+interface ReportDescriptorNodeOptionalLoc {
+    /**
+     * An override of the location of the report
+     */
+    readonly loc?: Readonly | Readonly;
+    /**
+     * The Node or AST Token which the report is being attached to
+     */
+    readonly node: TSESTree.Node | TSESTree.Token;
+}
+interface ReportDescriptorLocOnly {
+    /**
+     * An override of the location of the report
+     */
+    loc: Readonly | Readonly;
+}
+export type ReportDescriptor = (ReportDescriptorLocOnly | ReportDescriptorNodeOptionalLoc) & ReportDescriptorWithSuggestion;
+/**
+ * Plugins can add their settings using declaration
+ * merging against this interface.
+ */
+export interface SharedConfigurationSettings {
+    [name: string]: unknown;
+}
+export interface RuleContext {
+    /**
+     * The rule ID.
+     */
+    id: string;
+    /**
+     * The language options configured for this run
+     */
+    languageOptions: FlatConfig.LanguageOptions & {
+        parserOptions: FlatConfig.ParserOptions;
+    };
+    /**
+     * An array of the configured options for this rule.
+     * This array does not include the rule severity.
+     */
+    options: Options;
+    /**
+     * The parser options configured for this run
+     * @deprecated This was deprecated in ESLint 9 and removed in ESLint 10.
+     */
+    parserOptions: Linter.ParserOptions;
+    /**
+     * The name of the parser from configuration, if in eslintrc (legacy) config.
+     * @deprecated This was deprecated in ESLint 9 and removed in ESLint 10.
+     */
+    parserPath: string | undefined;
+    /**
+     * An object containing parser-provided services for rules
+     *
+     * @deprecated in favor of `SourceCode#parserServices`
+     */
+    parserServices?: ParserServices;
+    /**
+     * The shared settings from configuration.
+     * We do not have any shared settings in this plugin.
+     */
+    settings: SharedConfigurationSettings;
+    /**
+     * Returns an array of the ancestors of the currently-traversed node, starting at
+     * the root of the AST and continuing through the direct parent of the current node.
+     * This array does not include the currently-traversed node itself.
+     *
+     * @deprecated in favor of `SourceCode#getAncestors`
+     */
+    getAncestors(): TSESTree.Node[];
+    /**
+     * Returns a list of variables declared by the given node.
+     * This information can be used to track references to variables.
+     *
+     * @deprecated in favor of `SourceCode#getDeclaredVariables`
+     */
+    getDeclaredVariables(node: TSESTree.Node): readonly Scope.Variable[];
+    /**
+     * Returns the current working directory passed to Linter.
+     * It is a path to a directory that should be considered as the current working directory.
+     * @deprecated in favor of `RuleContext#cwd`
+     */
+    getCwd(): string;
+    /**
+     * The current working directory passed to Linter.
+     * It is a path to a directory that should be considered as the current working directory.
+     */
+    cwd: string;
+    /**
+     * Returns the filename associated with the source.
+     *
+     * @deprecated in favor of `RuleContext#filename`
+     */
+    getFilename(): string;
+    /**
+     * The filename associated with the source.
+     */
+    filename: string;
+    /**
+     * Returns the full path of the file on disk without any code block information (unlike `getFilename()`).
+     * @deprecated in favor of `RuleContext#physicalFilename`
+     */
+    getPhysicalFilename(): string;
+    /**
+     * The full path of the file on disk without any code block information (unlike `filename`).
+     */
+    physicalFilename: string;
+    /**
+     * Returns the scope of the currently-traversed node.
+     * This information can be used track references to variables.
+     *
+     * @deprecated in favor of `SourceCode#getScope`
+     */
+    getScope(): Scope.Scope;
+    /**
+     * Returns a SourceCode object that you can use to work with the source that
+     * was passed to ESLint.
+     *
+     * @deprecated in favor of `RuleContext#sourceCode`
+     */
+    getSourceCode(): Readonly;
+    /**
+     * A SourceCode object that you can use to work with the source that
+     * was passed to ESLint.
+     */
+    sourceCode: Readonly;
+    /**
+     * Marks a variable with the given name in the current scope as used.
+     * This affects the no-unused-vars rule.
+     *
+     * @deprecated in favor of `SourceCode#markVariableAsUsed`
+     */
+    markVariableAsUsed(name: string): boolean;
+    /**
+     * Reports a problem in the code.
+     */
+    report(descriptor: ReportDescriptor): void;
+}
+/**
+ * Part of the code path analysis feature of ESLint:
+ * https://eslint.org/docs/latest/extend/code-path-analysis
+ *
+ * These are used in the `onCodePath*` methods. (Note that the `node` parameter
+ * of these methods is intentionally omitted.)
+ *
+ * @see https://github.com/typescript-eslint/typescript-eslint/issues/6993
+ */
+export interface CodePath {
+    /** Code paths of functions this code path contains. */
+    childCodePaths: CodePath[];
+    /**
+     * Segments of the current traversal position.
+     *
+     * @deprecated
+     */
+    currentSegments: CodePathSegment[];
+    /** The final segments which includes both returned and thrown. */
+    finalSegments: CodePathSegment[];
+    /**
+     * A unique string. Respective rules can use `id` to save additional
+     * information for each code path.
+     */
+    id: string;
+    initialSegment: CodePathSegment;
+    /** The final segments which includes only returned. */
+    returnedSegments: CodePathSegment[];
+    /** The final segments which includes only thrown. */
+    thrownSegments: CodePathSegment[];
+    /** The code path of the upper function/global scope. */
+    upper: CodePath | null;
+}
+/**
+ * Part of the code path analysis feature of ESLint:
+ * https://eslint.org/docs/latest/extend/code-path-analysis
+ *
+ * These are used in the `onCodePath*` methods. (Note that the `node` parameter
+ * of these methods is intentionally omitted.)
+ *
+ * @see https://github.com/typescript-eslint/typescript-eslint/issues/6993
+ */
+export interface CodePathSegment {
+    /**
+     * A unique string. Respective rules can use `id` to save additional
+     * information for each segment.
+     */
+    id: string;
+    /**
+     * The next segments. If forking, there are two or more. If final, there is
+     * nothing.
+     */
+    nextSegments: CodePathSegment[];
+    /**
+     * The previous segments. If merging, there are two or more. If initial, there
+     * is nothing.
+     */
+    prevSegments: CodePathSegment[];
+    /**
+     * A flag which shows whether it is reachable. This becomes `false` when
+     * preceded by `return`, `throw`, `break`, or `continue`.
+     */
+    reachable: boolean;
+}
+/**
+ * Part of the code path analysis feature of ESLint:
+ * https://eslint.org/docs/latest/extend/code-path-analysis
+ *
+ * This type is unused in the `typescript-eslint` codebase since putting it on
+ * the `nodeSelector` for `RuleListener` would break the existing definition.
+ * However, it is exported here for the purposes of manual type-assertion.
+ *
+ * @see https://github.com/typescript-eslint/typescript-eslint/issues/6993
+ */
+export type CodePathFunction = ((codePath: CodePath, node: TSESTree.Node) => void) | ((fromSegment: CodePathSegment, toSegment: CodePathSegment, node: TSESTree.Node) => void) | ((segment: CodePathSegment, node: TSESTree.Node) => void);
+export type RuleFunction = (node: T) => void;
+interface RuleListenerBaseSelectors {
+    AccessorProperty?: RuleFunction;
+    ArrayExpression?: RuleFunction;
+    ArrayPattern?: RuleFunction;
+    ArrowFunctionExpression?: RuleFunction;
+    AssignmentExpression?: RuleFunction;
+    AssignmentPattern?: RuleFunction;
+    AwaitExpression?: RuleFunction;
+    BinaryExpression?: RuleFunction;
+    BlockStatement?: RuleFunction;
+    BreakStatement?: RuleFunction;
+    CallExpression?: RuleFunction;
+    CatchClause?: RuleFunction;
+    ChainExpression?: RuleFunction;
+    ClassBody?: RuleFunction;
+    ClassDeclaration?: RuleFunction;
+    ClassExpression?: RuleFunction;
+    ConditionalExpression?: RuleFunction;
+    ContinueStatement?: RuleFunction;
+    DebuggerStatement?: RuleFunction;
+    Decorator?: RuleFunction;
+    DoWhileStatement?: RuleFunction;
+    EmptyStatement?: RuleFunction;
+    ExportAllDeclaration?: RuleFunction;
+    ExportDefaultDeclaration?: RuleFunction;
+    ExportNamedDeclaration?: RuleFunction;
+    ExportSpecifier?: RuleFunction;
+    ExpressionStatement?: RuleFunction;
+    ForInStatement?: RuleFunction;
+    ForOfStatement?: RuleFunction;
+    ForStatement?: RuleFunction;
+    FunctionDeclaration?: RuleFunction;
+    FunctionExpression?: RuleFunction;
+    Identifier?: RuleFunction;
+    IfStatement?: RuleFunction;
+    ImportAttribute?: RuleFunction;
+    ImportDeclaration?: RuleFunction;
+    ImportDefaultSpecifier?: RuleFunction;
+    ImportExpression?: RuleFunction;
+    ImportNamespaceSpecifier?: RuleFunction;
+    ImportSpecifier?: RuleFunction;
+    JSXAttribute?: RuleFunction;
+    JSXClosingElement?: RuleFunction;
+    JSXClosingFragment?: RuleFunction;
+    JSXElement?: RuleFunction;
+    JSXEmptyExpression?: RuleFunction;
+    JSXExpressionContainer?: RuleFunction;
+    JSXFragment?: RuleFunction;
+    JSXIdentifier?: RuleFunction;
+    JSXMemberExpression?: RuleFunction;
+    JSXNamespacedName?: RuleFunction;
+    JSXOpeningElement?: RuleFunction;
+    JSXOpeningFragment?: RuleFunction;
+    JSXSpreadAttribute?: RuleFunction;
+    JSXSpreadChild?: RuleFunction;
+    JSXText?: RuleFunction;
+    LabeledStatement?: RuleFunction;
+    Literal?: RuleFunction;
+    LogicalExpression?: RuleFunction;
+    MemberExpression?: RuleFunction;
+    MetaProperty?: RuleFunction;
+    MethodDefinition?: RuleFunction;
+    NewExpression?: RuleFunction;
+    ObjectExpression?: RuleFunction;
+    ObjectPattern?: RuleFunction;
+    PrivateIdentifier?: RuleFunction;
+    Program?: RuleFunction;
+    Property?: RuleFunction;
+    PropertyDefinition?: RuleFunction;
+    RestElement?: RuleFunction;
+    ReturnStatement?: RuleFunction;
+    SequenceExpression?: RuleFunction;
+    SpreadElement?: RuleFunction;
+    StaticBlock?: RuleFunction;
+    Super?: RuleFunction;
+    SwitchCase?: RuleFunction;
+    SwitchStatement?: RuleFunction;
+    TaggedTemplateExpression?: RuleFunction;
+    TemplateElement?: RuleFunction;
+    TemplateLiteral?: RuleFunction;
+    ThisExpression?: RuleFunction;
+    ThrowStatement?: RuleFunction;
+    TryStatement?: RuleFunction;
+    TSAbstractAccessorProperty?: RuleFunction;
+    TSAbstractKeyword?: RuleFunction;
+    TSAbstractMethodDefinition?: RuleFunction;
+    TSAbstractPropertyDefinition?: RuleFunction;
+    TSAnyKeyword?: RuleFunction;
+    TSArrayType?: RuleFunction;
+    TSAsExpression?: RuleFunction;
+    TSAsyncKeyword?: RuleFunction;
+    TSBigIntKeyword?: RuleFunction;
+    TSBooleanKeyword?: RuleFunction;
+    TSCallSignatureDeclaration?: RuleFunction;
+    TSClassImplements?: RuleFunction;
+    TSConditionalType?: RuleFunction;
+    TSConstructorType?: RuleFunction;
+    TSConstructSignatureDeclaration?: RuleFunction;
+    TSDeclareFunction?: RuleFunction;
+    TSDeclareKeyword?: RuleFunction;
+    TSEmptyBodyFunctionExpression?: RuleFunction;
+    TSEnumBody?: RuleFunction;
+    TSEnumDeclaration?: RuleFunction;
+    TSEnumMember?: RuleFunction;
+    TSExportAssignment?: RuleFunction;
+    TSExportKeyword?: RuleFunction;
+    TSExternalModuleReference?: RuleFunction;
+    TSFunctionType?: RuleFunction;
+    TSImportEqualsDeclaration?: RuleFunction;
+    TSImportType?: RuleFunction;
+    TSIndexedAccessType?: RuleFunction;
+    TSIndexSignature?: RuleFunction;
+    TSInferType?: RuleFunction;
+    TSInstantiationExpression?: RuleFunction;
+    TSInterfaceBody?: RuleFunction;
+    TSInterfaceDeclaration?: RuleFunction;
+    TSInterfaceHeritage?: RuleFunction;
+    TSIntersectionType?: RuleFunction;
+    TSIntrinsicKeyword?: RuleFunction;
+    TSLiteralType?: RuleFunction;
+    TSMappedType?: RuleFunction;
+    TSMethodSignature?: RuleFunction;
+    TSModuleBlock?: RuleFunction;
+    TSModuleDeclaration?: RuleFunction;
+    TSNamedTupleMember?: RuleFunction;
+    TSNamespaceExportDeclaration?: RuleFunction;
+    TSNeverKeyword?: RuleFunction;
+    TSNonNullExpression?: RuleFunction;
+    TSNullKeyword?: RuleFunction;
+    TSNumberKeyword?: RuleFunction;
+    TSObjectKeyword?: RuleFunction;
+    TSOptionalType?: RuleFunction;
+    TSParameterProperty?: RuleFunction;
+    TSPrivateKeyword?: RuleFunction;
+    TSPropertySignature?: RuleFunction;
+    TSProtectedKeyword?: RuleFunction;
+    TSPublicKeyword?: RuleFunction;
+    TSQualifiedName?: RuleFunction;
+    TSReadonlyKeyword?: RuleFunction;
+    TSRestType?: RuleFunction;
+    TSSatisfiesExpression?: RuleFunction;
+    TSStaticKeyword?: RuleFunction;
+    TSStringKeyword?: RuleFunction;
+    TSSymbolKeyword?: RuleFunction;
+    TSTemplateLiteralType?: RuleFunction;
+    TSThisType?: RuleFunction;
+    TSTupleType?: RuleFunction;
+    TSTypeAliasDeclaration?: RuleFunction;
+    TSTypeAnnotation?: RuleFunction;
+    TSTypeAssertion?: RuleFunction;
+    TSTypeLiteral?: RuleFunction;
+    TSTypeOperator?: RuleFunction;
+    TSTypeParameter?: RuleFunction;
+    TSTypeParameterDeclaration?: RuleFunction;
+    TSTypeParameterInstantiation?: RuleFunction;
+    TSTypePredicate?: RuleFunction;
+    TSTypeQuery?: RuleFunction;
+    TSTypeReference?: RuleFunction;
+    TSUndefinedKeyword?: RuleFunction;
+    TSUnionType?: RuleFunction;
+    TSUnknownKeyword?: RuleFunction;
+    TSVoidKeyword?: RuleFunction;
+    UnaryExpression?: RuleFunction;
+    UpdateExpression?: RuleFunction;
+    VariableDeclaration?: RuleFunction;
+    VariableDeclarator?: RuleFunction;
+    WhileStatement?: RuleFunction;
+    WithStatement?: RuleFunction;
+    YieldExpression?: RuleFunction;
+}
+type RuleListenerExitSelectors = {
+    [K in keyof RuleListenerBaseSelectors as `${K}:exit`]: RuleListenerBaseSelectors[K];
+};
+type RuleListenerCatchAllBaseCase = Record;
+export interface RuleListenerExtension {
+}
+export type RuleListener = RuleListenerBaseSelectors & RuleListenerCatchAllBaseCase & RuleListenerExitSelectors;
+export interface RuleModule {
+    /**
+     * Function which returns an object with methods that ESLint calls to “visit”
+     * nodes while traversing the abstract syntax tree.
+     */
+    create(context: Readonly>): ExtendedRuleListener;
+    /**
+     * @deprecated Use meta.defaultOptions instead
+     * Default options the rule will be run with
+     */
+    defaultOptions?: Options;
+    /**
+     * Metadata about the rule
+     */
+    meta: RuleMetaData;
+    /**
+     * Rule name
+     */
+    name?: string;
+}
+export type AnyRuleModule = RuleModule;
+export interface RuleModuleWithMetaDocs extends RuleModule {
+    /**
+     * Metadata about the rule
+     */
+    meta: RuleMetaDataWithDocs;
+}
+export type AnyRuleModuleWithMetaDocs = RuleModuleWithMetaDocs;
+/**
+ * A loose definition of the RuleModule type for use with configs. This type is
+ * intended to relax validation of types so that we can have basic validation
+ * without being overly strict about nitty gritty details matching.
+ *
+ * For example the plugin might be declared using an old version of our types or
+ * they might use the DefinitelyTyped eslint types. Ultimately we don't need
+ * super strict validation in a config - a loose shape match is "good enough" to
+ * help validate the config is correct.
+ *
+ * @see {@link LooseParserModule}, {@link LooseProcessorModule}
+ */
+export type LooseRuleDefinition = LooseRuleCreateFunction | {
+    create: LooseRuleCreateFunction;
+    meta?: object | undefined;
+};
+export type LooseRuleCreateFunction = (context: any) => Record;
+export type RuleCreateFunction = (context: Readonly>) => RuleListener;
+export type AnyRuleCreateFunction = RuleCreateFunction;
+export {};
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Rule.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c9aa22bd49af78993366a03dbb67e2a5e17586fa
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.d.ts
@@ -0,0 +1,183 @@
+import type { AST_NODE_TYPES, AST_TOKEN_TYPES } from '../ts-estree';
+import type { ClassicConfig } from './Config';
+import type { Linter } from './Linter';
+import type { ParserOptions } from './ParserOptions';
+import type { ReportDescriptorMessageData, RuleCreateFunction, RuleModule, SharedConfigurationSettings } from './Rule';
+/**
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+export interface ValidTestCase {
+    /**
+     * Code for the test case.
+     */
+    readonly code: string;
+    /**
+     * Environments for the test case.
+     */
+    readonly env?: Readonly;
+    /**
+     * The fake filename for the test case. Useful for rules that make assertion about filenames.
+     */
+    readonly filename?: string;
+    /**
+     * The additional global variables.
+     */
+    readonly globals?: Readonly;
+    /**
+     * Name for the test case.
+     */
+    readonly name?: string;
+    /**
+     * Run this case exclusively for debugging in supported test frameworks.
+     */
+    readonly only?: boolean;
+    /**
+     * Options for the test case.
+     */
+    readonly options?: Readonly;
+    /**
+     * The absolute path for the parser.
+     */
+    readonly parser?: string;
+    /**
+     * Options for the parser.
+     */
+    readonly parserOptions?: Readonly;
+    /**
+     * Settings for the test case.
+     */
+    readonly settings?: Readonly;
+}
+/**
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+export interface SuggestionOutput {
+    /**
+     * The data used to fill the message template.
+     */
+    readonly data?: ReportDescriptorMessageData;
+    /**
+     * Reported message ID.
+     */
+    readonly messageId: MessageIds;
+    /**
+     * NOTE: Suggestions will be applied as a stand-alone change, without triggering multi-pass fixes.
+     * Each individual error has its own suggestion, so you have to show the correct, _isolated_ output for each suggestion.
+     */
+    readonly output: string;
+}
+/**
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+export interface InvalidTestCase extends ValidTestCase {
+    /**
+     * Expected errors.
+     */
+    readonly errors: readonly TestCaseError[];
+    /**
+     * The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested.
+     */
+    readonly output?: string | string[] | null;
+}
+/**
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+export interface TestCaseError {
+    /**
+     * The 1-based column number of the reported start location.
+     */
+    readonly column?: number;
+    /**
+     * The data used to fill the message template.
+     */
+    readonly data?: ReportDescriptorMessageData;
+    /**
+     * The 1-based column number of the reported end location.
+     */
+    readonly endColumn?: number;
+    /**
+     * The 1-based line number of the reported end location.
+     */
+    readonly endLine?: number;
+    /**
+     * The 1-based line number of the reported start location.
+     */
+    readonly line?: number;
+    /**
+     * Reported message ID.
+     */
+    readonly messageId: MessageIds;
+    /**
+     * Reported suggestions.
+     */
+    readonly suggestions?: readonly SuggestionOutput[] | null;
+    /**
+     * The type of the reported AST node.
+     */
+    readonly type?: AST_NODE_TYPES | AST_TOKEN_TYPES;
+}
+/**
+ * @param text a string describing the rule
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+export type RuleTesterTestFrameworkFunction = (text: string, callback: () => void) => void;
+/**
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+export interface RunTests {
+    readonly invalid: readonly InvalidTestCase[];
+    readonly valid: readonly (string | ValidTestCase)[];
+}
+/**
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+export interface RuleTesterConfig extends ClassicConfig.Config {
+    readonly parser: string;
+    readonly parserOptions?: Readonly;
+}
+/**
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+declare class RuleTesterBase {
+    /**
+     * Creates a new instance of RuleTester.
+     * @param testerConfig extra configuration for the tester
+     */
+    constructor(testerConfig?: RuleTesterConfig);
+    /**
+     * Adds a new rule test to execute.
+     * @param ruleName The name of the rule to run.
+     * @param rule The rule to test.
+     * @param tests The collection of tests to run.
+     */
+    run(ruleName: string, rule: RuleModule, tests: RunTests): void;
+    /**
+     * If you supply a value to this property, the rule tester will call this instead of using the version defined on
+     * the global namespace.
+     */
+    static get describe(): RuleTesterTestFrameworkFunction;
+    static set describe(value: RuleTesterTestFrameworkFunction | undefined);
+    /**
+     * If you supply a value to this property, the rule tester will call this instead of using the version defined on
+     * the global namespace.
+     */
+    static get it(): RuleTesterTestFrameworkFunction;
+    static set it(value: RuleTesterTestFrameworkFunction | undefined);
+    /**
+     * If you supply a value to this property, the rule tester will call this instead of using the version defined on
+     * the global namespace.
+     */
+    static get itOnly(): RuleTesterTestFrameworkFunction;
+    static set itOnly(value: RuleTesterTestFrameworkFunction | undefined);
+    /**
+     * Define a rule for one particular run of tests.
+     */
+    defineRule(name: string, rule: RuleCreateFunction | RuleModule): void;
+}
+declare const RuleTester_base: typeof RuleTesterBase;
+/**
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+export declare class RuleTester extends RuleTester_base {
+}
+export {};
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.js
new file mode 100644
index 0000000000000000000000000000000000000000..4ae6f2fc5e3617874f6aa2d2e7916d33fcf10fee
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/RuleTester.js
@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.RuleTester = void 0;
+/* eslint-disable @typescript-eslint/no-deprecated */
+const eslint_1 = require("eslint");
+/**
+ * @deprecated Use `@typescript-eslint/rule-tester` instead.
+ */
+class RuleTester extends eslint_1.RuleTester {
+}
+exports.RuleTester = RuleTester;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b6fd8654d64750adbb5742b7b57eeb741fc7047b
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.d.ts
@@ -0,0 +1,42 @@
+import * as scopeManager from '@typescript-eslint/scope-manager';
+export declare namespace Scope {
+    type ScopeManager = scopeManager.ScopeManager;
+    type Reference = scopeManager.Reference;
+    type Variable = scopeManager.ScopeVariable;
+    type Scope = scopeManager.Scope;
+    const ScopeType: typeof scopeManager.ScopeType;
+    type DefinitionType = scopeManager.Definition;
+    type Definition = scopeManager.Definition;
+    const DefinitionType: typeof scopeManager.DefinitionType;
+    namespace Definitions {
+        type CatchClauseDefinition = scopeManager.CatchClauseDefinition;
+        type ClassNameDefinition = scopeManager.ClassNameDefinition;
+        type FunctionNameDefinition = scopeManager.FunctionNameDefinition;
+        type ImplicitGlobalVariableDefinition = scopeManager.ImplicitGlobalVariableDefinition;
+        type ImportBindingDefinition = scopeManager.ImportBindingDefinition;
+        type ParameterDefinition = scopeManager.ParameterDefinition;
+        type TSEnumMemberDefinition = scopeManager.TSEnumMemberDefinition;
+        type TSEnumNameDefinition = scopeManager.TSEnumNameDefinition;
+        type TSModuleNameDefinition = scopeManager.TSModuleNameDefinition;
+        type TypeDefinition = scopeManager.TypeDefinition;
+        type VariableDefinition = scopeManager.VariableDefinition;
+    }
+    namespace Scopes {
+        type BlockScope = scopeManager.BlockScope;
+        type CatchScope = scopeManager.CatchScope;
+        type ClassScope = scopeManager.ClassScope;
+        type ConditionalTypeScope = scopeManager.ConditionalTypeScope;
+        type ForScope = scopeManager.ForScope;
+        type FunctionExpressionNameScope = scopeManager.FunctionExpressionNameScope;
+        type FunctionScope = scopeManager.FunctionScope;
+        type FunctionTypeScope = scopeManager.FunctionTypeScope;
+        type GlobalScope = scopeManager.GlobalScope;
+        type MappedTypeScope = scopeManager.MappedTypeScope;
+        type ModuleScope = scopeManager.ModuleScope;
+        type SwitchScope = scopeManager.SwitchScope;
+        type TSEnumScope = scopeManager.TSEnumScope;
+        type TSModuleScope = scopeManager.TSModuleScope;
+        type TypeScope = scopeManager.TypeScope;
+        type WithScope = scopeManager.WithScope;
+    }
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.js
new file mode 100644
index 0000000000000000000000000000000000000000..f87449c5a256fe8853be6b1d7184871aa065f67f
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/Scope.js
@@ -0,0 +1,43 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace */
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+    Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+    o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+    var ownKeys = function(o) {
+        ownKeys = Object.getOwnPropertyNames || function (o) {
+            var ar = [];
+            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+            return ar;
+        };
+        return ownKeys(o);
+    };
+    return function (mod) {
+        if (mod && mod.__esModule) return mod;
+        var result = {};
+        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+        __setModuleDefault(result, mod);
+        return result;
+    };
+})();
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.Scope = void 0;
+const scopeManager = __importStar(require("@typescript-eslint/scope-manager"));
+var Scope;
+(function (Scope) {
+    Scope.ScopeType = scopeManager.ScopeType;
+    Scope.DefinitionType = scopeManager.DefinitionType;
+})(Scope || (exports.Scope = Scope = {}));
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1b29f097fb17f55dc7b555d07d8a4eb2911e0c94
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.d.ts
@@ -0,0 +1,354 @@
+import type { ParserServices, TSESTree } from '../ts-estree';
+import type { Parser } from './Parser';
+import type { Scope } from './Scope';
+declare class TokenStore {
+    /**
+     * Checks whether any comments exist or not between the given 2 nodes.
+     * @param left The node to check.
+     * @param right The node to check.
+     * @returns `true` if one or more comments exist.
+     */
+    commentsExistBetween(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token): boolean;
+    /**
+     * Gets all comment tokens directly after the given node or token.
+     * @param nodeOrToken The AST node or token to check for adjacent comment tokens.
+     * @returns An array of comments in occurrence order.
+     */
+    getCommentsAfter(nodeOrToken: TSESTree.Node | TSESTree.Token): TSESTree.Comment[];
+    /**
+     * Gets all comment tokens directly before the given node or token.
+     * @param nodeOrToken The AST node or token to check for adjacent comment tokens.
+     * @returns An array of comments in occurrence order.
+     */
+    getCommentsBefore(nodeOrToken: TSESTree.Node | TSESTree.Token): TSESTree.Comment[];
+    /**
+     * Gets all comment tokens inside the given node.
+     * @param node The AST node to get the comments for.
+     * @returns An array of comments in occurrence order.
+     */
+    getCommentsInside(node: TSESTree.Node): TSESTree.Comment[];
+    /**
+     * Gets the first token of the given node.
+     * @param node The AST node.
+     * @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
+     * @returns An object representing the token.
+     */
+    getFirstToken(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions | null;
+    /**
+     * Gets the first token between two non-overlapping nodes.
+     * @param left Node before the desired token range.
+     * @param right Node after the desired token range.
+     * @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
+     * @returns An object representing the token.
+     */
+    getFirstTokenBetween(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions | null;
+    /**
+     * Gets the first `count` tokens of the given node.
+     * @param node The AST node.
+     * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
+     */
+    getFirstTokens(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions[];
+    /**
+     * Gets the first `count` tokens between two non-overlapping nodes.
+     * @param left Node before the desired token range.
+     * @param right Node after the desired token range.
+     * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
+     * @returns Tokens between left and right.
+     */
+    getFirstTokensBetween(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions[];
+    /**
+     * Gets the last token of the given node.
+     * @param node The AST node.
+     * @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
+     * @returns An object representing the token.
+     */
+    getLastToken(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions | null;
+    /**
+     * Gets the last token between two non-overlapping nodes.
+     * @param left Node before the desired token range.
+     * @param right Node after the desired token range.
+     * @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
+     * @returns An object representing the token.
+     */
+    getLastTokenBetween(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions | null;
+    /**
+     * Gets the last `count` tokens of the given node.
+     * @param node The AST node.
+     * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
+     */
+    getLastTokens(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions[];
+    /**
+     * Gets the last `count` tokens between two non-overlapping nodes.
+     * @param left Node before the desired token range.
+     * @param right Node after the desired token range.
+     * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
+     * @returns Tokens between left and right.
+     */
+    getLastTokensBetween(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions[];
+    /**
+     * Gets the token that follows a given node or token.
+     * @param node The AST node or token.
+     * @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
+     * @returns An object representing the token.
+     */
+    getTokenAfter(node: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions | null;
+    /**
+     * Gets the token that precedes a given node or token.
+     * @param node The AST node or token.
+     * @param options The option object
+     * @returns An object representing the token.
+     */
+    getTokenBefore(node: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions | null;
+    /**
+     * Gets the token starting at the specified index.
+     * @param offset Index of the start of the token's range.
+     * @param options The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
+     * @returns The token starting at index, or null if no such token.
+     */
+    getTokenByRangeStart(offset: number, options?: T): SourceCode.ReturnTypeFromOptions | null;
+    /**
+     * Gets all tokens that are related to the given node.
+     * @param node The AST node.
+     * @param beforeCount The number of tokens before the node to retrieve.
+     * @param afterCount The number of tokens after the node to retrieve.
+     * @returns Array of objects representing tokens.
+     */
+    getTokens(node: TSESTree.Node, beforeCount?: number, afterCount?: number): TSESTree.Token[];
+    /**
+     * Gets all tokens that are related to the given node.
+     * @param node The AST node.
+     * @param options The option object. If this is a function then it's `options.filter`.
+     * @returns Array of objects representing tokens.
+     */
+    getTokens(node: TSESTree.Node, options: T): SourceCode.ReturnTypeFromOptions[];
+    /**
+     * Gets the `count` tokens that follows a given node or token.
+     * @param node The AST node.
+     * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
+     */
+    getTokensAfter(node: TSESTree.Node | TSESTree.Token, options?: number | T): SourceCode.ReturnTypeFromOptions[];
+    /**
+     * Gets the `count` tokens that precedes a given node or token.
+     * @param node The AST node.
+     * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
+     */
+    getTokensBefore(node: TSESTree.Node | TSESTree.Token, options?: number | T): SourceCode.ReturnTypeFromOptions[];
+    /**
+     * Gets all of the tokens between two non-overlapping nodes.
+     * @param left Node before the desired token range.
+     * @param right Node after the desired token range.
+     * @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
+     * @returns Tokens between left and right.
+     */
+    getTokensBetween(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: number | T): SourceCode.ReturnTypeFromOptions[];
+}
+declare class SourceCodeBase extends TokenStore {
+    /**
+     * Represents parsed source code.
+     * @param ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
+     */
+    constructor(text: string, ast: SourceCode.Program);
+    /**
+     * Represents parsed source code.
+     * @param config The config object.
+     */
+    constructor(config: SourceCode.SourceCodeConfig);
+    /**
+     * The parsed AST for the source code.
+     */
+    ast: SourceCode.Program;
+    applyInlineConfig(): void;
+    applyLanguageOptions(): void;
+    finalize(): void;
+    /**
+     * Retrieves an array containing all comments in the source code.
+     * @returns An array of comment nodes.
+     */
+    getAllComments(): TSESTree.Comment[];
+    /**
+     * Converts a (line, column) pair into a range index.
+     * @param location A line/column location
+     * @returns The range index of the location in the file.
+     */
+    getIndexFromLoc(location: TSESTree.Position): number;
+    /**
+     * Gets the entire source text split into an array of lines.
+     * @returns The source text as an array of lines.
+     */
+    getLines(): string[];
+    /**
+     * Converts a source text index into a (line, column) pair.
+     * @param index The index of a character in a file
+     * @returns A {line, column} location object with a 0-indexed column
+     */
+    getLocFromIndex(index: number): TSESTree.Position;
+    /**
+     * Gets the deepest node containing a range index.
+     * @param index Range index of the desired node.
+     * @returns The node if found or `null` if not found.
+     */
+    getNodeByRangeIndex(index: number): TSESTree.Node | null;
+    /**
+     * Gets the source code for the given node.
+     * @param node The AST node to get the text for.
+     * @param beforeCount The number of characters before the node to retrieve.
+     * @param afterCount The number of characters after the node to retrieve.
+     * @returns The text representing the AST node.
+     */
+    getText(node?: TSESTree.Node | TSESTree.Token, beforeCount?: number, afterCount?: number): string;
+    /**
+     * The flag to indicate that the source code has Unicode BOM.
+     */
+    hasBOM: boolean;
+    /**
+     * Determines if two nodes or tokens have at least one whitespace character
+     * between them. Order does not matter. Returns false if the given nodes or
+     * tokens overlap.
+     * @param first The first node or token to check between.
+     * @param second The second node or token to check between.
+     * @returns True if there is a whitespace character between any of the tokens found between the two given nodes or tokens.
+     */
+    isSpaceBetween(first: TSESTree.Node | TSESTree.Token, second: TSESTree.Node | TSESTree.Token): boolean;
+    /**
+     * Determines if two nodes or tokens have at least one whitespace character
+     * between them. Order does not matter. Returns false if the given nodes or
+     * tokens overlap.
+     * For backward compatibility, this method returns true if there are
+     * `JSXText` tokens that contain whitespace between the two.
+     * @param first The first node or token to check between.
+     * @param second The second node or token to check between.
+     * @returns {boolean} True if there is a whitespace character between
+     * any of the tokens found between the two given nodes or tokens.
+     * @deprecated in favor of isSpaceBetween
+     */
+    isSpaceBetweenTokens(first: TSESTree.Token, second: TSESTree.Token): boolean;
+    /**
+     * Returns the scope of the given node.
+     * This information can be used track references to variables.
+     */
+    getScope(node: TSESTree.Node): Scope.Scope;
+    /**
+     * Returns an array of the ancestors of the given node, starting at
+     * the root of the AST and continuing through the direct parent of the current node.
+     * This array does not include the currently-traversed node itself.
+     */
+    getAncestors(node: TSESTree.Node): TSESTree.Node[];
+    /**
+     * Returns a list of variables declared by the given node.
+     * This information can be used to track references to variables.
+     */
+    getDeclaredVariables(node: TSESTree.Node): readonly Scope.Variable[];
+    /**
+     * Marks a variable with the given name in the current scope as used.
+     * This affects the no-unused-vars rule.
+     */
+    markVariableAsUsed(name: string, node: TSESTree.Node): boolean;
+    /**
+     * The source code split into lines according to ECMA-262 specification.
+     * This is done to avoid each rule needing to do so separately.
+     */
+    lines: string[];
+    /**
+     * The indexes in `text` that each line starts
+     */
+    lineStartIndices: number[];
+    /**
+     * The parser services of this source code.
+     */
+    parserServices?: Partial;
+    /**
+     * The scope of this source code.
+     */
+    scopeManager: Scope.ScopeManager | null;
+    /**
+     * The original text source code. BOM was stripped from this text.
+     */
+    text: string;
+    /**
+     * All of the tokens and comments in the AST.
+     *
+     * TODO: rename to 'tokens'
+     */
+    tokensAndComments: TSESTree.Token[];
+    /**
+     * The visitor keys to traverse AST.
+     */
+    visitorKeys: SourceCode.VisitorKeys;
+    /**
+     * Split the source code into multiple lines based on the line delimiters.
+     * @param text Source code as a string.
+     * @returns Array of source code lines.
+     */
+    static splitLines(text: string): string[];
+}
+declare namespace SourceCode {
+    interface Program extends TSESTree.Program {
+        comments: TSESTree.Comment[];
+        tokens: TSESTree.Token[];
+    }
+    interface SourceCodeConfig {
+        /**
+         * The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
+         */
+        ast: Program;
+        /**
+         * The parser services.
+         */
+        parserServices: ParserServices | null;
+        /**
+         * The scope of this source code.
+         */
+        scopeManager: Scope.ScopeManager | null;
+        /**
+         * The source code text.
+         */
+        text: string;
+        /**
+         * The visitor keys to traverse AST.
+         */
+        visitorKeys: VisitorKeys | null;
+    }
+    type VisitorKeys = Parser.VisitorKeys;
+    type FilterPredicate = (token: TSESTree.Token) => boolean;
+    type GetFilterPredicate = Filter extends ((token: TSESTree.Token) => token is infer U extends TSESTree.Token) ? U : Default;
+    type GetFilterPredicateFromOptions = Options extends {
+        filter?: FilterPredicate;
+    } ? GetFilterPredicate : GetFilterPredicate;
+    type ReturnTypeFromOptions = T extends {
+        includeComments: true;
+    } ? GetFilterPredicateFromOptions : GetFilterPredicateFromOptions>;
+    type CursorWithSkipOptions = number | FilterPredicate | {
+        /**
+         * The predicate function to choose tokens.
+         */
+        filter?: FilterPredicate;
+        /**
+         * The flag to iterate comments as well.
+         */
+        includeComments?: boolean;
+        /**
+         * The count of tokens the cursor skips.
+         */
+        skip?: number;
+    };
+    type CursorWithCountOptions = number | FilterPredicate | {
+        /**
+         * The maximum count of tokens the cursor iterates.
+         */
+        count?: number;
+        /**
+         * The predicate function to choose tokens.
+         */
+        filter?: FilterPredicate;
+        /**
+         * The flag to iterate comments as well.
+         */
+        includeComments?: boolean;
+    };
+}
+declare const SourceCode_base: typeof SourceCodeBase;
+declare class SourceCode extends SourceCode_base {
+}
+export { SourceCode };
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.js
new file mode 100644
index 0000000000000000000000000000000000000000..a776954013ad65939f5230b2a66b72ab4e40a137
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/SourceCode.js
@@ -0,0 +1,8 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace, no-restricted-syntax */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SourceCode = void 0;
+const eslint_1 = require("eslint");
+class SourceCode extends eslint_1.SourceCode {
+}
+exports.SourceCode = SourceCode;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3fd2f3fde714bf9125059d955170435f63ac38c5
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.d.ts
@@ -0,0 +1,381 @@
+import type { Linter } from '../Linter';
+import type { RuleMetaData } from '../Rule';
+export declare class ESLintBase> {
+    /**
+     * Creates a new instance of the main ESLint API.
+     * @param options The options for this instance.
+     */
+    constructor(options?: Options);
+    /**
+     * This method calculates the configuration for a given file, which can be useful for debugging purposes.
+     * - It resolves and merges extends and overrides settings into the top level configuration.
+     * - It resolves the parser setting to absolute paths.
+     * - It normalizes the plugins setting to align short names. (e.g., eslint-plugin-foo → foo)
+     * - It adds the processor setting if a legacy file extension processor is matched.
+     * - It doesn't interpret the env setting to the globals and parserOptions settings, so the result object contains
+     *   the env setting as is.
+     * @param filePath The path to the file whose configuration you would like to calculate. Directory paths are forbidden
+     *                 because ESLint cannot handle the overrides setting.
+     * @returns The promise that will be fulfilled with a configuration object.
+     */
+    calculateConfigForFile(filePath: string): Promise;
+    getRulesMetaForResults(results: LintResult[]): Record>>;
+    /**
+     * This method checks if a given file is ignored by your configuration.
+     * @param filePath The path to the file you want to check.
+     * @returns The promise that will be fulfilled with whether the file is ignored or not. If the file is ignored, then
+     *          it will return true.
+     */
+    isPathIgnored(filePath: string): Promise;
+    /**
+     * This method lints the files that match the glob patterns and then returns the results.
+     * @param patterns The lint target files. This can contain any of file paths, directory paths, and glob patterns.
+     * @returns The promise that will be fulfilled with an array of LintResult objects.
+     */
+    lintFiles(patterns: string | string[]): Promise;
+    /**
+     * This method lints the given source code text and then returns the results.
+     *
+     * By default, this method uses the configuration that applies to files in the current working directory (the cwd
+     * constructor option). If you want to use a different configuration, pass options.filePath, and ESLint will load the
+     * same configuration that eslint.lintFiles() would use for a file at options.filePath.
+     *
+     * If the options.filePath value is configured to be ignored, this method returns an empty array. If the
+     * options.warnIgnored option is set along with the options.filePath option, this method returns a LintResult object.
+     * In that case, the result may contain a warning that indicates the file was ignored.
+     * @param code The source code text to check.
+     * @returns The promise that will be fulfilled with an array of LintResult objects. This is an array (despite there
+     *          being only one lint result) in order to keep the interfaces between this and the eslint.lintFiles()
+     *          method similar.
+     */
+    lintText(code: string, options?: LintTextOptions): Promise;
+    /**
+     * This method loads a formatter. Formatters convert lint results to a human- or machine-readable string.
+     * @param name TThe path to the file you want to check.
+     * The following values are allowed:
+     * - undefined. In this case, loads the "stylish" built-in formatter.
+     * - A name of built-in formatters.
+     * - A name of third-party formatters. For examples:
+     * -- `foo` will load eslint-formatter-foo.
+     * -- `@foo` will load `@foo/eslint-formatter`.
+     * -- `@foo/bar` will load `@foo/eslint-formatter-bar`.
+     * - A path to the file that defines a formatter. The path must contain one or more path separators (/) in order to distinguish if it's a path or not. For example, start with ./.
+     * @returns The promise that will be fulfilled with a Formatter object.
+     */
+    loadFormatter(name?: string): Promise;
+    /**
+     * This method copies the given results and removes warnings. The returned value contains only errors.
+     * @param results The LintResult objects to filter.
+     * @returns The filtered LintResult objects.
+     */
+    static getErrorResults(results: LintResult): LintResult;
+    /**
+     * This method writes code modified by ESLint's autofix feature into its respective file. If any of the modified
+     * files don't exist, this method does nothing.
+     * @param results The LintResult objects to write.
+     * @returns The promise that will be fulfilled after all files are written.
+     */
+    static outputFixes(results: LintResult[]): Promise;
+    /**
+     * The version text.
+     */
+    static readonly version: string;
+    /**
+     * The type of configuration used by this class.
+     */
+    static readonly configType: Linter.ConfigTypeSpecifier;
+}
+export interface ESLintOptions {
+    /**
+     * If false is present, ESLint suppresses comment directives in source code.
+     * If this option is false, it overrides the noInlineConfig setting in your configurations.
+     * @default true
+     */
+    allowInlineConfig?: boolean;
+    /**
+     * Configuration object, extended by all configurations used with this instance.
+     * You can use this option to define the default settings that will be used if your configuration files don't
+     * configure it.
+     * @default null
+     */
+    baseConfig?: Config | null;
+    /**
+     * If `true` is present, the `eslint.lintFiles()` method caches lint results and uses it if each target file is not
+     * changed. Please mind that ESLint doesn't clear the cache when you upgrade ESLint plugins. In that case, you have
+     * to remove the cache file manually. The `eslint.lintText()` method doesn't use caches even if you pass the
+     * options.filePath to the method.
+     * @default false
+     */
+    cache?: boolean;
+    /**
+     * The eslint.lintFiles() method writes caches into this file.
+     * @default '.eslintcache'
+     */
+    cacheLocation?: string;
+    /**
+     * Strategy for the cache to use for detecting changed files.
+     * @default 'metadata'
+     */
+    cacheStrategy?: 'content' | 'metadata';
+    /**
+     * The working directory. This must be an absolute path.
+     * @default process.cwd()
+     */
+    cwd?: string;
+    /**
+     * Unless set to false, the `eslint.lintFiles()` method will throw an error when no target files are found.
+     * @default true
+     */
+    errorOnUnmatchedPattern?: boolean;
+    /**
+     * If `true` is present, the `eslint.lintFiles()` and `eslint.lintText()` methods work in autofix mode.
+     * If a predicate function is present, the methods pass each lint message to the function, then use only the
+     * lint messages for which the function returned true.
+     * @default false
+     */
+    fix?: boolean | ((message: LintMessage) => boolean);
+    /**
+     * The types of the rules that the `eslint.lintFiles()` and `eslint.lintText()` methods use for autofix.
+     * @default null
+     */
+    fixTypes?: ('directive' | 'problem' | 'suggestion')[] | null;
+    /**
+     * If false is present, the `eslint.lintFiles()` method doesn't interpret glob patterns.
+     * @default true
+     */
+    globInputPaths?: boolean;
+    /**
+     * Configuration object, overrides all configurations used with this instance.
+     * You can use this option to define the settings that will be used even if your configuration files configure it.
+     * @default null
+     */
+    overrideConfig?: Config | null;
+    /**
+     * When set to true, missing patterns cause the linting operation to short circuit and not report any failures.
+     * @default false
+     */
+    passOnNoPatterns?: boolean;
+    /**
+     * The plugin implementations that ESLint uses for the plugins setting of your configuration.
+     * This is a map-like object. Those keys are plugin IDs and each value is implementation.
+     * @default null
+     */
+    plugins?: Record | null;
+}
+export interface DeprecatedRuleInfo {
+    /**
+     *  The rule IDs that replace this deprecated rule.
+     */
+    replacedBy: string[];
+    /**
+     *  The rule ID.
+     */
+    ruleId: string;
+}
+/**
+ * The LintResult value is the information of the linting result of each file.
+ */
+export interface LintResult {
+    /**
+     * The number of errors. This includes fixable errors.
+     */
+    errorCount: number;
+    /**
+     * The number of fatal errors.
+     */
+    fatalErrorCount: number;
+    /**
+     * The absolute path to the file of this result. This is the string "" if the file path is unknown (when you
+     * didn't pass the options.filePath option to the eslint.lintText() method).
+     */
+    filePath: string;
+    /**
+     * The number of errors that can be fixed automatically by the fix constructor option.
+     */
+    fixableErrorCount: number;
+    /**
+     * The number of warnings that can be fixed automatically by the fix constructor option.
+     */
+    fixableWarningCount: number;
+    /**
+     * The array of LintMessage objects.
+     */
+    messages: LintMessage[];
+    /**
+     * The source code of the file that was linted, with as many fixes applied as possible.
+     */
+    output?: string;
+    /**
+     * The original source code text. This property is undefined if any messages didn't exist or the output
+     * property exists.
+     */
+    source?: string;
+    /**
+     * Timing information of the lint run.
+     * This exists if and only if the `--stats` CLI flag was added or the `stats: true`
+     * option was passed to the ESLint class
+     * @since 9.0.0
+     */
+    stats?: LintStats;
+    /**
+     * The array of SuppressedLintMessage objects.
+     */
+    suppressedMessages: SuppressedLintMessage[];
+    /**
+     * The information about the deprecated rules that were used to check this file.
+     */
+    usedDeprecatedRules: DeprecatedRuleInfo[];
+    /**
+     * The number of warnings. This includes fixable warnings.
+     */
+    warningCount: number;
+}
+export interface LintStats {
+    /**
+     * The number of times ESLint has applied at least one fix after linting.
+     */
+    fixPasses: number;
+    /**
+     * The times spent on (parsing, fixing, linting) a file, where the linting refers to the timing information for each rule.
+     */
+    times: {
+        passes: LintStatsTimePass[];
+    };
+}
+export interface LintStatsTimePass {
+    /**
+     * The total time that is spent on applying fixes to the code.
+     */
+    fix: LintStatsFixTime;
+    /**
+     * The total time that is spent when parsing a file.
+     */
+    parse: LintStatsParseTime;
+    /**
+     * The total time that is spent on a rule.
+     */
+    rules?: Record;
+    /**
+     * The cumulative total
+     */
+    total: number;
+}
+export interface LintStatsParseTime {
+    total: number;
+}
+export interface LintStatsRuleTime {
+    total: number;
+}
+export interface LintStatsFixTime {
+    total: number;
+}
+export interface LintTextOptions {
+    /**
+     * The path to the file of the source code text. If omitted, the result.filePath becomes the string "".
+     */
+    filePath?: string;
+    /**
+     * If true is present and the options.filePath is a file ESLint should ignore, this method returns a lint result
+     * contains a warning message.
+     */
+    warnIgnored?: boolean;
+}
+/**
+ * The LintMessage value is the information of each linting error.
+ */
+export interface LintMessage {
+    /**
+     * The 1-based column number of the begin point of this message.
+     */
+    column: number | undefined;
+    /**
+     * The 1-based column number of the end point of this message. This property is undefined if this message
+     * is not a range.
+     */
+    endColumn: number | undefined;
+    /**
+     * The 1-based line number of the end point of this message. This property is undefined if this
+     * message is not a range.
+     */
+    endLine: number | undefined;
+    /**
+     * `true` if this is a fatal error unrelated to a rule, like a parsing error.
+     */
+    fatal?: boolean | undefined;
+    /**
+     * The EditInfo object of autofix. This property is undefined if this message is not fixable.
+     */
+    fix: EditInfo | undefined;
+    /**
+     * The 1-based line number of the begin point of this message.
+     */
+    line: number | undefined;
+    /**
+     * The error message
+     */
+    message: string;
+    /**
+     * The rule name that generates this lint message. If this message is generated by the ESLint core rather than
+     * rules, this is null.
+     */
+    ruleId: string | null;
+    /**
+     * The severity of this message. 1 means warning and 2 means error.
+     */
+    severity: 1 | 2;
+    /**
+     * The list of suggestions. Each suggestion is the pair of a description and an EditInfo object to fix code. API
+     * users such as editor integrations can choose one of them to fix the problem of this message. This property is
+     * undefined if this message doesn't have any suggestions.
+     */
+    suggestions: {
+        desc: string;
+        fix: EditInfo;
+    }[] | undefined;
+}
+/**
+ * The SuppressedLintMessage value is the information of each suppressed linting error.
+ */
+export interface SuppressedLintMessage extends LintMessage {
+    /**
+     * The list of suppressions.
+     */
+    suppressions?: {
+        /**
+         * The free text description added after the `--` in the comment
+         */
+        justification: string;
+        /**
+         * Right now, this is always `directive`
+         */
+        kind: string;
+    }[];
+}
+/**
+ * The EditInfo value is information to edit text.
+ *
+ * This edit information means replacing the range of the range property by the text property value. It's like
+ * sourceCodeText.slice(0, edit.range[0]) + edit.text + sourceCodeText.slice(edit.range[1]). Therefore, it's an add
+ * if the range[0] and range[1] property values are the same value, and it's removal if the text property value is
+ * empty string.
+ */
+export interface EditInfo {
+    /**
+     * The pair of 0-based indices in source code text to remove.
+     */
+    range: [number, number];
+    /**
+     * The text to add.
+     */
+    text: string;
+}
+/**
+ * The Formatter value is the object to convert the LintResult objects to text.
+ */
+export interface Formatter {
+    /**
+     * The method to convert the LintResult objects to text.
+     * Promise return supported since 8.4.0
+     */
+    format(results: LintResult[]): string | Promise;
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/ESLintShared.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c5382c78fe358fb2aea69d9977ceb4c5d47bb39e
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.d.ts
@@ -0,0 +1,87 @@
+import type { FlatConfig } from '../Config';
+import type * as Shared from './ESLintShared';
+declare class FlatESLintBase extends Shared.ESLintBase {
+    static readonly configType: 'flat';
+    /**
+     * Returns a configuration object for the given file based on the CLI options.
+     * This is the same logic used by the ESLint CLI executable to determine
+     * configuration for each file it processes.
+     * @param filePath The path of the file to retrieve a config object for.
+     * @returns A configuration object for the file or `undefined` if there is no configuration data for the object.
+     */
+    calculateConfigForFile(filePath: string): Promise;
+    /**
+     * Finds the config file being used by this instance based on the options
+     * passed to the constructor.
+     * @returns The path to the config file being used or `undefined` if no config file is being used.
+     */
+    findConfigFile(): Promise;
+}
+declare const FlatESLint_base: typeof FlatESLintBase;
+/**
+ * The ESLint class is the primary class to use in Node.js applications.
+ * This class depends on the Node.js fs module and the file system, so you cannot use it in browsers.
+ *
+ * If you want to lint code on browsers, use the Linter class instead.
+ */
+export declare class FlatESLint extends FlatESLint_base {
+}
+export declare namespace FlatESLint {
+    interface ESLintOptions extends Shared.ESLintOptions {
+        /**
+         * If false is present, the eslint.lintFiles() method doesn't respect `ignorePatterns` ignorePatterns in your configuration.
+         * @default true
+         */
+        ignore?: boolean;
+        /**
+         * Ignore file patterns to use in addition to config ignores. These patterns are relative to cwd.
+         * @default null
+         */
+        ignorePatterns?: string[] | null;
+        /**
+         * The path to a configuration file. Overrides all configurations used with this instance.
+         * The options.overrideConfig option is applied after this option is applied.
+         *
+         * - When falsy, searches for default config file.
+         * - When `true`, does not do any config file lookup.
+         * - When a string, considered to be a config file name.
+         *
+         * @default false
+         */
+        overrideConfigFile?: boolean | string;
+        /**
+         * A predicate function that filters rules to be run.
+         * This function is called with an object containing `ruleId` and `severity`, and returns `true` if the rule should be run.
+         * @default () => true
+         */
+        ruleFilter?: RuleFilter;
+        /**
+         * When set to true, additional statistics are added to the lint results.
+         * @see {@link https://eslint.org/docs/latest/extend/stats}
+         * @default false
+         */
+        stats?: boolean;
+        /**
+         * Show warnings when the file list includes ignored files.
+         * @default true
+         */
+        warnIgnored?: boolean;
+    }
+    type DeprecatedRuleInfo = Shared.DeprecatedRuleInfo;
+    type EditInfo = Shared.EditInfo;
+    type Formatter = Shared.Formatter;
+    type LintMessage = Shared.LintMessage;
+    type LintResult = Shared.LintResult;
+    type LintStats = Shared.LintStats;
+    type LintStatsFixTime = Shared.LintStatsFixTime;
+    type LintStatsParseTime = Shared.LintStatsParseTime;
+    type LintStatsRuleTime = Shared.LintStatsRuleTime;
+    type LintStatsTimePass = Shared.LintStatsTimePass;
+    type LintTextOptions = Shared.LintTextOptions;
+    type SuppressedLintMessage = Shared.SuppressedLintMessage;
+    type RuleFilter = (rule: {
+        ruleId: string;
+        severity: number;
+    }) => boolean;
+}
+export {};
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.js
new file mode 100644
index 0000000000000000000000000000000000000000..d8b4d54e0e17f96a569e8ceedeb0e23b40c54b15
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/FlatESLint.js
@@ -0,0 +1,19 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+    return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.FlatESLint = void 0;
+/* eslint-disable @typescript-eslint/no-namespace */
+const eslint_1 = require("eslint");
+const use_at_your_own_risk_1 = __importDefault(require("eslint/use-at-your-own-risk"));
+/**
+ * The ESLint class is the primary class to use in Node.js applications.
+ * This class depends on the Node.js fs module and the file system, so you cannot use it in browsers.
+ *
+ * If you want to lint code on browsers, use the Linter class instead.
+ */
+class FlatESLint extends (use_at_your_own_risk_1.default.FlatESLint ??
+    eslint_1.ESLint) {
+}
+exports.FlatESLint = FlatESLint;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..782e5ad915347c860662f2a8db2d4214ebd6d085
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.d.ts
@@ -0,0 +1,72 @@
+import type { ClassicConfig } from '../Config';
+import type { Linter } from '../Linter';
+import type * as Shared from './ESLintShared';
+declare class LegacyESLintBase extends Shared.ESLintBase {
+    static readonly configType: 'eslintrc';
+}
+declare const LegacyESLint_base: typeof LegacyESLintBase;
+/**
+ * The ESLint class is the primary class to use in Node.js applications.
+ * This class depends on the Node.js fs module and the file system, so you cannot use it in browsers.
+ *
+ * If you want to lint code on browsers, use the Linter class instead.
+ */
+export declare class LegacyESLint extends LegacyESLint_base {
+}
+export declare namespace LegacyESLint {
+    interface ESLintOptions extends Shared.ESLintOptions {
+        /**
+         * If you pass directory paths to the eslint.lintFiles() method, ESLint checks the files in those directories that
+         * have the given extensions. For example, when passing the src/ directory and extensions is [".js", ".ts"], ESLint
+         * will lint *.js and *.ts files in src/. If extensions is null, ESLint checks *.js files and files that match
+         * overrides[].files patterns in your configuration.
+         * Note: This option only applies when you pass directory paths to the eslint.lintFiles() method.
+         * If you pass glob patterns, ESLint will lint all files matching the glob pattern regardless of extension.
+         */
+        extensions?: string[] | null;
+        /**
+         * If false is present, the eslint.lintFiles() method doesn't respect `.eslintignore` files in your configuration.
+         * @default true
+         */
+        ignore?: boolean;
+        /**
+         * The path to a file ESLint uses instead of `$CWD/.eslintignore`.
+         * If a path is present and the file doesn't exist, this constructor will throw an error.
+         */
+        ignorePath?: string;
+        /**
+         * The path to a configuration file, overrides all configurations used with this instance.
+         * The options.overrideConfig option is applied after this option is applied.
+         */
+        overrideConfigFile?: string | null;
+        /**
+         * The severity to report unused eslint-disable directives.
+         * If this option is a severity, it overrides the reportUnusedDisableDirectives setting in your configurations.
+         */
+        reportUnusedDisableDirectives?: Linter.SeverityString | null;
+        /**
+         * The path to a directory where plugins should be resolved from.
+         * If null is present, ESLint loads plugins from the location of the configuration file that contains the plugin
+         * setting.
+         * If a path is present, ESLint loads all plugins from there.
+         */
+        resolvePluginsRelativeTo?: string | null;
+        /**
+         * An array of paths to directories to load custom rules from.
+         */
+        rulePaths?: string[];
+        /**
+         * If false is present, ESLint doesn't load configuration files (.eslintrc.* files).
+         * Only the configuration of the constructor options is valid.
+         */
+        useEslintrc?: boolean;
+    }
+    type DeprecatedRuleInfo = Shared.DeprecatedRuleInfo;
+    type EditInfo = Shared.EditInfo;
+    type Formatter = Shared.Formatter;
+    type LintMessage = Shared.LintMessage;
+    type LintResult = Omit;
+    type LintTextOptions = Shared.LintTextOptions;
+    type SuppressedLintMessage = Shared.SuppressedLintMessage;
+}
+export {};
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.js
new file mode 100644
index 0000000000000000000000000000000000000000..83dfc2050a810071dfbe6d388e77a49a0635ea71
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/eslint/LegacyESLint.js
@@ -0,0 +1,36 @@
+"use strict";
+/* eslint-disable @typescript-eslint/no-namespace */
+var __importDefault = (this && this.__importDefault) || function (mod) {
+    return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.LegacyESLint = void 0;
+const eslint_1 = require("eslint");
+const use_at_your_own_risk_1 = __importDefault(require("eslint/use-at-your-own-risk"));
+function throwMissingLegacyESLintError() {
+    throw new Error('LegacyESLint is not available with the current version of ESLint.');
+}
+/* eslint-disable-next-line @typescript-eslint/no-extraneous-class */
+class MissingLegacyESLint {
+    static configType = 'eslintrc';
+    static version = eslint_1.ESLint.version;
+    constructor() {
+        throwMissingLegacyESLintError();
+    }
+    static getErrorResults() {
+        throwMissingLegacyESLintError();
+    }
+    static outputFixes() {
+        throwMissingLegacyESLintError();
+    }
+}
+/**
+ * The ESLint class is the primary class to use in Node.js applications.
+ * This class depends on the Node.js fs module and the file system, so you cannot use it in browsers.
+ *
+ * If you want to lint code on browsers, use the Linter class instead.
+ */
+class LegacyESLint extends (use_at_your_own_risk_1.default.LegacyESLint ??
+    MissingLegacyESLint) {
+}
+exports.LegacyESLint = LegacyESLint;
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..217b46dcbf7d9d5b0230b822509f646ca994d870
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.d.ts
@@ -0,0 +1,11 @@
+export * from './AST';
+export * from './Config';
+export * from './ESLint';
+export * from './Linter';
+export * from './Parser';
+export * from './ParserOptions';
+export * from './Processor';
+export * from './Rule';
+export * from './RuleTester';
+export * from './Scope';
+export * from './SourceCode';
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..7ee906ebc9783df75f78d62c0e0f6485be85c04c
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-eslint/index.js
@@ -0,0 +1,27 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (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 });
+__exportStar(require("./AST"), exports);
+__exportStar(require("./Config"), exports);
+__exportStar(require("./ESLint"), exports);
+__exportStar(require("./Linter"), exports);
+__exportStar(require("./Parser"), exports);
+__exportStar(require("./ParserOptions"), exports);
+__exportStar(require("./Processor"), exports);
+__exportStar(require("./Rule"), exports);
+__exportStar(require("./RuleTester"), exports);
+__exportStar(require("./Scope"), exports);
+__exportStar(require("./SourceCode"), exports);
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-estree.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-estree.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..341d90ec80f2eb6bf90eb4bff8cbb91ab07eb196
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-estree.d.ts
@@ -0,0 +1,3 @@
+export { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/types';
+export type { NodeWithParent } from '@typescript-eslint/types';
+export type { ParserServices, ParserServicesWithoutTypeInformation, ParserServicesWithTypeInformation, } from '@typescript-eslint/typescript-estree';
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-estree.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-estree.js
new file mode 100644
index 0000000000000000000000000000000000000000..ec9a4788d533a547ffe63a0e3338b6f8be795ea4
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-estree.js
@@ -0,0 +1,9 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.TSESTree = exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0;
+// for convenience's sake - export the types directly from here so consumers
+// don't need to reference/install both packages in their code
+var types_1 = require("@typescript-eslint/types");
+Object.defineProperty(exports, "AST_NODE_TYPES", { enumerable: true, get: function () { return types_1.AST_NODE_TYPES; } });
+Object.defineProperty(exports, "AST_TOKEN_TYPES", { enumerable: true, get: function () { return types_1.AST_TOKEN_TYPES; } });
+Object.defineProperty(exports, "TSESTree", { enumerable: true, get: function () { return types_1.TSESTree; } });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..39a5a0fae38d9ec96255dc28b99730e61e0d27d4
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.d.ts
@@ -0,0 +1,9 @@
+/**
+ * We could use NoInfer typescript build-in utility
+ * introduced in typescript 5.4, however at the moment of creation
+ * the supported ts versions are >=4.8.4 <5.7.0
+ * so for the moment we have to stick to this polyfill.
+ *
+ * @see https://github.com/millsp/ts-toolbelt/blob/master/sources/Function/NoInfer.ts
+ */
+export type NoInfer = [A][A extends unknown ? 0 : never];
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/NoInfer.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/index.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..58ea1fcd4cdcbb3b07d83fe644eda50ec87d34a9
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/index.d.ts
@@ -0,0 +1,2 @@
+export * from './isArray';
+export * from './NoInfer';
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/index.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..aa68bbb7fedea0edb45ddd975d06cc5b773c22a7
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/index.js
@@ -0,0 +1,18 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+    if (k2 === undefined) k2 = k;
+    var desc = Object.getOwnPropertyDescriptor(m, k);
+    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+      desc = { enumerable: true, get: function() { return m[k]; } };
+    }
+    Object.defineProperty(o, k2, desc);
+}) : (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 });
+__exportStar(require("./isArray"), exports);
+__exportStar(require("./NoInfer"), exports);
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.d.ts b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b32b9ce8a5193b06f46b1ac0b2105f215c26b50e
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.d.ts
@@ -0,0 +1 @@
+export declare function isArray(arg: unknown): arg is readonly unknown[];
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.js b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.js
new file mode 100644
index 0000000000000000000000000000000000000000..7deedcf72bf69dc9da84940fe75056cf26a4e847
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/dist/ts-utils/isArray.js
@@ -0,0 +1,7 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.isArray = isArray;
+// https://github.com/microsoft/TypeScript/issues/17002
+function isArray(arg) {
+    return Array.isArray(arg);
+}
diff --git a/tools/ui/node_modules/@typescript-eslint/utils/package.json b/tools/ui/node_modules/@typescript-eslint/utils/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..127e2cab49b5e0166f708bc2f781279c3defa3a9
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/utils/package.json
@@ -0,0 +1,115 @@
+{
+  "name": "@typescript-eslint/utils",
+  "version": "8.60.1",
+  "description": "Utilities for working with TypeScript + ESLint together",
+  "files": [
+    "dist",
+    "!**/*.tsbuildinfo",
+    "package.json",
+    "README.md",
+    "LICENSE"
+  ],
+  "type": "commonjs",
+  "exports": {
+    ".": {
+      "types": "./dist/index.d.ts",
+      "default": "./dist/index.js"
+    },
+    "./ast-utils": {
+      "types": "./dist/ast-utils/index.d.ts",
+      "default": "./dist/ast-utils/index.js"
+    },
+    "./eslint-utils": {
+      "types": "./dist/eslint-utils/index.d.ts",
+      "default": "./dist/eslint-utils/index.js"
+    },
+    "./json-schema": {
+      "types": "./dist/json-schema.d.ts",
+      "default": "./dist/json-schema.js"
+    },
+    "./ts-eslint": {
+      "types": "./dist/ts-eslint/index.d.ts",
+      "default": "./dist/ts-eslint/index.js"
+    },
+    "./package.json": "./package.json"
+  },
+  "types": "./dist/index.d.ts",
+  "engines": {
+    "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/typescript-eslint/typescript-eslint.git",
+    "directory": "packages/utils"
+  },
+  "bugs": {
+    "url": "https://github.com/typescript-eslint/typescript-eslint/issues"
+  },
+  "homepage": "https://typescript-eslint.io/packages/utils",
+  "license": "MIT",
+  "keywords": [
+    "eslint",
+    "typescript",
+    "estree"
+  ],
+  "dependencies": {
+    "@eslint-community/eslint-utils": "^4.9.1",
+    "@typescript-eslint/types": "8.60.1",
+    "@typescript-eslint/scope-manager": "8.60.1",
+    "@typescript-eslint/typescript-estree": "8.60.1"
+  },
+  "peerDependencies": {
+    "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
+    "typescript": ">=4.8.4 <6.1.0"
+  },
+  "devDependencies": {
+    "@typescript/native-preview": "7.0.0-dev.20260518.1",
+    "@vitest/coverage-v8": "^4.0.18",
+    "eslint": "^10.0.0",
+    "rimraf": "^5.0.10",
+    "typescript": ">=4.8.4 <6.1.0",
+    "vitest": "^4.0.18"
+  },
+  "funding": {
+    "type": "opencollective",
+    "url": "https://opencollective.com/typescript-eslint"
+  },
+  "nx": {
+    "name": "utils",
+    "includedScripts": [
+      "clean"
+    ],
+    "targets": {
+      "lint": {
+        "command": "eslint"
+      },
+      "typecheck": {
+        "outputs": [
+          "{workspaceRoot}/dist",
+          "{projectRoot}/dist"
+        ]
+      },
+      "typecheck:tsgo": {
+        "outputs": [
+          "{workspaceRoot}/dist",
+          "{projectRoot}/dist"
+        ]
+      },
+      "test": {
+        "dependsOn": [
+          "^build",
+          "typecheck"
+        ]
+      }
+    }
+  },
+  "scripts": {
+    "build": "pnpm exec nx build",
+    "clean": "rimraf dist/ coverage/",
+    "format": "pnpm -w run format",
+    "lint": "pnpm -w exec nx lint",
+    "test": "pnpm -w exec nx test",
+    "typecheck": "pnpm -w exec nx typecheck",
+    "typecheck:tsgo": "pnpm -w exec nx typecheck:tsgo"
+  }
+}
\ No newline at end of file
diff --git a/tools/ui/node_modules/@typescript-eslint/visitor-keys/LICENSE b/tools/ui/node_modules/@typescript-eslint/visitor-keys/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..a1164108d4d6037cb976384c16e5493917d87157
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/visitor-keys/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 typescript-eslint and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/tools/ui/node_modules/@typescript-eslint/visitor-keys/README.md b/tools/ui/node_modules/@typescript-eslint/visitor-keys/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..1745172a6f20c5d2b170a561d50c4c46966796bd
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/visitor-keys/README.md
@@ -0,0 +1,10 @@
+# `@typescript-eslint/visitor-keys`
+
+> Visitor keys used to help traverse the TypeScript-ESTree AST.
+
+## ✋ Internal Package
+
+This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint).
+You likely don't want to use it directly.
+
+👉 See **https://typescript-eslint.io** for docs on typescript-eslint.
diff --git a/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts b/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..57df29524793761e4878ffff7616a670bededd4a
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.d.ts
@@ -0,0 +1,2 @@
+import type { TSESTree } from '@typescript-eslint/types';
+export declare const getKeys: (node: TSESTree.Node) => readonly string[];
diff --git a/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js b/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js
new file mode 100644
index 0000000000000000000000000000000000000000..58c14a5aa465e27f93fa4b01cd70f946a4475a28
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/get-keys.js
@@ -0,0 +1,5 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.getKeys = void 0;
+const eslint_visitor_keys_1 = require("eslint-visitor-keys");
+exports.getKeys = eslint_visitor_keys_1.getKeys;
diff --git a/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts b/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..29cb09b54586b9f8c35611e9c0ba86cb2fc9a3ff
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/index.d.ts
@@ -0,0 +1,2 @@
+export { getKeys } from './get-keys';
+export { visitorKeys, type VisitorKeys } from './visitor-keys';
diff --git a/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/index.js b/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..b86a328413a6c686494e4fc64f869110ef8220cd
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/index.js
@@ -0,0 +1,7 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.visitorKeys = exports.getKeys = void 0;
+var get_keys_1 = require("./get-keys");
+Object.defineProperty(exports, "getKeys", { enumerable: true, get: function () { return get_keys_1.getKeys; } });
+var visitor_keys_1 = require("./visitor-keys");
+Object.defineProperty(exports, "visitorKeys", { enumerable: true, get: function () { return visitor_keys_1.visitorKeys; } });
diff --git a/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts b/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f911750a814c9edd8947827233b656a7d9c1eadd
--- /dev/null
+++ b/tools/ui/node_modules/@typescript-eslint/visitor-keys/dist/visitor-keys.d.ts
@@ -0,0 +1,2 @@
+export type VisitorKeys = Record;
+export declare const visitorKeys: VisitorKeys;