@rdjperron/lint 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["isConstAssertion","isEmptyObjectExpression","isNode","typeReferenceName","typeReferenceName","variableDeclarator","importedName","typeReferenceName"],"sources":["../src/anti-slop/shared/array-method.ts","../src/anti-slop/rules/no-array-filter-map.ts","../src/anti-slop/rules/no-chained-type-assertions.ts","../src/anti-slop/rules/no-conditional-empty-object-spread.ts","../src/anti-slop/shared/lexical-type-parameters.ts","../src/anti-slop/shared/type-alias-resolution.ts","../src/anti-slop/shared/dictionary-types.ts","../src/anti-slop/shared/function-parameters.ts","../src/anti-slop/shared/scope.ts","../src/anti-slop/rules/no-known-value-widening.ts","../src/anti-slop/rules/no-module-mocking.ts","../src/anti-slop/rules/no-object-parameters.ts","../src/anti-slop/rules/no-reduce-accumulator-copy.ts","../src/anti-slop/shared/reflect-method.ts","../src/anti-slop/rules/no-reflect-apply.ts","../src/anti-slop/rules/no-reflect-get.ts","../src/anti-slop/rules/no-runtime-typeof.ts","../src/anti-slop/rules/no-shape-in-symbol-names.ts","../src/anti-slop/rules/no-unknown-parameters.ts","../src/anti-slop/rules/no-unknown-returns.ts","../src/anti-slop/rules/no-unknown-type-aliases.ts","../src/anti-slop/rules/no-unsafe-dictionary-type.ts","../src/anti-slop/rules/no-widen-then-assert.ts","../src/anti-slop/rules/require-safety-comment-for-type-assertion.ts","../src/shared/rule-options.ts","../src/rules/no-hardcoded-jsx-text.ts","../src/rules/no-use-effect.ts","../src/rules/static-public-env.ts","../src/index.ts"],"sourcesContent":["import type { ESTree, Scope, SourceCode, Variable } from \"@oxlint/plugins\";\n\n/** Unwrap syntax-only wrappers when inspecting array methods and accumulator references. */\nexport function unwrapArrayExpression(node: ESTree.Node): ESTree.Node {\n while (\n node.type === \"ParenthesizedExpression\" ||\n node.type === \"ChainExpression\" ||\n node.type === \"TSAsExpression\" ||\n node.type === \"TSTypeAssertion\" ||\n node.type === \"TSNonNullExpression\" ||\n node.type === \"TSSatisfiesExpression\"\n ) {\n node = node.expression;\n }\n return node;\n}\n\n/** Resolve a local binding by scope, not by identifier spelling. */\nexport function resolveArrayBinding(sourceCode: SourceCode, node: ESTree.Node): Variable | null {\n node = unwrapArrayExpression(node);\n if (node.type !== \"Identifier\") return null;\n let scope: Scope | null = sourceCode.getScope(node);\n while (scope !== null) {\n const variable = scope.set.get(node.name);\n if (variable !== undefined) return variable;\n scope = scope.upper;\n }\n return null;\n}\n\n/** Read static method names, including computed string literals, without evaluating expressions. */\nexport function arrayMethodTarget(\n node: ESTree.Node,\n): { readonly name: string; readonly object: ESTree.Node } | null {\n node = unwrapArrayExpression(node);\n if (node.type !== \"MemberExpression\") return null;\n const property = node.property;\n if (!node.computed && property.type === \"Identifier\") {\n return { name: property.name, object: node.object };\n }\n if (node.computed && property.type === \"Literal\" && typeof property.value === \"string\") {\n return { name: property.value, object: node.object };\n }\n return null;\n}\n\nfunction isArrayAnnotation(type: ESTree.TSType): boolean {\n if (type.type === \"TSArrayType\" || type.type === \"TSTupleType\") return true;\n if (type.type === \"TSParenthesizedType\") return isArrayAnnotation(type.typeAnnotation);\n if (type.type === \"TSTypeOperator\" && type.operator === \"readonly\") {\n return isArrayAnnotation(type.typeAnnotation);\n }\n return (\n type.type === \"TSTypeReference\" && type.typeName.type === \"Identifier\" &&\n (type.typeName.name === \"Array\" || type.typeName.name === \"ReadonlyArray\")\n );\n}\n\n/** Recognize local array evidence; unknown receivers and iterator pipelines are deliberately excluded. */\nexport function isKnownArrayExpression(\n sourceCode: SourceCode,\n node: ESTree.Node,\n visited = new Set<Variable>(),\n): boolean {\n node = unwrapArrayExpression(node);\n if (node.type === \"ArrayExpression\") return true;\n if (node.type === \"CallExpression\") {\n const method = arrayMethodTarget(node.callee);\n return (\n method !== null &&\n [\"map\", \"filter\", \"flatMap\", \"slice\", \"concat\", \"toSorted\", \"toReversed\", \"toSpliced\"].includes(method.name) &&\n isKnownArrayExpression(sourceCode, method.object, visited)\n );\n }\n if (node.type !== \"Identifier\") return false;\n const variable = resolveArrayBinding(sourceCode, node);\n if (variable === null || visited.has(variable)) return false;\n visited.add(variable);\n if (variable.references.some(reference => reference.isWrite() && !reference.init)) return false;\n for (const identifier of variable.identifiers) {\n const annotation = identifier.typeAnnotation?.typeAnnotation;\n if (annotation !== undefined) return isArrayAnnotation(annotation);\n }\n for (const definition of variable.defs) {\n if (\n definition.type === \"Variable\" && definition.node.type === \"VariableDeclarator\" &&\n definition.node.id.type === \"Identifier\" && definition.node.init !== null &&\n definition.node.parent.type === \"VariableDeclaration\" && definition.node.parent.kind === \"const\"\n ) {\n return isKnownArrayExpression(sourceCode, definition.node.init, visited);\n }\n }\n return false;\n}\n","// Two adjacent passes walk the data twice and allocate an array nobody reads, and a reviewer has\n// to hold both callbacks in mind to see what one pass would have produced. Nothing needs an\n// exception: `flatMap` and a plain loop both satisfy the rule, so fix the call instead of scoping\n// it off.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport { arrayMethodTarget, isKnownArrayExpression, unwrapArrayExpression } from \"../shared/array-method.ts\";\n\n/** Reject eager array filter/map pipelines; lazy iterator helpers remain allowed. */\nexport const noArrayFilterMapRule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: { description: \"Disallow adjacent array filter/map passes in favor of lazy iterator helpers or a single transformation.\" },\n messages: {\n arrayFilterMap: \"Avoid consecutive array `{{first}}` and `{{second}}` passes. Prefer `.values().{{first}}(...).{{second}}(...).toArray()` where iterator helpers are supported, or a single `flatMap`/mutating reducer. Preserve callback ordering, indexes, and filtering semantics.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const outer = arrayMethodTarget(node.callee);\n if (outer === null || (outer.name !== \"map\" && outer.name !== \"filter\")) return;\n const innerCall = unwrapArrayExpression(outer.object);\n if (innerCall.type !== \"CallExpression\") return;\n const inner = arrayMethodTarget(innerCall.callee);\n if (inner === null || inner.name !== (outer.name === \"map\" ? \"filter\" : \"map\")) return;\n if (!isKnownArrayExpression(context.sourceCode, inner.object)) return;\n context.report({ node, messageId: \"arrayFilterMap\", data: { first: inner.name, second: outer.name } });\n },\n };\n },\n});\n","// `input as unknown as User` exists to make the compiler stop objecting. The first assertion\n// throws away what the value was, the second invents what it now is, and nothing checked the value\n// in between. Nothing legitimate needs a chain, so drop the laundering step and let the\n// safety-comment rule ask what the remaining assertion knows.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree } from \"@oxlint/plugins\";\n\ntype TypeAssertionExpression = ESTree.TSAsExpression | ESTree.TSTypeAssertion;\n\nfunction isTypeAssertionExpression(node: ESTree.Node): node is TypeAssertionExpression {\n return node.type === \"TSAsExpression\" || node.type === \"TSTypeAssertion\";\n}\n\nfunction unwrapParenthesizedExpression(expression: ESTree.Expression): ESTree.Expression {\n let current = expression;\n while (current.type === \"ParenthesizedExpression\") {\n current = current.expression;\n }\n return current;\n}\n\nfunction isConstAssertion(node: TypeAssertionExpression): boolean {\n const { typeAnnotation } = node;\n return (\n typeAnnotation.type === \"TSTypeReference\" &&\n typeAnnotation.typeName.type === \"Identifier\" &&\n typeAnnotation.typeName.name === \"const\"\n );\n}\n\nfunction isOutermostAssertionInChain(node: TypeAssertionExpression): boolean {\n let current: ESTree.Expression = node;\n let parent = node.parent;\n\n while (parent.type === \"ParenthesizedExpression\" && parent.expression === current) {\n current = parent;\n parent = parent.parent;\n }\n\n return !isTypeAssertionExpression(parent) || parent.expression !== current;\n}\n\nfunction isForbiddenAssertionChain(node: TypeAssertionExpression): boolean {\n let assertionCount = 0;\n let hasNonConstAssertion = false;\n let current: ESTree.Expression = node;\n\n while (isTypeAssertionExpression(current)) {\n assertionCount += 1;\n hasNonConstAssertion ||= !isConstAssertion(current);\n current = unwrapParenthesizedExpression(current.expression);\n }\n\n return assertionCount > 1 && hasNonConstAssertion;\n}\n\n/** Disallow nested TypeScript type assertions, while permitting chains made only of const assertions. */\nexport const noChainedTypeAssertionsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow chained TypeScript as and angle-bracket assertions, including parenthesized chains.\",\n },\n messages: {\n chained:\n \"This assertion chain discards type evidence. Keep the original precise type, or parse untrusted input at its boundary before narrowing it.\",\n },\n },\n createOnce(context) {\n const checkTypeAssertion = (node: TypeAssertionExpression) => {\n if (!isOutermostAssertionInChain(node) || !isForbiddenAssertionChain(node)) return;\n context.report({ node, messageId: \"chained\" });\n };\n\n return {\n TSAsExpression: checkTypeAssertion,\n TSTypeAssertion: checkTypeAssertion,\n };\n },\n});\n","// `...(value !== undefined ? { value } : {})` is how a field becomes optional without anyone\n// saying so: the object's keys can be read only by evaluating the conditional. Nothing needs it\n// off, since building the object in statements states the omission where a reader looks for it.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree } from \"@oxlint/plugins\";\n\nfunction unwrapParentheses(node: ESTree.Expression): ESTree.Expression {\n let current = node;\n while (current.type === \"ParenthesizedExpression\") {\n current = current.expression;\n }\n return current;\n}\n\nfunction isEmptyObjectExpression(node: ESTree.Expression): boolean {\n return node.type === \"ObjectExpression\" && node.properties.length === 0;\n}\n\nfunction isConditionalEmptyObjectSpread(node: ESTree.Expression): boolean {\n const conditional = unwrapParentheses(node);\n return (\n conditional.type === \"ConditionalExpression\" &&\n (isEmptyObjectExpression(conditional.consequent) ||\n isEmptyObjectExpression(conditional.alternate))\n );\n}\n\n/** Ban conditional empty-object spreads without changing their omission semantics. */\nexport const noConditionalEmptyObjectSpreadRule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow object spreads that conditionally spread an empty object to omit fields.\",\n },\n messages: {\n avoid:\n \"This conditional spread hides property omission behind an empty object. Build the object in separate statements and add the property only when present.\",\n },\n },\n createOnce(context) {\n return {\n SpreadElement(node) {\n if (node.parent.type !== \"ObjectExpression\") return;\n\n if (isConditionalEmptyObjectSpread(node.argument)) {\n context.report({ node, messageId: \"avoid\" });\n }\n },\n };\n },\n});\n","import type { ESTree } from \"@oxlint/plugins\";\n\ntype VisitorKeys = Readonly<Record<string, readonly string[]>>;\n\nfunction isNode(value: unknown): value is ESTree.Node {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"type\" in value &&\n\t\ttypeof value.type === \"string\"\n\t);\n}\n\nfunction collectInferTypeParameterNames(\n\tnode: ESTree.Node,\n\tvisitorKeys: VisitorKeys,\n\tnames: Set<string>,\n): void {\n\tif (node.type === \"TSInferType\") names.add(node.typeParameter.name.name);\n\tconst record = node as unknown as Readonly<Record<string, unknown>>;\n\tfor (const key of visitorKeys[node.type] ?? []) {\n\t\tconst value = record[key];\n\t\tif (isNode(value)) {\n\t\t\tcollectInferTypeParameterNames(value, visitorKeys, names);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!Array.isArray(value)) continue;\n\t\tfor (const child of value) {\n\t\t\tif (isNode(child)) collectInferTypeParameterNames(child, visitorKeys, names);\n\t\t}\n\t}\n}\n\n/** Collect type binders that are in scope at a node and can shadow module aliases. */\nexport function lexicalTypeParameterNames(\n\tnode: ESTree.Node,\n\tvisitorKeys: VisitorKeys,\n): ReadonlySet<string> {\n\tconst names = new Set<string>();\n\tlet descendant: ESTree.Node = node;\n\tlet current: ESTree.Node | null = node;\n\twhile (current !== null && current.type !== \"Program\") {\n\t\tif (\"typeParameters\" in current) {\n\t\t\tfor (const parameter of current.typeParameters?.params ?? []) {\n\t\t\t\tnames.add(parameter.name.name);\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tcurrent.type === \"TSMappedType\" &&\n\t\t\t(descendant === current.nameType || descendant === current.typeAnnotation)\n\t\t) {\n\t\t\tnames.add(current.key.name);\n\t\t}\n\t\tif (current.type === \"TSConditionalType\" && descendant === current.trueType) {\n\t\t\tcollectInferTypeParameterNames(current.extendsType, visitorKeys, names);\n\t\t}\n\t\tdescendant = current;\n\t\tcurrent = current.parent;\n\t}\n\treturn names;\n}\n","import type { ESTree } from \"@oxlint/plugins\";\n\nimport { lexicalTypeParameterNames } from \"./lexical-type-parameters.ts\";\n\ntype VisitorKeys = Readonly<Record<string, readonly string[]>>;\ntype TypeScope = ESTree.Node;\n\ntype TypeBinding = {\n\treadonly alias: ESTree.TSTypeAliasDeclaration | null;\n\treadonly name: string;\n\treadonly scope: TypeScope;\n};\n\ntype Substitution = {\n\treadonly substitutions: Substitutions;\n\treadonly type: ESTree.TSType;\n};\n\ntype Substitutions = ReadonlyMap<string, Substitution>;\n\nexport type TypeAliasEnvironment = {\n\treadonly aliases: readonly ESTree.TSTypeAliasDeclaration[];\n\treadonly bindingsByName: ReadonlyMap<string, readonly TypeBinding[]>;\n\treadonly visitorKeys: VisitorKeys;\n};\n\nexport type ResolvedTypeMatcher = (\n\ttype: ESTree.TSType,\n\tmatches: (child: ESTree.TSType) => boolean,\n) => boolean;\n\nconst environmentsByProgram = new WeakMap<ESTree.Program, TypeAliasEnvironment>();\n\nfunction isNode(value: unknown): value is ESTree.Node {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"type\" in value &&\n\t\ttypeof value.type === \"string\"\n\t);\n}\n\nfunction enclosingTypeScope(node: ESTree.Node): TypeScope {\n\tlet current: ESTree.Node | null = node.parent;\n\twhile (current !== null) {\n\t\tif (\n\t\t\tcurrent.type === \"Program\" ||\n\t\t\tcurrent.type === \"BlockStatement\" ||\n\t\t\tcurrent.type === \"TSModuleBlock\" ||\n\t\t\tcurrent.type === \"StaticBlock\" ||\n\t\t\tcurrent.type === \"SwitchStatement\"\n\t\t) {\n\t\t\treturn current;\n\t\t}\n\t\tcurrent = current.parent;\n\t}\n\treturn node;\n}\n\nfunction declaredTypeBinding(node: ESTree.Node): {\n\treadonly alias: ESTree.TSTypeAliasDeclaration | null;\n\treadonly name: string;\n} | null {\n\tif (node.type === \"TSTypeAliasDeclaration\") {\n\t\treturn { alias: node, name: node.id.name };\n\t}\n\tif (\n\t\tnode.type === \"TSInterfaceDeclaration\" ||\n\t\tnode.type === \"TSEnumDeclaration\" ||\n\t\tnode.type === \"ClassDeclaration\" ||\n\t\tnode.type === \"ClassExpression\"\n\t) {\n\t\treturn node.id === null ? null : { alias: null, name: node.id.name };\n\t}\n\tif (\n\t\tnode.type === \"ImportSpecifier\" ||\n\t\tnode.type === \"ImportDefaultSpecifier\" ||\n\t\tnode.type === \"ImportNamespaceSpecifier\"\n\t) {\n\t\treturn { alias: null, name: node.local.name };\n\t}\n\treturn null;\n}\n\nfunction collectTypeBindings(\n\tnode: ESTree.Node,\n\tvisitorKeys: VisitorKeys,\n\tbindingsByName: Map<string, TypeBinding[]>,\n\taliases: ESTree.TSTypeAliasDeclaration[],\n): void {\n\tconst declared = declaredTypeBinding(node);\n\tif (declared !== null) {\n\t\tconst bindings = bindingsByName.get(declared.name) ?? [];\n\t\tbindings.push({ ...declared, scope: enclosingTypeScope(node) });\n\t\tbindingsByName.set(declared.name, bindings);\n\t\tif (declared.alias !== null) aliases.push(declared.alias);\n\t}\n\n\t// SAFETY: Oxlint's visitor keys identify only ESTree child-node properties.\n\tconst fields = node as unknown as Readonly<Record<string, unknown>>;\n\tfor (const key of visitorKeys[node.type] ?? []) {\n\t\tconst value = fields[key];\n\t\tif (isNode(value)) {\n\t\t\tcollectTypeBindings(value, visitorKeys, bindingsByName, aliases);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!Array.isArray(value)) continue;\n\t\tfor (const child of value) {\n\t\t\tif (isNode(child)) {\n\t\t\t\tcollectTypeBindings(child, visitorKeys, bindingsByName, aliases);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Collect every lexical type alias and competing type binding in a program. */\nexport function createTypeAliasEnvironment(\n\tprogram: ESTree.Program,\n\tvisitorKeys: VisitorKeys,\n): TypeAliasEnvironment {\n\tconst cached = environmentsByProgram.get(program);\n\tif (cached !== undefined) return cached;\n\tconst bindingsByName = new Map<string, TypeBinding[]>();\n\tconst aliases: ESTree.TSTypeAliasDeclaration[] = [];\n\tcollectTypeBindings(program, visitorKeys, bindingsByName, aliases);\n\tconst environment = { aliases, bindingsByName, visitorKeys };\n\tenvironmentsByProgram.set(program, environment);\n\treturn environment;\n}\n\nfunction ancestorDistance(ancestor: ESTree.Node, node: ESTree.Node): number | null {\n\tlet current: ESTree.Node | null = node;\n\tlet distance = 0;\n\twhile (current !== null) {\n\t\tif (current === ancestor) return distance;\n\t\tcurrent = current.parent;\n\t\tdistance += 1;\n\t}\n\treturn null;\n}\n\nfunction nearestTypeBindings(\n\tname: string,\n\tuse: ESTree.Node,\n\tenvironment: TypeAliasEnvironment,\n): readonly TypeBinding[] {\n\tconst candidates = environment.bindingsByName.get(name) ?? [];\n\tlet nearestDistance = Number.POSITIVE_INFINITY;\n\tlet nearest: TypeBinding[] = [];\n\tfor (const candidate of candidates) {\n\t\tconst distance = ancestorDistance(candidate.scope, use);\n\t\tif (distance === null || distance > nearestDistance) continue;\n\t\tif (distance === nearestDistance) {\n\t\t\tnearest.push(candidate);\n\t\t\tcontinue;\n\t\t}\n\t\tnearestDistance = distance;\n\t\tnearest = [candidate];\n\t}\n\treturn nearest;\n}\n\n/** Resolve the nearest visible alias with this name, respecting lexical shadowing. */\nexport function visibleTypeAlias(\n\tname: string,\n\tuse: ESTree.Node,\n\tenvironment: TypeAliasEnvironment,\n): ESTree.TSTypeAliasDeclaration | null {\n\tif (lexicalTypeParameterNames(use, environment.visitorKeys).has(name)) return null;\n\tconst bindings = nearestTypeBindings(name, use, environment);\n\treturn bindings.length === 1 ? (bindings[0]?.alias ?? null) : null;\n}\n\n/** Return whether a local declaration shadows a built-in type at this use. */\nexport function hasVisibleTypeBinding(\n\tname: string,\n\tuse: ESTree.Node,\n\tenvironment: TypeAliasEnvironment,\n): boolean {\n\treturn (\n\t\tlexicalTypeParameterNames(use, environment.visitorKeys).has(name) ||\n\t\tnearestTypeBindings(name, use, environment).length > 0\n\t);\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n\treturn type.typeName.type === \"Identifier\" ? type.typeName.name : null;\n}\n\nfunction aliasSubstitutions(\n\talias: ESTree.TSTypeAliasDeclaration,\n\treference: ESTree.TSTypeReference,\n\tbase: Substitutions,\n): Substitutions | null {\n\tconst parameters = alias.typeParameters?.params ?? [];\n\tconst arguments_ = reference.typeArguments?.params ?? [];\n\tconst next = new Map(base);\n\tfor (const [index, parameter] of parameters.entries()) {\n\t\tconst explicitArgument = arguments_[index];\n\t\tconst argument = explicitArgument ?? parameter.default;\n\t\tif (argument === null || argument === undefined) return null;\n\t\tconst argumentSubstitutions = explicitArgument === undefined ? next : base;\n\t\tnext.set(parameter.name.name, {\n\t\t\ttype: argument,\n\t\t\tsubstitutions: new Map(argumentSubstitutions),\n\t\t});\n\t}\n\treturn next;\n}\n\n/** Match a type after resolving visible aliases and substituting their type parameters. */\nexport function resolvedTypeMatches(\n\ttype: ESTree.TSType,\n\tenvironment: TypeAliasEnvironment,\n\tmatcher: ResolvedTypeMatcher,\n): boolean {\n\tconst evaluate = (\n\t\tcurrent: ESTree.TSType,\n\t\tsubstitutions: Substitutions,\n\t\tresolvingAliases: ReadonlySet<ESTree.TSTypeAliasDeclaration>,\n\t): boolean => {\n\t\tif (current.type === \"TSTypeReference\") {\n\t\t\tconst name = typeReferenceName(current);\n\t\t\tif (name !== null) {\n\t\t\t\tconst substitution = substitutions.get(name);\n\t\t\t\tif (substitution !== undefined && !current.typeArguments?.params.length) {\n\t\t\t\t\treturn evaluate(\n\t\t\t\t\t\tsubstitution.type,\n\t\t\t\t\t\tsubstitution.substitutions,\n\t\t\t\t\t\tresolvingAliases,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst alias = visibleTypeAlias(name, current, environment);\n\t\t\t\tif (alias !== null && !resolvingAliases.has(alias)) {\n\t\t\t\t\tconst nextSubstitutions = aliasSubstitutions(alias, current, substitutions);\n\t\t\t\t\tif (nextSubstitutions !== null) {\n\t\t\t\t\t\tconst nextResolving = new Set(resolvingAliases);\n\t\t\t\t\t\tnextResolving.add(alias);\n\t\t\t\t\t\treturn evaluate(alias.typeAnnotation, nextSubstitutions, nextResolving);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn matcher(current, (child) =>\n\t\t\tevaluate(child, substitutions, resolvingAliases),\n\t\t);\n\t};\n\n\treturn evaluate(type, new Map(), new Set());\n}\n","import type { ESTree } from \"@oxlint/plugins\";\n\nimport {\n\tcreateTypeAliasEnvironment,\n\thasVisibleTypeBinding,\n\tvisibleTypeAlias,\n\ttype TypeAliasEnvironment as LexicalTypeAliasEnvironment,\n} from \"./type-alias-resolution.ts\";\n\nconst BUILT_INS = new Set([\n\t\"Record\",\n\t\"Readonly\",\n\t\"Partial\",\n\t\"Required\",\n\t\"Pick\",\n\t\"Omit\",\n\t\"PropertyKey\",\n\t\"NonNullable\",\n]);\nconst TRANSPARENT_WRAPPERS = new Set([\"Readonly\", \"Partial\", \"Required\", \"NonNullable\"]);\n\ntype TypeAliasEnvironment = ReadonlyMap<string, ESTree.TSType>;\n\ntype ResolvedType = {\n\treadonly type: ESTree.TSType;\n\treadonly substitutions: TypeAliasEnvironment;\n};\n\nexport type UnsafeDictionary = {\n\treadonly kind: \"unsafe-dictionary\";\n\treadonly unsafeValue: \"any\" | \"empty-object\" | \"object\" | \"union\" | \"unknown\";\n};\n\nexport type WideningTargetKind =\n\t| \"anonymous object\"\n\t| \"generic container\"\n\t| \"object\"\n\t| \"open dictionary\"\n\t| \"unknown\";\n\nexport type WideningTarget = {\n\treadonly kind: WideningTargetKind;\n};\n\nexport type TypeEnvironment = {\n\treadonly interfaces: ReadonlyMap<string, readonly ESTree.TSInterfaceDeclaration[]>;\n\treadonly typeAliases: LexicalTypeAliasEnvironment;\n};\n\nfunction declaredStatement(statement: ESTree.Statement): ESTree.Node | null {\n\treturn statement.type === \"ExportNamedDeclaration\" ||\n\t\tstatement.type === \"ExportDefaultDeclaration\"\n\t\t? (statement.declaration ?? null)\n\t\t: statement;\n}\n\nexport function createTypeEnvironment(\n\tprogram: ESTree.Program,\n\tvisitorKeys: Readonly<Record<string, readonly string[]>>,\n): TypeEnvironment {\n\tconst interfaces = new Map<string, ESTree.TSInterfaceDeclaration[]>();\n\n\tfor (const statement of program.body) {\n\t\tconst declaration = declaredStatement(statement);\n\t\tif (declaration?.type !== \"TSInterfaceDeclaration\") continue;\n\t\tconst declarations = interfaces.get(declaration.id.name) ?? [];\n\t\tdeclarations.push(declaration);\n\t\tinterfaces.set(declaration.id.name, declarations);\n\t}\n\n\treturn {\n\t\tinterfaces,\n\t\ttypeAliases: createTypeAliasEnvironment(program, visitorKeys),\n\t};\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n\treturn type.typeName.type === \"Identifier\" ? type.typeName.name : null;\n}\n\nfunction isBuiltIn(\n\tname: string,\n\tuse: ESTree.Node,\n\tenvironment: TypeEnvironment,\n): boolean {\n\treturn (\n\t\tBUILT_INS.has(name) &&\n\t\t!hasVisibleTypeBinding(name, use, environment.typeAliases)\n\t);\n}\n\nfunction isUnappliedReferenceTo(type: ESTree.TSType, name: string): boolean {\n\tconst unwrapped = unwrapTransparentType(type);\n\treturn (\n\t\tunwrapped.type === \"TSTypeReference\" &&\n\t\ttypeReferenceName(unwrapped) === name &&\n\t\t(unwrapped.typeArguments === null ||\n\t\t\tunwrapped.typeArguments === undefined ||\n\t\t\tunwrapped.typeArguments.params.length === 0)\n\t);\n}\n\nfunction unwrapTransparentType(type: ESTree.TSType): ESTree.TSType {\n\tlet current = type;\n\twhile (\n\t\tcurrent.type === \"TSParenthesizedType\" ||\n\t\t(current.type === \"TSTypeOperator\" && current.operator === \"readonly\")\n\t) {\n\t\tcurrent = current.typeAnnotation;\n\t}\n\treturn current;\n}\n\nfunction isNeverType(type: ESTree.TSType): boolean {\n\treturn unwrapTransparentType(type).type === \"TSNeverKeyword\";\n}\n\nfunction isEffectivelyEmptyMember(member: ESTree.TSSignature): boolean {\n\treturn (\n\t\tmember.type === \"TSPropertySignature\" &&\n\t\tmember.optional === true &&\n\t\tmember.typeAnnotation !== null &&\n\t\tmember.typeAnnotation !== undefined &&\n\t\tisNeverType(member.typeAnnotation.typeAnnotation)\n\t);\n}\n\nfunction isEffectivelyEmptyTypeLiteral(type: ESTree.TSTypeLiteral): boolean {\n\treturn type.members.length === 0 || type.members.every(isEffectivelyEmptyMember);\n}\n\nfunction isEffectivelyEmptyInterface(\n\tdeclarations: readonly ESTree.TSInterfaceDeclaration[],\n): boolean {\n\tif (declarations.length !== 1) return false;\n\tconst [type] = declarations;\n\treturn (\n\t\ttype !== undefined &&\n\t\ttype.extends.length === 0 &&\n\t\t(type.body.body.length === 0 || type.body.body.every(isEffectivelyEmptyMember))\n\t);\n}\n\nfunction resolvedSubstitutionArgument(\n\ttype: ESTree.TSType,\n\tbase: TypeAliasEnvironment,\n\tresolving: ReadonlySet<string> = new Set(),\n): ESTree.TSType {\n\tconst unwrapped = unwrapTransparentType(type);\n\tif (unwrapped.type !== \"TSTypeReference\") return type;\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null || resolving.has(name)) return type;\n\tconst substitution = base.get(name);\n\tif (substitution === undefined) return type;\n\tconst nextResolving = new Set(resolving);\n\tnextResolving.add(name);\n\treturn resolvedSubstitutionArgument(substitution, base, nextResolving);\n}\n\nfunction aliasSubstitution(\n\talias: ESTree.TSTypeAliasDeclaration,\n\ttype: ESTree.TSTypeReference,\n\tbase: TypeAliasEnvironment,\n): TypeAliasEnvironment | null {\n\tconst parameters = alias.typeParameters?.params ?? [];\n\tconst arguments_ = type.typeArguments?.params ?? [];\n\tconst next = new Map(base);\n\tfor (const [index, parameter] of parameters.entries()) {\n\t\tconst argument = arguments_[index] ?? parameter.default;\n\t\tif (argument === null || argument === undefined) return null;\n\t\tnext.set(parameter.name.name, resolvedSubstitutionArgument(argument, next));\n\t}\n\treturn next;\n}\n\nfunction unsafeDirectValue(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n\tsubstitutions: TypeAliasEnvironment,\n\tresolvingAliases: ReadonlySet<string>,\n): UnsafeDictionary[\"unsafeValue\"] | null {\n\tconst unwrapped = unwrapTransparentType(type);\n\tif (unwrapped.type === \"TSUnknownKeyword\") return \"unknown\";\n\tif (unwrapped.type === \"TSAnyKeyword\") return \"any\";\n\tif (unwrapped.type === \"TSObjectKeyword\") return \"object\";\n\tif (unwrapped.type === \"TSTypeLiteral\" && isEffectivelyEmptyTypeLiteral(unwrapped))\n\t\treturn \"empty-object\";\n\tif (unwrapped.type === \"TSUnionType\") {\n\t\treturn unwrapped.types.some(\n\t\t\t(member) => unsafeDirectValue(member, environment, substitutions, resolvingAliases) !== null,\n\t\t)\n\t\t\t? \"union\"\n\t\t\t: null;\n\t}\n\tif (unwrapped.type === \"TSIntersectionType\") {\n\t\tconst unsafeMembers = unwrapped.types.map((member) =>\n\t\t\tunsafeDirectValue(member, environment, substitutions, resolvingAliases),\n\t\t);\n\t\tif (unsafeMembers.includes(\"any\")) return \"any\";\n\t\treturn unsafeMembers.length > 0 && unsafeMembers.every((member) => member !== null)\n\t\t\t? unsafeMembers[0]\n\t\t\t: null;\n\t}\n\tif (unwrapped.type !== \"TSTypeReference\") return null;\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null) return null;\n\tif (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst wrapped = unwrapped.typeArguments?.params[0];\n\t\treturn wrapped === undefined\n\t\t\t? null\n\t\t\t: unsafeDirectValue(wrapped, environment, substitutions, resolvingAliases);\n\t}\n\tconst substitution = substitutions.get(name);\n\tif (substitution !== undefined) {\n\t\treturn isUnappliedReferenceTo(substitution, name)\n\t\t\t? null\n\t\t\t: unsafeDirectValue(substitution, environment, substitutions, resolvingAliases);\n\t}\n\tconst interfaceDeclarations = environment.interfaces.get(name);\n\tif (interfaceDeclarations !== undefined) {\n\t\treturn isEffectivelyEmptyInterface(interfaceDeclarations) ? \"empty-object\" : null;\n\t}\n\tconst alias = visibleTypeAlias(name, unwrapped, environment.typeAliases);\n\tif (alias === null || resolvingAliases.has(name)) return null;\n\tconst nextSubstitutions = aliasSubstitution(alias, unwrapped, substitutions);\n\tif (nextSubstitutions === null) return null;\n\tconst nextResolving = new Set(resolvingAliases);\n\tnextResolving.add(name);\n\treturn unsafeDirectValue(alias.typeAnnotation, environment, nextSubstitutions, nextResolving);\n}\n\nfunction dictionaryValueTypes(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n\tsubstitutions: TypeAliasEnvironment,\n\tresolvingAliases: ReadonlySet<string>,\n): readonly ResolvedType[] {\n\tconst unwrapped = unwrapTransparentType(type);\n\n\tif (unwrapped.type === \"TSTypeLiteral\") {\n\t\treturn unwrapped.members.flatMap((member): readonly ResolvedType[] =>\n\t\t\tmember.type === \"TSIndexSignature\" && member.typeAnnotation !== null\n\t\t\t\t? [{ type: member.typeAnnotation.typeAnnotation, substitutions }]\n\t\t\t\t: [],\n\t\t);\n\t}\n\n\tif (unwrapped.type === \"TSMappedType\") {\n\t\treturn unwrapped.typeAnnotation === null\n\t\t\t? []\n\t\t\t: [{ type: unwrapped.typeAnnotation, substitutions }];\n\t}\n\n\tif (unwrapped.type !== \"TSTypeReference\") return [];\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null) return [];\n\n\tconst substitution = substitutions.get(name);\n\tif (substitution !== undefined) {\n\t\treturn isUnappliedReferenceTo(substitution, name)\n\t\t\t? []\n\t\t\t: dictionaryValueTypes(substitution, environment, substitutions, resolvingAliases);\n\t}\n\n\tif (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst wrapped = unwrapped.typeArguments?.params[0];\n\t\treturn wrapped === undefined\n\t\t\t? []\n\t\t\t: dictionaryValueTypes(wrapped, environment, substitutions, resolvingAliases);\n\t}\n\n\tif (name === \"Record\" && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst value = unwrapped.typeArguments?.params[1] ?? null;\n\t\treturn value === null ? [] : [{ type: value, substitutions }];\n\t}\n\n\tif (\n\t\t(name === \"Pick\" || name === \"Omit\") &&\n\t\tisBuiltIn(name, unwrapped, environment)\n\t) {\n\t\tconst source = unwrapped.typeArguments?.params[0];\n\t\treturn source === undefined\n\t\t\t? []\n\t\t\t: dictionaryValueTypes(source, environment, substitutions, resolvingAliases);\n\t}\n\n\tconst alias = visibleTypeAlias(name, unwrapped, environment.typeAliases);\n\tif (alias === null || resolvingAliases.has(name)) return [];\n\tconst nextSubstitutions = aliasSubstitution(alias, unwrapped, substitutions);\n\tif (nextSubstitutions === null) return [];\n\tconst nextResolving = new Set(resolvingAliases);\n\tnextResolving.add(name);\n\treturn dictionaryValueTypes(alias.typeAnnotation, environment, nextSubstitutions, nextResolving);\n}\n\nexport function classifyUnsafeDictionaryValue(\n\tvalueType: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n): UnsafeDictionary | null {\n\tconst unsafeValue = unsafeDirectValue(valueType, environment, new Map(), new Set());\n\treturn unsafeValue === null ? null : { kind: \"unsafe-dictionary\", unsafeValue };\n}\n\nexport function classifyUnsafeDictionary(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n): UnsafeDictionary | null {\n\tfor (const valueType of dictionaryValueTypes(type, environment, new Map(), new Set())) {\n\t\tconst unsafeValue = unsafeDirectValue(\n\t\t\tvalueType.type,\n\t\t\tenvironment,\n\t\t\tvalueType.substitutions,\n\t\t\tnew Set(),\n\t\t);\n\t\tif (unsafeValue !== null) return { kind: \"unsafe-dictionary\", unsafeValue };\n\t}\n\treturn null;\n}\n\nexport function classifyWideningTarget(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n): WideningTarget | null {\n\tconst unwrapped = unwrapTransparentType(type);\n\tif (unwrapped.type === \"TSUnknownKeyword\") return { kind: \"unknown\" };\n\tif (unwrapped.type === \"TSObjectKeyword\") return { kind: \"object\" };\n\tif (unwrapped.type === \"TSTypeLiteral\") {\n\t\treturn unwrapped.members.some((member) => member.type === \"TSIndexSignature\")\n\t\t\t? { kind: \"open dictionary\" }\n\t\t\t: unwrapped.members.length > 0\n\t\t\t\t? { kind: \"anonymous object\" }\n\t\t\t\t: null;\n\t}\n\tif (unwrapped.type === \"TSMappedType\") return { kind: \"open dictionary\" };\n\tif (unwrapped.type !== \"TSTypeReference\") return null;\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null) return null;\n\tif (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst wrapped = unwrapped.typeArguments?.params[0];\n\t\treturn wrapped === undefined ? null : classifyWideningTarget(wrapped, environment);\n\t}\n\tif (name === \"Record\" && isBuiltIn(name, unwrapped, environment)) {\n\t\treturn hasBroadRecordKey(unwrapped, environment, new Map())\n\t\t\t? { kind: \"open dictionary\" }\n\t\t\t: null;\n\t}\n\tconst alias = visibleTypeAlias(name, unwrapped, environment.typeAliases);\n\tif (alias === null) return null;\n\tif ((alias.typeParameters?.params.length ?? 0) > 0) {\n\t\tconst substitutions = aliasSubstitution(alias, unwrapped, new Map());\n\t\tconst resolved =\n\t\t\tsubstitutions === null\n\t\t\t\t? null\n\t\t\t\t: classifyAliasBroadTarget(\n\t\t\t\t\t\talias.typeAnnotation,\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tsubstitutions,\n\t\t\t\t\t\tnew Set([name]),\n\t\t\t\t\t);\n\t\treturn resolved?.kind === \"open dictionary\" ? { kind: \"generic container\" } : null;\n\t}\n\tconst substitutions = aliasSubstitution(alias, unwrapped, new Map());\n\tif (substitutions === null) return null;\n\tconst resolved = classifyAliasBroadTarget(\n\t\talias.typeAnnotation,\n\t\tenvironment,\n\t\tsubstitutions,\n\t\tnew Set([name]),\n\t);\n\treturn resolved;\n}\n\nfunction hasBroadRecordKey(\n\ttype: ESTree.TSTypeReference,\n\tenvironment: TypeEnvironment,\n\tsubstitutions: TypeAliasEnvironment,\n): boolean {\n\tconst key = type.typeArguments?.params[0];\n\treturn key === undefined || isBroadMappedKey(key, environment, substitutions);\n}\n\nfunction isBroadMappedKey(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n\tsubstitutions: TypeAliasEnvironment,\n\tvisitedAliases: ReadonlySet<string> = new Set(),\n): boolean {\n\tconst unwrapped = unwrapTransparentType(type);\n\tif (\n\t\tunwrapped.type === \"TSStringKeyword\" ||\n\t\tunwrapped.type === \"TSNumberKeyword\" ||\n\t\tunwrapped.type === \"TSSymbolKeyword\"\n\t) {\n\t\treturn true;\n\t}\n\tif (unwrapped.type === \"TSUnionType\") {\n\t\treturn unwrapped.types.some((member) =>\n\t\t\tisBroadMappedKey(member, environment, substitutions, visitedAliases),\n\t\t);\n\t}\n\tif (unwrapped.type !== \"TSTypeReference\") return false;\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null) return false;\n\tconst substitution = substitutions.get(name);\n\tif (substitution !== undefined && !isUnappliedReferenceTo(substitution, name)) {\n\t\treturn isBroadMappedKey(substitution, environment, substitutions, visitedAliases);\n\t}\n\tif (name === \"PropertyKey\" && isBuiltIn(name, unwrapped, environment)) return true;\n\tconst alias = visibleTypeAlias(name, unwrapped, environment.typeAliases);\n\tif (\n\t\talias === null ||\n\t\t(alias.typeParameters?.params.length ?? 0) > 0 ||\n\t\tvisitedAliases.has(name)\n\t) {\n\t\treturn false;\n\t}\n\tconst nextVisited = new Set(visitedAliases);\n\tnextVisited.add(name);\n\treturn isBroadMappedKey(alias.typeAnnotation, environment, substitutions, nextVisited);\n}\n\nfunction classifyAliasBroadTarget(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n\tsubstitutions: TypeAliasEnvironment,\n\tresolvingAliases: ReadonlySet<string>,\n): WideningTarget | null {\n\tconst unwrapped = unwrapTransparentType(type);\n\tif (unwrapped.type === \"TSUnknownKeyword\") return { kind: \"unknown\" };\n\tif (unwrapped.type === \"TSObjectKeyword\") return { kind: \"object\" };\n\tif (unwrapped.type === \"TSTypeLiteral\") {\n\t\treturn unwrapped.members.some((member) => member.type === \"TSIndexSignature\")\n\t\t\t? { kind: \"open dictionary\" }\n\t\t\t: null;\n\t}\n\tif (unwrapped.type === \"TSMappedType\") {\n\t\treturn isBroadMappedKey(unwrapped.constraint, environment, substitutions)\n\t\t\t? { kind: \"open dictionary\" }\n\t\t\t: null;\n\t}\n\tif (unwrapped.type !== \"TSTypeReference\") return null;\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null) return null;\n\tconst substitution = substitutions.get(name);\n\tif (substitution !== undefined) {\n\t\treturn isUnappliedReferenceTo(substitution, name)\n\t\t\t? null\n\t\t\t: classifyAliasBroadTarget(\n\t\t\t\t\tsubstitution,\n\t\t\t\t\tenvironment,\n\t\t\t\t\tsubstitutions,\n\t\t\t\t\tresolvingAliases,\n\t\t\t\t);\n\t}\n\tif (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst wrapped = unwrapped.typeArguments?.params[0];\n\t\treturn wrapped === undefined\n\t\t\t? null\n\t\t\t: classifyAliasBroadTarget(wrapped, environment, substitutions, resolvingAliases);\n\t}\n\tif (name === \"Record\" && isBuiltIn(name, unwrapped, environment)) {\n\t\treturn hasBroadRecordKey(unwrapped, environment, substitutions)\n\t\t\t? { kind: \"open dictionary\" }\n\t\t\t: null;\n\t}\n\tconst alias = visibleTypeAlias(name, unwrapped, environment.typeAliases);\n\tif (alias === null || resolvingAliases.has(name)) return null;\n\tconst nextSubstitutions = aliasSubstitution(alias, unwrapped, substitutions);\n\tif (nextSubstitutions === null) return null;\n\tconst nextResolving = new Set(resolvingAliases);\n\tnextResolving.add(name);\n\treturn classifyAliasBroadTarget(\n\t\talias.typeAnnotation,\n\t\tenvironment,\n\t\tnextSubstitutions,\n\t\tnextResolving,\n\t);\n}\n\nexport function isPopulatedObjectExpression(expression: ESTree.Expression): boolean {\n\tlet current = expression;\n\twhile (\n\t\tcurrent.type === \"ParenthesizedExpression\" ||\n\t\tcurrent.type === \"TSAsExpression\" ||\n\t\tcurrent.type === \"TSTypeAssertion\" ||\n\t\tcurrent.type === \"TSNonNullExpression\"\n\t) {\n\t\tcurrent = current.expression;\n\t}\n\treturn current.type === \"ObjectExpression\" && current.properties.length > 0;\n}\n\nexport function isKnownEvidenceExpression(expression: ESTree.Expression): boolean {\n\tlet current = expression;\n\twhile (\n\t\tcurrent.type === \"ParenthesizedExpression\" ||\n\t\tcurrent.type === \"TSAsExpression\" ||\n\t\tcurrent.type === \"TSTypeAssertion\" ||\n\t\tcurrent.type === \"TSNonNullExpression\" ||\n\t\tcurrent.type === \"TSSatisfiesExpression\"\n\t) {\n\t\tcurrent = current.expression;\n\t}\n\tif (current.type === \"ObjectExpression\") return true;\n\treturn (\n\t\tcurrent.type === \"ArrayExpression\" ||\n\t\tcurrent.type === \"ArrowFunctionExpression\" ||\n\t\tcurrent.type === \"ClassExpression\" ||\n\t\tcurrent.type === \"FunctionExpression\" ||\n\t\tcurrent.type === \"NewExpression\" ||\n\t\tcurrent.type === \"Literal\" ||\n\t\tcurrent.type === \"TemplateLiteral\" ||\n\t\tcurrent.type === \"UnaryExpression\"\n\t);\n}\n","import type { ESTree, SourceCode } from \"@oxlint/plugins\";\n\nexport type FunctionParameter = ESTree.ParamPattern;\n\n/** Return whether a type is or contains TypeScript's absorbing unknown top type. */\nexport function containsUnknownType(type: ESTree.TSType): boolean {\n\tif (type.type === \"TSUnknownKeyword\") return true;\n\tif (type.type === \"TSParenthesizedType\") return containsUnknownType(type.typeAnnotation);\n\treturn type.type === \"TSUnionType\" && type.types.some(containsUnknownType);\n}\n\n/** Return the TypeScript annotation attached to a function parameter or its wrapped binding. */\nexport function functionParameterTypeAnnotation(\n\tparameter: FunctionParameter,\n): ESTree.TSTypeAnnotation | null | undefined {\n\tif (parameter.type === \"TSParameterProperty\") {\n\t\treturn functionParameterTypeAnnotation(parameter.parameter);\n\t}\n\tif (parameter.type === \"RestElement\") {\n\t\treturn parameter.typeAnnotation ?? functionParameterTypeAnnotation(parameter.argument);\n\t}\n\tif (parameter.type === \"AssignmentPattern\") {\n\t\treturn parameter.typeAnnotation ?? functionParameterTypeAnnotation(parameter.left);\n\t}\n\treturn parameter.typeAnnotation;\n}\n\n/** Return only a function parameter's local binding, excluding its annotation and default value. */\nexport function functionParameterBindingName(\n\tparameter: FunctionParameter,\n\tsourceCode: SourceCode,\n): string {\n\tif (parameter.type === \"TSParameterProperty\") {\n\t\treturn functionParameterBindingName(parameter.parameter, sourceCode);\n\t}\n\tif (parameter.type === \"AssignmentPattern\") {\n\t\treturn functionParameterBindingName(parameter.left, sourceCode);\n\t}\n\tif (parameter.type === \"RestElement\") {\n\t\treturn functionParameterBindingName(parameter.argument, sourceCode);\n\t}\n\tif (parameter.type === \"Identifier\") return parameter.name;\n\n\tconst sourceText = sourceCode.getText(parameter);\n\tconst annotationStart = parameter.typeAnnotation?.start;\n\treturn annotationStart === undefined\n\t\t? sourceText\n\t\t: sourceText.slice(0, annotationStart - parameter.start).trimEnd();\n}\n","import type { ESTree, Scope, SourceCode, Variable } from \"@oxlint/plugins\";\n\n/** Resolve an identifier to its binding by walking lexical scopes upward. */\nexport function resolveVariable(\n\tsourceCode: SourceCode,\n\tidentifier: ESTree.IdentifierReference,\n): Variable | null {\n\tlet scope: Scope | null = sourceCode.getScope(identifier);\n\twhile (scope !== null) {\n\t\tconst variable = scope.set.get(identifier.name);\n\t\tif (variable !== undefined) return variable;\n\t\tscope = scope.upper;\n\t}\n\treturn null;\n}\n","// Annotating a literal whose keys are right there as `Record<string, Command>` makes the compiler\n// forget which keys exist, so `commands.strat` type checks. The annotation looks like extra rigour\n// and is the opposite. Nothing measured has needed it off: `satisfies` and a named interface cover\n// the annotate-for-safety habit.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport {\n\tclassifyUnsafeDictionaryValue,\n\tclassifyWideningTarget,\n\tcreateTypeEnvironment,\n\tisKnownEvidenceExpression,\n\ttype TypeEnvironment,\n\ttype WideningTarget,\n} from \"../shared/dictionary-types.ts\";\nimport {\n\tcontainsUnknownType,\n\tfunctionParameterBindingName,\n\tfunctionParameterTypeAnnotation,\n} from \"../shared/function-parameters.ts\";\nimport { resolveVariable } from \"../shared/scope.ts\";\n\nimport type { ESTree, SourceCode, Variable } from \"@oxlint/plugins\";\n\ntype FunctionExpression = ESTree.ArrowFunctionExpression | ESTree.Function;\n\nfunction unwrapExpression(expression: ESTree.Expression): ESTree.Expression {\n\tlet current = expression;\n\twhile (\n\t\tcurrent.type === \"ParenthesizedExpression\" ||\n\t\tcurrent.type === \"TSAsExpression\" ||\n\t\tcurrent.type === \"TSSatisfiesExpression\" ||\n\t\tcurrent.type === \"TSTypeAssertion\" ||\n\t\tcurrent.type === \"TSNonNullExpression\"\n\t) {\n\t\tcurrent = current.expression;\n\t}\n\treturn current;\n}\n\nfunction variableDeclarator(variable: Variable): ESTree.VariableDeclarator | null {\n\tif (variable.defs.length !== 1) return null;\n\tconst [definition] = variable.defs;\n\treturn definition?.type === \"Variable\" && definition.node.type === \"VariableDeclarator\"\n\t\t? definition.node\n\t\t: null;\n}\n\nfunction isStableConstVariable(variable: Variable, declarator: ESTree.VariableDeclarator): boolean {\n\treturn (\n\t\tdeclarator.parent.type === \"VariableDeclaration\" &&\n\t\tdeclarator.parent.kind === \"const\" &&\n\t\tvariable.references.every((reference) => reference.init || !reference.isWrite())\n\t);\n}\n\nfunction hasKnownEvidence(\n\tsourceCode: SourceCode,\n\texpression: ESTree.Expression,\n\tvisitedVariables = new Set<Variable>(),\n): boolean {\n\tif (isKnownEvidenceExpression(expression)) return true;\n\tconst unwrapped = unwrapExpression(expression);\n\tif (unwrapped.type !== \"Identifier\") return false;\n\tconst variable = resolveVariable(sourceCode, unwrapped);\n\tif (variable === null || visitedVariables.has(variable)) return false;\n\tconst declarator = variableDeclarator(variable);\n\tif (\n\t\tdeclarator === null ||\n\t\tdeclarator.init === null ||\n\t\t!isStableConstVariable(variable, declarator)\n\t) {\n\t\treturn false;\n\t}\n\tvisitedVariables.add(variable);\n\treturn hasKnownEvidence(sourceCode, declarator.init, visitedVariables);\n}\n\nfunction isFunctionExpression(node: ESTree.Node): node is FunctionExpression {\n\treturn (\n\t\tnode.type === \"ArrowFunctionExpression\" ||\n\t\tnode.type === \"FunctionDeclaration\" ||\n\t\tnode.type === \"FunctionExpression\" ||\n\t\tnode.type === \"TSDeclareFunction\" ||\n\t\tnode.type === \"TSEmptyBodyFunctionExpression\"\n\t);\n}\n\nfunction localFunctionForCall(\n\tsourceCode: SourceCode,\n\tcallee: ESTree.Expression,\n): FunctionExpression | null {\n\tconst unwrapped = unwrapExpression(callee);\n\tif (isFunctionExpression(unwrapped)) return unwrapped;\n\tif (unwrapped.type !== \"Identifier\") return null;\n\tconst variable = resolveVariable(sourceCode, unwrapped);\n\tif (variable === null || variable.defs.length !== 1) return null;\n\tconst [definition] = variable.defs;\n\tif (definition === undefined) return null;\n\tif (definition.type === \"FunctionName\" && isFunctionExpression(definition.node)) {\n\t\treturn definition.node;\n\t}\n\tif (definition.type !== \"Variable\" || definition.node.type !== \"VariableDeclarator\") {\n\t\treturn null;\n\t}\n\tconst initializer = definition.node.init;\n\tif (initializer === null) return null;\n\tconst unwrappedInitializer = unwrapExpression(initializer);\n\treturn isFunctionExpression(unwrappedInitializer) ? unwrappedInitializer : null;\n}\n\nfunction variableTypeAnnotation(\n\tsourceCode: SourceCode,\n\tvariable: Variable,\n): ESTree.TSTypeAnnotation | null {\n\tif (variable.defs.length !== 1) return null;\n\tconst [definition] = variable.defs;\n\tif (definition === undefined) return null;\n\tif (\n\t\tdefinition.type === \"Variable\" &&\n\t\tdefinition.node.type === \"VariableDeclarator\" &&\n\t\tdefinition.node.id.type === \"Identifier\"\n\t) {\n\t\treturn definition.node.id.typeAnnotation ?? null;\n\t}\n\tif (definition.type !== \"Parameter\" || !isFunctionExpression(definition.node)) {\n\t\treturn null;\n\t}\n\tconst parameter = definition.node.params.find(\n\t\t(candidate) =>\n\t\t\tfunctionParameterBindingName(candidate, sourceCode) === variable.name,\n\t);\n\treturn parameter === undefined ? null : (functionParameterTypeAnnotation(parameter) ?? null);\n}\n\nfunction hasInformativeType(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n): boolean {\n\treturn classifyUnsafeDictionaryValue(type, environment) === null;\n}\n\nfunction hasKnownCallArgumentEvidence(\n\tsourceCode: SourceCode,\n\texpression: ESTree.Expression,\n\tenvironment: TypeEnvironment,\n\tvisitedVariables = new Set<Variable>(),\n): boolean {\n\tif (expression.type === \"ParenthesizedExpression\" || expression.type === \"TSNonNullExpression\") {\n\t\treturn hasKnownCallArgumentEvidence(\n\t\t\tsourceCode,\n\t\t\texpression.expression,\n\t\t\tenvironment,\n\t\t\tvisitedVariables,\n\t\t);\n\t}\n\tif (expression.type === \"TSAsExpression\" || expression.type === \"TSTypeAssertion\") {\n\t\treturn hasInformativeType(expression.typeAnnotation, environment);\n\t}\n\tif (expression.type === \"TSSatisfiesExpression\") {\n\t\treturn hasKnownCallArgumentEvidence(\n\t\t\tsourceCode,\n\t\t\texpression.expression,\n\t\t\tenvironment,\n\t\t\tvisitedVariables,\n\t\t);\n\t}\n\tif (expression.type === \"CallExpression\") {\n\t\tconst owner = localFunctionForCall(sourceCode, expression.callee);\n\t\tconst returnType = owner?.returnType?.typeAnnotation;\n\t\treturn returnType !== undefined && hasInformativeType(returnType, environment);\n\t}\n\tif (expression.type !== \"Identifier\") return isKnownEvidenceExpression(expression);\n\tconst variable = resolveVariable(sourceCode, expression);\n\tif (variable === null || visitedVariables.has(variable)) return false;\n\tconst annotation = variableTypeAnnotation(sourceCode, variable);\n\tif (annotation !== null) {\n\t\treturn hasInformativeType(annotation.typeAnnotation, environment);\n\t}\n\tconst declarator = variableDeclarator(variable);\n\tif (\n\t\tdeclarator === null ||\n\t\tdeclarator.init === null ||\n\t\t!isStableConstVariable(variable, declarator)\n\t) {\n\t\treturn false;\n\t}\n\tvisitedVariables.add(variable);\n\treturn hasKnownCallArgumentEvidence(\n\t\tsourceCode,\n\t\tdeclarator.init,\n\t\tenvironment,\n\t\tvisitedVariables,\n\t);\n}\n\nfunction typePredicateSubjectIndex(\n\tsourceCode: SourceCode,\n\towner: FunctionExpression,\n): number | null {\n\tconst predicate = owner.returnType?.typeAnnotation;\n\tif (predicate?.type !== \"TSTypePredicate\" || predicate.parameterName.type !== \"Identifier\") {\n\t\treturn null;\n\t}\n\tconst predicateParameterName = predicate.parameterName.name;\n\tconst index = owner.params.findIndex(\n\t\t(parameter) =>\n\t\t\tfunctionParameterBindingName(parameter, sourceCode) === predicateParameterName,\n\t);\n\treturn index === -1 ? null : index;\n}\n\nfunction annotationTarget(\n\tannotation: ESTree.TSTypeAnnotation | null | undefined,\n\tenvironment: TypeEnvironment,\n): WideningTarget | null {\n\treturn annotation === null || annotation === undefined\n\t\t? null\n\t\t: classifyWideningTarget(annotation.typeAnnotation, environment);\n}\n\nfunction enclosingFunction(node: ESTree.Node): FunctionExpression | null {\n\tlet current: ESTree.Node | null = node.parent;\n\twhile (current !== null && current.type !== \"Program\") {\n\t\tif (\n\t\t\tcurrent.type === \"ArrowFunctionExpression\" ||\n\t\t\tcurrent.type === \"FunctionDeclaration\" ||\n\t\t\tcurrent.type === \"FunctionExpression\"\n\t\t) {\n\t\t\treturn current;\n\t\t}\n\t\tcurrent = current.parent;\n\t}\n\treturn null;\n}\n\nfunction sourceKeyName(sourceCode: SourceCode, key: ESTree.PropertyKey): string {\n\tif (key.type === \"Identifier\" || key.type === \"PrivateIdentifier\") return key.name;\n\tif (key.type === \"Literal\") return String(key.value);\n\treturn sourceCode.getText(key);\n}\n\nfunction functionName(sourceCode: SourceCode, owner: FunctionExpression | null): string {\n\tif (owner === null) return \"anonymous function\";\n\tif (owner.id !== null) return owner.id.name;\n\tconst parent = owner.parent;\n\tif (parent.type === \"VariableDeclarator\" && parent.id.type === \"Identifier\")\n\t\treturn parent.id.name;\n\tif (parent.type === \"MethodDefinition\") return sourceKeyName(sourceCode, parent.key);\n\treturn \"anonymous function\";\n}\n\nfunction isEmptyObjectExpression(expression: ESTree.Expression): boolean {\n\tconst unwrapped = unwrapExpression(expression);\n\treturn unwrapped.type === \"ObjectExpression\" && unwrapped.properties.length === 0;\n}\n\nfunction isDictionaryAccumulatorTarget(destination: WideningTarget): boolean {\n\treturn destination.kind === \"open dictionary\" || destination.kind === \"generic container\";\n}\n\nfunction hasParentAssertion(node: ESTree.Node): boolean {\n\treturn node.parent?.type === \"TSAsExpression\" || node.parent?.type === \"TSTypeAssertion\";\n}\n\n/** Detect sound syntactic cases where a known value is explicitly widened and loses evidence. */\nexport const noKnownValueWideningRule = defineRule({\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow syntactically established values from flowing into explicitly broad or anonymous target types that discard useful evidence.\",\n\t\t},\n\t\tmessages: {\n\t\t\twidening:\n\t\t\t\t\"The explicit {{target}} type on {{subject}} discards known type evidence. Keep inference, validate with `satisfies`, or use a named owner contract.\",\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tlet environment: TypeEnvironment | null = null;\n\n\t\tconst reportFlow = (\n\t\t\texpression: ESTree.Expression,\n\t\t\tdestination: WideningTarget | null,\n\t\t\tsubject: string,\n\t\t) => {\n\t\t\tif (destination === null) return;\n\t\t\tif (\n\t\t\t\tisDictionaryAccumulatorTarget(destination) &&\n\t\t\t\tisEmptyObjectExpression(expression)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!hasKnownEvidence(context.sourceCode, expression)) return;\n\t\t\tcontext.report({\n\t\t\t\tnode: expression,\n\t\t\t\tmessageId: \"widening\",\n\t\t\t\tdata: { subject, target: destination.kind },\n\t\t\t});\n\t\t};\n\n\t\tconst targetFromAnnotation = (annotation: ESTree.TSTypeAnnotation | null | undefined) =>\n\t\t\tenvironment === null ? null : annotationTarget(annotation, environment);\n\n\t\treturn {\n\t\t\tProgram(node) {\n\t\t\t\tenvironment = createTypeEnvironment(\n\t\t\t\t\tnode,\n\t\t\t\t\tcontext.sourceCode.visitorKeys,\n\t\t\t\t);\n\t\t\t},\n\t\t\tVariableDeclarator(node) {\n\t\t\t\tif (node.init === null || node.id.type !== \"Identifier\") return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.init,\n\t\t\t\t\ttargetFromAnnotation(node.id.typeAnnotation),\n\t\t\t\t\t`binding \\`${node.id.name}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tPropertyDefinition(node) {\n\t\t\t\tif (node.value === null) return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.value,\n\t\t\t\t\ttargetFromAnnotation(node.typeAnnotation),\n\t\t\t\t\t`property \\`${sourceKeyName(context.sourceCode, node.key)}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tAccessorProperty(node) {\n\t\t\t\tif (node.value === null) return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.value,\n\t\t\t\t\ttargetFromAnnotation(node.typeAnnotation),\n\t\t\t\t\t`property \\`${sourceKeyName(context.sourceCode, node.key)}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tAssignmentExpression(node) {\n\t\t\t\tif (node.operator !== \"=\" || node.left.type !== \"Identifier\") return;\n\t\t\t\tconst variable = resolveVariable(context.sourceCode, node.left);\n\t\t\t\tif (variable === null) return;\n\t\t\t\tconst declarator = variableDeclarator(variable);\n\t\t\t\tif (declarator === null || declarator.id.type !== \"Identifier\") return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.right,\n\t\t\t\t\ttargetFromAnnotation(declarator.id.typeAnnotation),\n\t\t\t\t\t`binding \\`${declarator.id.name}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tCallExpression(node) {\n\t\t\t\tif (environment === null) return;\n\t\t\t\tconst owner = localFunctionForCall(context.sourceCode, node.callee);\n\t\t\t\tif (owner === null) return;\n\t\t\t\tconst parameterIndex = typePredicateSubjectIndex(context.sourceCode, owner);\n\t\t\t\tif (parameterIndex === null) return;\n\t\t\t\tconst parameter = owner.params[parameterIndex];\n\t\t\t\tconst argument = node.arguments[parameterIndex];\n\t\t\t\tif (parameter === undefined || argument === undefined || argument.type === \"SpreadElement\") {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst parameterAnnotation = functionParameterTypeAnnotation(parameter);\n\t\t\t\tif (\n\t\t\t\t\tparameterAnnotation === null ||\n\t\t\t\t\tparameterAnnotation === undefined ||\n\t\t\t\t\t!containsUnknownType(parameterAnnotation.typeAnnotation)\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t!hasKnownCallArgumentEvidence(\n\t\t\t\t\t\tcontext.sourceCode,\n\t\t\t\t\t\targument,\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: argument,\n\t\t\t\t\tmessageId: \"widening\",\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tsubject: `argument for parameter \\`${functionParameterBindingName(parameter, context.sourceCode)}\\` of \\`${functionName(context.sourceCode, owner)}\\``,\n\t\t\t\t\t\ttarget: \"unknown\",\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t\tReturnStatement(node) {\n\t\t\t\tif (node.argument === null) return;\n\t\t\t\tconst owner = enclosingFunction(node);\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.argument,\n\t\t\t\t\ttargetFromAnnotation(owner?.returnType),\n\t\t\t\t\t`return value of \\`${functionName(context.sourceCode, owner)}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tArrowFunctionExpression(node) {\n\t\t\t\tif (node.body.type === \"BlockStatement\") return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.body,\n\t\t\t\t\ttargetFromAnnotation(node.returnType),\n\t\t\t\t\t`return value of \\`${functionName(context.sourceCode, node)}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tTSAsExpression(node) {\n\t\t\t\tif (environment === null || hasParentAssertion(node)) return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.expression,\n\t\t\t\t\tclassifyWideningTarget(node.typeAnnotation, environment),\n\t\t\t\t\t\"assertion\",\n\t\t\t\t);\n\t\t\t},\n\t\t\tTSTypeAssertion(node) {\n\t\t\t\tif (environment === null || hasParentAssertion(node)) return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.expression,\n\t\t\t\t\tclassifyWideningTarget(node.typeAnnotation, environment),\n\t\t\t\t\t\"assertion\",\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t},\n});\n","// A module mock replaces a dependency by file path, so the test exercises the mock and proves\n// nothing about the seam the code actually uses; when the real module's API changes the test keeps\n// passing. Scope it off only for a third-party module with no injectable seam, in that one test\n// file, naming the dependency so the exception disappears when the seam is added.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport { resolveVariable } from \"../shared/scope.ts\";\n\nimport type { ESTree, SourceCode } from \"@oxlint/plugins\";\n\nconst moduleMockMethods = new Set([\"doMock\", \"mock\", \"unstable_mockModule\"]);\n\nfunction importedName(node: ESTree.Node): string | null {\n if (node.type !== \"ImportSpecifier\") return null;\n return node.imported.type === \"Identifier\" ? node.imported.name : node.imported.value;\n}\n\nfunction isTestFrameworkObject(\n sourceCode: SourceCode,\n expression: ESTree.Expression,\n): expression is ESTree.IdentifierReference {\n if (expression.type !== \"Identifier\") return false;\n if (\n (expression.name === \"vi\" || expression.name === \"jest\") &&\n sourceCode.isGlobalReference(expression)\n ) {\n return true;\n }\n\n const variable = resolveVariable(sourceCode, expression);\n if (variable === null || variable.defs.length === 0) {\n return expression.name === \"vi\" || expression.name === \"jest\";\n }\n return variable.defs.some((definition) => {\n if (definition.type !== \"ImportBinding\" || definition.parent?.type !== \"ImportDeclaration\") {\n return false;\n }\n const source = definition.parent.source.value;\n const name = importedName(definition.node);\n return (source === \"vitest\" && name === \"vi\") || (source === \"@jest/globals\" && name === \"jest\");\n });\n}\n\nfunction moduleMockCall(sourceCode: SourceCode, callee: ESTree.Expression): boolean {\n if (!(\"property\" in callee) || !(\"object\" in callee) || !(\"computed\" in callee)) return false;\n if (!isTestFrameworkObject(sourceCode, callee.object)) return false;\n const property = callee.property;\n const method = callee.computed\n ? property.type === \"Literal\" &&\n (property.value === \"doMock\" ||\n property.value === \"mock\" ||\n property.value === \"unstable_mockModule\")\n ? property.value\n : null\n : property.type === \"Identifier\"\n ? property.name\n : null;\n return method !== null && moduleMockMethods.has(method);\n}\n\n/** Ban test framework module mocking in favor of real dependency seams. */\nexport const noModuleMockingRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Vitest and Jest module mocking; tests must replace dependencies through real interfaces.\",\n },\n messages: {\n moduleMock:\n \"Replace module mocking with dependency injection through a real interface, service layer, or faithful test implementation.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type === \"Super\" || node.callee.type === \"V8IntrinsicExpression\") return;\n if (moduleMockCall(context.sourceCode, node.callee)) {\n context.report({ node, messageId: \"moduleMock\" });\n }\n },\n };\n },\n});\n","// `object` tells a caller only that the value is not a primitive, so every field read in the body\n// needs a cast, an index signature or `Reflect`, and the call site gets no help at all. Scope it\n// off for a declaration file mirroring a signature you do not own, where narrowing the parameter\n// would misdescribe what the library accepts.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport {\n\tfunctionParameterBindingName,\n\tfunctionParameterTypeAnnotation,\n} from \"../shared/function-parameters.ts\";\nimport {\n\tcreateTypeAliasEnvironment,\n\tresolvedTypeMatches,\n\ttype TypeAliasEnvironment,\n} from \"../shared/type-alias-resolution.ts\";\ntype ParameterOwner =\n\t| ESTree.ArrowFunctionExpression\n\t| ESTree.Function\n\t| ESTree.TSCallSignatureDeclaration\n\t| ESTree.TSConstructSignatureDeclaration\n\t| ESTree.TSConstructorType\n\t| ESTree.TSFunctionType\n\t| ESTree.TSMethodSignature;\n\n/** Ban the broad object type on function inputs, including local aliases to object. */\nexport const noObjectParametersRule = defineRule({\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow object function parameters; inputs must use an owner-provided type and be parsed at their boundary.\",\n\t\t},\n\t\tmessages: {\n\t\t\tobjectParameter:\n\t\t\t\t\"Parameter `{{parameter}}` uses the broad `object` type. Accept a named owner type; parse external input at its boundary before calling this function.\",\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tlet environment: TypeAliasEnvironment | null = null;\n\n\t\tconst resolvesToObject = (type: ESTree.TSType): boolean =>\n\t\t\tenvironment !== null &&\n\t\t\tresolvedTypeMatches(type, environment, (resolved, matches) => {\n\t\t\t\tif (resolved.type === \"TSObjectKeyword\") return true;\n\t\t\t\tif (resolved.type === \"TSParenthesizedType\") {\n\t\t\t\t\treturn matches(resolved.typeAnnotation);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\tresolved.type === \"TSUnionType\" && resolved.types.some(matches)\n\t\t\t\t);\n\t\t\t});\n\n\t\tconst checkParameters = (node: ParameterOwner) => {\n\t\t\tfor (const parameter of node.params) {\n\t\t\t\tconst annotation = functionParameterTypeAnnotation(parameter);\n\t\t\t\tif (annotation === null || annotation === undefined) continue;\n\t\t\t\tif (!resolvesToObject(annotation.typeAnnotation)) continue;\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: annotation.typeAnnotation,\n\t\t\t\t\tmessageId: \"objectParameter\",\n\t\t\t\t\tdata: { parameter: functionParameterBindingName(parameter, context.sourceCode) },\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\treturn {\n\t\t\tProgram(node) {\n\t\t\t\tenvironment = createTypeAliasEnvironment(\n\t\t\t\t\tnode,\n\t\t\t\t\tcontext.sourceCode.visitorKeys,\n\t\t\t\t);\n\t\t\t},\n\t\t\tArrowFunctionExpression: checkParameters,\n\t\t\tFunctionDeclaration: checkParameters,\n\t\t\tFunctionExpression: checkParameters,\n\t\t\tTSCallSignatureDeclaration: checkParameters,\n\t\t\tTSConstructSignatureDeclaration: checkParameters,\n\t\t\tTSConstructorType: checkParameters,\n\t\t\tTSDeclareFunction: checkParameters,\n\t\t\tTSEmptyBodyFunctionExpression: checkParameters,\n\t\t\tTSFunctionType: checkParameters,\n\t\t\tTSMethodSignature: checkParameters,\n\t\t};\n\t},\n});\n","// Copying the accumulator on every step allocates an object per element and copies everything\n// collected so far, so the work grows with the square of the input. It reads as careful\n// immutability and is a performance bug at any real size. Nothing needs it off: the accumulator\n// belongs to the reduction, so mutating it and returning it is safe.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree, SourceCode, Variable } from \"@oxlint/plugins\";\n\nimport {\n arrayMethodTarget,\n isKnownArrayExpression,\n resolveArrayBinding,\n unwrapArrayExpression,\n} from \"../shared/array-method.ts\";\n\nfunction enclosingReducer(node: ESTree.Node) {\n let parent = node.parent;\n while (parent !== null) {\n if (parent.type === \"FunctionDeclaration\") return null;\n if (parent.type === \"ArrowFunctionExpression\" || parent.type === \"FunctionExpression\") {\n const callback = parent;\n let owner: ESTree.Node | null = callback.parent;\n while (owner !== null && unwrapArrayExpression(owner) === callback) owner = owner.parent;\n if (owner?.type !== \"CallExpression\") return null;\n const method = arrayMethodTarget(owner.callee);\n const firstArgument = owner.arguments[0];\n if (\n method === null || (method.name !== \"reduce\" && method.name !== \"reduceRight\") ||\n owner.arguments.length > 2 || firstArgument === undefined ||\n unwrapArrayExpression(firstArgument) !== callback\n ) return null;\n const firstParameter = callback.params[0];\n const accumulator = firstParameter?.type === \"AssignmentPattern\" ? firstParameter.left : firstParameter;\n if (accumulator?.type !== \"Identifier\") return null;\n return { callback, accumulator, initialValue: owner.arguments[1] };\n }\n parent = parent.parent;\n }\n return null;\n}\n\nfunction referencesAccumulator(\n sourceCode: SourceCode,\n node: ESTree.Node,\n accumulator: Variable,\n visited = new Set<Variable>(),\n): boolean {\n const variable = resolveArrayBinding(sourceCode, node);\n if (variable === null || visited.has(variable)) return false;\n if (variable === accumulator) return true;\n visited.add(variable);\n if (variable.references.some(reference => reference.isWrite() && !reference.init)) return false;\n for (const definition of variable.defs) {\n if (\n definition.type === \"Variable\" && definition.node.type === \"VariableDeclarator\" &&\n definition.node.id.type === \"Identifier\" && definition.node.init !== null &&\n definition.node.parent.type === \"VariableDeclaration\" && definition.node.parent.kind === \"const\"\n ) {\n return referencesAccumulator(sourceCode, definition.node.init, accumulator, visited);\n }\n }\n return false;\n}\n\nfunction isGlobalCopyOwner(sourceCode: SourceCode, node: ESTree.Node, name: string): boolean {\n node = unwrapArrayExpression(node);\n if (node.type !== \"Identifier\" || node.name !== name) return false;\n const variable = resolveArrayBinding(sourceCode, node);\n return variable === null || variable.defs.length === 0;\n}\n\n/** Reject non-spread copies of reducer accumulators; pair with oxc/no-accumulating-spread. */\nexport const noReduceAccumulatorCopyRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Disallow copying growing reducer accumulators with Object.assign, Array.from, or array copy methods.\" },\n messages: {\n accumulatorCopy: \"Do not copy the reducer accumulator on every iteration; growing copies can cause quadratic work. Mutate a fresh, locally owned accumulator and return it, or use an iterator pipeline/flatMap.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const method = arrayMethodTarget(node.callee);\n if (method === null) return;\n const reducer = enclosingReducer(node);\n if (reducer === null) return;\n const accumulator = context.sourceCode.getDeclaredVariables(reducer.callback).find(variable =>\n variable.identifiers.some(identifier => identifier.start === reducer.accumulator.start),\n );\n if (accumulator === undefined) return;\n const isAccumulator = (expression: ESTree.Node) =>\n referencesAccumulator(context.sourceCode, expression, accumulator);\n let copiesAccumulator = false;\n if (method.name === \"assign\" && isGlobalCopyOwner(context.sourceCode, method.object, \"Object\")) {\n const target = node.arguments[0];\n copiesAccumulator = (\n target !== undefined && unwrapArrayExpression(target).type === \"ObjectExpression\" &&\n node.arguments.slice(1).some(isAccumulator)\n );\n } else if (method.name === \"from\" && isGlobalCopyOwner(context.sourceCode, method.object, \"Array\")) {\n const source = node.arguments[0];\n copiesAccumulator = source !== undefined && isAccumulator(source);\n } else if ([\"concat\", \"slice\", \"toSpliced\", \"toSorted\", \"toReversed\", \"with\"].includes(method.name)) {\n const initialValue = reducer.initialValue;\n const arrayAccumulator = initialValue !== undefined &&\n isKnownArrayExpression(context.sourceCode, initialValue);\n copiesAccumulator = arrayAccumulator && isAccumulator(method.object);\n }\n if (copiesAccumulator) context.report({ node, messageId: \"accumulatorCopy\" });\n },\n };\n },\n});\n","import { resolveVariable } from \"./scope.ts\";\n\nimport type { ESTree, SourceCode } from \"@oxlint/plugins\";\n\nfunction isGlobalReflect(sourceCode: SourceCode, expression: ESTree.Expression): boolean {\n if (expression.type !== \"Identifier\" || expression.name !== \"Reflect\") return false;\n if (sourceCode.isGlobalReference(expression)) return true;\n const variable = resolveVariable(sourceCode, expression);\n return variable === null || variable.defs.length === 0;\n}\n\n/** Reports whether a call target names one method on the global Reflect object. */\nexport function isGlobalReflectMethodCall(\n sourceCode: SourceCode,\n callee: ESTree.Expression,\n methodName: string,\n): boolean {\n if (!(\"property\" in callee) || !(\"object\" in callee) || !(\"computed\" in callee)) return false;\n if (!isGlobalReflect(sourceCode, callee.object)) return false;\n const property = callee.property;\n return callee.computed\n ? property.type === \"Literal\" && property.value === methodName\n : property.type === \"Identifier\" && property.name === methodName;\n}\n","// `Reflect.apply` takes the arguments as an array, so the checker sees nothing about arity or\n// argument types and every mistake surfaces at runtime. It also hides who is being called, the one\n// thing a reader wants from a dispatch site. Scope it off for a `Proxy` `apply` trap, where\n// forwarding this way is the documented means of keeping the original behaviour.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport { isGlobalReflectMethodCall } from \"../shared/reflect-method.ts\";\n\n/** Ban Reflect.apply, which bypasses ordinary typed function calls. */\nexport const noReflectApplyRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Reflect.apply; call typed functions directly or model dynamic dispatch behind an interface.\",\n },\n messages: {\n reflectApply:\n \"Replace `Reflect.apply` with a typed function call. Model dynamic dispatch behind a named interface.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type === \"Super\" || node.callee.type === \"V8IntrinsicExpression\") return;\n if (isGlobalReflectMethodCall(context.sourceCode, node.callee, \"apply\")) {\n context.report({ node, messageId: \"reflectApply\" });\n }\n },\n };\n },\n});\n","// `Reflect.get` returns `any` and asks the checker no questions, so a misspelled key and a renamed\n// field both survive to runtime. It is usually reached for when the value was never parsed into a\n// type that has the field. Scope it off for a `Proxy` `get` trap, where forwarding with the right\n// receiver is what keeps getters on the prototype chain working.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport { isGlobalReflectMethodCall } from \"../shared/reflect-method.ts\";\n\n/** Ban Reflect.get, which bypasses ordinary property access and useful type evidence. */\nexport const noReflectGetRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Reflect.get; use typed property access or parse dynamic input into a domain type.\",\n },\n messages: {\n reflectGet:\n \"Replace `Reflect.get` with typed property access. Parse dynamic input into a named domain type before reading it.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type === \"Super\" || node.callee.type === \"V8IntrinsicExpression\") return;\n if (isGlobalReflectMethodCall(context.sourceCode, node.callee, \"get\")) {\n context.report({ node, messageId: \"reflectGet\" });\n }\n },\n };\n },\n});\n","// `typeof value === \"string\"` says how a value is represented, not what it means or where it came\n// from, so narrowing this way scatters half a parser across the branches that consume it. Scope it\n// off for a decoder module, the one place per kind of outside value where that parse belongs, and\n// for tests, where asserting the shape of your own public API reads as unparsed input.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\ntype RuntimeFunction = ESTree.ArrowFunctionExpression | ESTree.Function;\n\nfunction isRuntimeFunction(node: ESTree.Node): node is RuntimeFunction {\n\treturn (\n\t\tnode.type === \"ArrowFunctionExpression\" ||\n\t\tnode.type === \"FunctionDeclaration\" ||\n\t\tnode.type === \"FunctionExpression\"\n\t);\n}\n\nfunction isInsideTypeGuard(node: ESTree.Node): boolean {\n\tlet current: ESTree.Node | null = node.parent;\n\twhile (current !== null && current.type !== \"Program\") {\n\t\tif (isRuntimeFunction(current)) {\n\t\t\treturn current.returnType?.typeAnnotation.type === \"TSTypePredicate\";\n\t\t}\n\t\tcurrent = current.parent;\n\t}\n\treturn false;\n}\n\n/** Return whether typeof safely probes for the existence of a possibly absent binding. */\nfunction isExistenceProbe(node: ESTree.UnaryExpression): boolean {\n\tconst parent = node.parent;\n\tif (parent.type !== \"BinaryExpression\") return false;\n\tif (![\"===\", \"!==\", \"==\", \"!=\"].includes(parent.operator)) return false;\n\tconst other = parent.left === node ? parent.right : parent.left;\n\treturn other.type === \"Literal\" && other.value === \"undefined\";\n}\n\n/** Disallow runtime typeof checks that narrow unparsed values instead of decoding them. */\nexport const noRuntimeTypeofRule = defineRule({\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow runtime typeof checks; external values must be decoded into meaningful types at their I/O boundary.\",\n\t\t},\n\t\tmessages: {\n\t\t\truntimeTypeof:\n\t\t\t\t\"A `typeof` check narrows a representation without establishing its contract. Parse input at its I/O boundary, then branch on the domain value.\",\n\t\t},\n\t\tschema: [\n\t\t\t{\n\t\t\t\ttype: \"object\",\n\t\t\t\tproperties: {\n\t\t\t\t\tallowInTypeGuards: { type: \"boolean\" },\n\t\t\t\t},\n\t\t\t\tadditionalProperties: false,\n\t\t\t},\n\t\t],\n\t\tdefaultOptions: [{ allowInTypeGuards: false }],\n\t},\n\tcreateOnce(context) {\n\t\treturn {\n\t\t\tUnaryExpression(node) {\n\t\t\t\tconst option = context.options?.[0];\n\t\t\t\tconst allowInTypeGuards =\n\t\t\t\t\ttypeof option === \"object\" &&\n\t\t\t\t\toption !== null &&\n\t\t\t\t\t!Array.isArray(option) &&\n\t\t\t\t\toption.allowInTypeGuards === true;\n\t\t\t\tif (\n\t\t\t\t\tnode.operator === \"typeof\" &&\n\t\t\t\t\t!isExistenceProbe(node) &&\n\t\t\t\t\t(!allowInTypeGuards || !isInsideTypeGuard(node))\n\t\t\t\t) {\n\t\t\t\t\tcontext.report({ node, messageId: \"runtimeTypeof\" });\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n});\n","// `PayloadShape` and `userShape` name the structure of a value instead of its role, the tell of a\n// type written to satisfy the compiler rather than to describe the domain, and the name outlives\n// every refactor that changes what the value is for. The word has to open a segment, so `shapeOf`\n// and `shapes` report while `reshape` does not. Scope it off where a shape is the domain itself:\n// drawing, geometry, a layout engine.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree } from \"@oxlint/plugins\";\n\nconst FORBIDDEN_SYMBOL_NAME = \"shape\";\n\n// One word of an identifier: an acronym run, a capitalised word, a lowercase run\n// or a digit run. camelCase, PascalCase, snake_case and SCREAMING_CASE all split\n// here, and `XMLShape` splits into `XML` and `Shape`.\nconst IDENTIFIER_WORD = /[A-Z]+(?![a-z])|[A-Z]?[a-z]+|\\d+/gu;\n\nfunction containsForbiddenSymbolName(name: string): boolean {\n const words = name.match(IDENTIFIER_WORD) ?? [];\n return words.some((word) => word.toLowerCase().startsWith(FORBIDDEN_SYMBOL_NAME));\n}\n\n/** Return whether an identifier names a statically accessed member owned by another value. */\nfunction isBorrowedMemberName(node: ESTree.Node): boolean {\n const parent = node.parent;\n if (parent === null || parent.type !== \"MemberExpression\") return false;\n return parent.property === node && parent.computed === false;\n}\n\n/** Ban the word \"shape\" in every JavaScript and TypeScript symbol name. */\nexport const noForbiddenTermInSymbolNamesRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n 'Disallow the word \"shape\" in JavaScript, TypeScript, private, and JSX symbol names.',\n },\n messages: {\n forbiddenSymbolName:\n 'Rename symbol \"{{name}}\" for its domain role; \"shape\" describes structure rather than ownership.',\n },\n },\n createOnce(context) {\n const reportForbiddenSymbolName = (node: ESTree.Node & { name: string }) => {\n if (!containsForbiddenSymbolName(node.name) || isBorrowedMemberName(node)) return;\n context.report({\n node,\n messageId: \"forbiddenSymbolName\",\n data: { name: node.name },\n });\n };\n\n return {\n Identifier: reportForbiddenSymbolName,\n PrivateIdentifier: reportForbiddenSymbolName,\n JSXIdentifier: reportForbiddenSymbolName,\n };\n },\n});\n","// An `unknown` parameter moves the parsing work from the caller, who knows what the value is, to\n// the body, which does not, so every call site passes whatever it has. Scope it off for the error\n// decoder that turns a rejection into a domain failure: TypeScript types a `catch` binding as\n// `unknown`, so that one contract is honest.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport {\n containsUnknownType,\n functionParameterBindingName,\n functionParameterTypeAnnotation,\n} from \"../shared/function-parameters.ts\";\ntype ParameterOwner =\n | ESTree.ArrowFunctionExpression\n | ESTree.Function\n | ESTree.TSCallSignatureDeclaration\n | ESTree.TSConstructSignatureDeclaration\n | ESTree.TSConstructorType\n | ESTree.TSFunctionType\n | ESTree.TSMethodSignature;\n\nfunction isTypePredicateSubject(owner: ParameterOwner, parameterName: string): boolean {\n const predicate = owner.returnType?.typeAnnotation;\n return (\n predicate?.type === \"TSTypePredicate\" &&\n predicate.parameterName.type === \"Identifier\" &&\n predicate.parameterName.name === parameterName\n );\n}\n\n/** Disallow unknown inputs except explicitly named error-cause enrichment. */\nexport const noUnknownParametersRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow explicitly unknown function parameters except `cause` and type-predicate subjects; decode unknown input at its I/O boundary instead.\",\n },\n messages: {\n unknownParameter:\n \"Parameter `{{parameter}}` leaves input unparsed. Accept a named domain type; run the expected schema or parser at the I/O boundary before calling this function.\",\n },\n },\n createOnce(context) {\n const checkParameters = (node: ParameterOwner) => {\n for (const parameter of node.params) {\n const annotation = functionParameterTypeAnnotation(parameter);\n if (annotation === null || annotation === undefined) continue;\n if (!containsUnknownType(annotation.typeAnnotation)) continue;\n const name = functionParameterBindingName(parameter, context.sourceCode);\n if (name === \"cause\" || isTypePredicateSubject(node, name)) continue;\n context.report({\n node: annotation.typeAnnotation,\n messageId: \"unknownParameter\",\n data: { parameter: name },\n });\n }\n };\n\n return {\n ArrowFunctionExpression: checkParameters,\n FunctionDeclaration: checkParameters,\n FunctionExpression: checkParameters,\n TSCallSignatureDeclaration: checkParameters,\n TSConstructSignatureDeclaration: checkParameters,\n TSConstructorType: checkParameters,\n TSDeclareFunction: checkParameters,\n TSEmptyBodyFunctionExpression: checkParameters,\n TSFunctionType: checkParameters,\n TSMethodSignature: checkParameters,\n };\n },\n});\n","// A function returning `unknown` hands its caller a value and no way to use it, so the caller\n// either asserts or writes the parse the function should have done, once per call site. Scope it\n// off for a declaration file mirroring an external API whose real return type is `unknown`,\n// `JSON.parse` being the obvious one.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport {\n createTypeAliasEnvironment,\n resolvedTypeMatches,\n type TypeAliasEnvironment,\n} from \"../shared/type-alias-resolution.ts\";\n\ntype FunctionWithReturnType =\n | ESTree.ArrowFunctionExpression\n | ESTree.Function\n | ESTree.TSCallSignatureDeclaration\n | ESTree.TSConstructSignatureDeclaration\n | ESTree.TSConstructorType\n | ESTree.TSFunctionType\n | ESTree.TSMethodSignature;\n\n/** Ban function contracts that return unknown instead of a parsed domain type. */\nexport const noUnknownReturnsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow functions whose explicit return contract is unknown or Promise<unknown>.\",\n },\n messages: {\n unknownReturn:\n \"This function exposes `unknown` to its caller. Parse the value at its boundary and return a named domain type.\",\n },\n },\n createOnce(context) {\n let environment: TypeAliasEnvironment | null = null;\n\n const resolvesToUnknown = (type: ESTree.TSType): boolean =>\n environment !== null &&\n resolvedTypeMatches(type, environment, (resolved, matches) => {\n if (resolved.type === \"TSUnknownKeyword\") return true;\n if (resolved.type === \"TSParenthesizedType\") {\n return matches(resolved.typeAnnotation);\n }\n if (resolved.type === \"TSUnionType\") return resolved.types.some(matches);\n if (\n resolved.type !== \"TSTypeReference\" ||\n resolved.typeName.type !== \"Identifier\" ||\n (resolved.typeName.name !== \"Promise\" &&\n resolved.typeName.name !== \"PromiseLike\")\n ) {\n return false;\n }\n const value = resolved.typeArguments?.params[0];\n return value !== undefined && matches(value);\n });\n\n const checkReturnType = (node: FunctionWithReturnType) => {\n const annotation = node.returnType;\n if (annotation === null || annotation === undefined) return;\n if (!resolvesToUnknown(annotation.typeAnnotation)) return;\n context.report({ node: annotation.typeAnnotation, messageId: \"unknownReturn\" });\n };\n\n return {\n Program(node) {\n environment = createTypeAliasEnvironment(\n node,\n context.sourceCode.visitorKeys,\n );\n },\n ArrowFunctionExpression: checkReturnType,\n FunctionDeclaration: checkReturnType,\n FunctionExpression: checkReturnType,\n TSCallSignatureDeclaration: checkReturnType,\n TSConstructSignatureDeclaration: checkReturnType,\n TSConstructorType: checkReturnType,\n TSDeclareFunction: checkReturnType,\n TSEmptyBodyFunctionExpression: checkReturnType,\n TSFunctionType: checkReturnType,\n TSMethodSignature: checkReturnType,\n };\n },\n});\n","// `type Payload = unknown` gives a vague type a confident name, so every signature that uses it\n// reads as if it were parsed. A union hides it just as quietly, since `string | unknown` is\n// `unknown`. Nothing needs it off: where `unknown` is genuinely right, writing it at that spot is\n// clearer than a name that conceals it.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport {\n\tcreateTypeAliasEnvironment,\n\tresolvedTypeMatches,\n\ttype TypeAliasEnvironment,\n} from \"../shared/type-alias-resolution.ts\";\n\n/** Ban named aliases that merely conceal TypeScript's unknown top type. */\nexport const noUnknownTypeAliasesRule = defineRule({\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow type aliases whose resolved type is unknown; unknown must remain visible at an allowed boundary.\",\n\t\t},\n\t\tmessages: {\n\t\t\tunknownAlias:\n\t\t\t\t\"Type alias `{{alias}}` hides `unknown`. Keep `unknown` explicit at the parsing boundary or on an allowed `cause` field; otherwise use the parsed owner type.\",\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tlet environment: TypeAliasEnvironment | null = null;\n\n\t\tconst resolvesToUnknown = (type: ESTree.TSType): boolean =>\n\t\t\tenvironment !== null &&\n\t\t\tresolvedTypeMatches(type, environment, (resolved, matches) => {\n\t\t\t\tif (resolved.type === \"TSUnknownKeyword\") return true;\n\t\t\t\tif (resolved.type === \"TSParenthesizedType\") {\n\t\t\t\t\treturn matches(resolved.typeAnnotation);\n\t\t\t\t}\n\t\t\t\treturn resolved.type === \"TSUnionType\" && resolved.types.some(matches);\n\t\t\t});\n\n\t\treturn {\n\t\t\tProgram(node) {\n\t\t\t\tenvironment = createTypeAliasEnvironment(\n\t\t\t\t\tnode,\n\t\t\t\t\tcontext.sourceCode.visitorKeys,\n\t\t\t\t);\n\t\t\t},\n\t\t\tTSTypeAliasDeclaration(node) {\n\t\t\t\tif (!resolvesToUnknown(node.typeAnnotation)) return;\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: node.id,\n\t\t\t\t\tmessageId: \"unknownAlias\",\n\t\t\t\t\tdata: { alias: node.id.name },\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t},\n});\n","// `Record<string, unknown>` promises a lookup and delivers nothing: every read needs a cast, and\n// the cast is written at each call site by someone guessing. The type is usually a stand-in for a\n// schema nobody wrote. Scope it off for the one module that holds a decoded JSON object before any\n// field is read, never for its callers.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport {\n\tclassifyUnsafeDictionary,\n\tclassifyUnsafeDictionaryValue,\n\tcreateTypeEnvironment,\n\ttype TypeEnvironment,\n} from \"../shared/dictionary-types.ts\";\nimport { visibleTypeAlias } from \"../shared/type-alias-resolution.ts\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nconst typeNodeKinds: ReadonlySet<string> = new Set([\n\t\"JSDocNonNullableType\",\n\t\"JSDocNullableType\",\n\t\"JSDocUnknownType\",\n\t\"TSAnyKeyword\",\n\t\"TSArrayType\",\n\t\"TSBigIntKeyword\",\n\t\"TSBooleanKeyword\",\n\t\"TSConditionalType\",\n\t\"TSConstructorType\",\n\t\"TSFunctionType\",\n\t\"TSImportType\",\n\t\"TSIndexedAccessType\",\n\t\"TSInferType\",\n\t\"TSIntersectionType\",\n\t\"TSIntrinsicKeyword\",\n\t\"TSLiteralType\",\n\t\"TSMappedType\",\n\t\"TSNamedTupleMember\",\n\t\"TSNeverKeyword\",\n\t\"TSNullKeyword\",\n\t\"TSNumberKeyword\",\n\t\"TSObjectKeyword\",\n\t\"TSParenthesizedType\",\n\t\"TSStringKeyword\",\n\t\"TSSymbolKeyword\",\n\t\"TSTemplateLiteralType\",\n\t\"TSThisType\",\n\t\"TSTupleType\",\n\t\"TSTypeLiteral\",\n\t\"TSTypeOperator\",\n\t\"TSTypePredicate\",\n\t\"TSTypeQuery\",\n\t\"TSTypeReference\",\n\t\"TSUndefinedKeyword\",\n\t\"TSUnionType\",\n\t\"TSUnknownKeyword\",\n\t\"TSVoidKeyword\",\n]);\n\nfunction isTypeNode(node: ESTree.Node): node is ESTree.TSType {\n\treturn typeNodeKinds.has(node.type);\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n\treturn type.typeName.type === \"Identifier\" ? type.typeName.name : null;\n}\n\nfunction isInsideTypeAliasDeclaration(node: ESTree.Node): boolean {\n\tlet current: ESTree.Node | null = node.parent;\n\twhile (current !== null && current.type !== \"Program\") {\n\t\tif (current.type === \"TSTypeAliasDeclaration\") return true;\n\t\tcurrent = current.parent;\n\t}\n\treturn false;\n}\n\nfunction isPlainAliasConsumerUse(node: ESTree.TSType, environment: TypeEnvironment): boolean {\n\tif (node.type !== \"TSTypeReference\" || node.typeArguments?.params.length) return false;\n\tconst name = typeReferenceName(node);\n\treturn (\n\t\tname !== null &&\n\t\tvisibleTypeAlias(name, node, environment.typeAliases) !== null &&\n\t\t!isInsideTypeAliasDeclaration(node)\n\t);\n}\n\nfunction isInsideTypeParameterConstraint(node: ESTree.TSType): boolean {\n\tlet child: ESTree.Node = node;\n\tlet parent: ESTree.Node | null = child.parent;\n\twhile (parent !== null && parent.type !== \"Program\") {\n\t\tif (parent.type === \"TSTypeParameter\" && parent.constraint === child) return true;\n\t\tchild = parent;\n\t\tparent = child.parent;\n\t}\n\treturn false;\n}\n\nfunction shouldReportType(node: ESTree.TSType, environment: TypeEnvironment): boolean {\n\tif (isInsideTypeParameterConstraint(node)) return false;\n\tif (isPlainAliasConsumerUse(node, environment)) return false;\n\tif (classifyUnsafeDictionary(node, environment) === null) return false;\n\tlet current: ESTree.Node | null = node.parent;\n\twhile (current !== null && current.type !== \"Program\") {\n\t\tif (isTypeNode(current) && classifyUnsafeDictionary(current, environment) !== null)\n\t\t\treturn false;\n\t\tcurrent = current.parent;\n\t}\n\treturn true;\n}\n\n/** Disallow object-dictionary contracts whose direct value type is an unsafe escape hatch. */\nexport const noUnsafeDictionaryTypeRule = defineRule({\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow object-dictionary contracts whose direct value type is unknown, any, object, {}, or a union/alias containing one of those escape hatches.\",\n\t\t},\n\t\tmessages: {\n\t\t\tunsafeDictionary:\n\t\t\t\t\"This dictionary's {{value}} value type gives callers no concrete value contract. Use an owner/schema-derived value type; parse external payloads before insertion.\",\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tlet environment: TypeEnvironment | null = null;\n\t\tconst report = (node: ESTree.Node, value: string) => {\n\t\t\tcontext.report({ node, messageId: \"unsafeDictionary\", data: { value } });\n\t\t};\n\t\tconst reportIfUnsafe = (node: ESTree.TSType) => {\n\t\t\tif (environment === null || !shouldReportType(node, environment)) return;\n\t\t\tconst unsafe = classifyUnsafeDictionary(node, environment);\n\t\t\tif (unsafe === null) return;\n\t\t\treport(node, unsafe.unsafeValue);\n\t\t};\n\n\t\treturn {\n\t\t\tProgram(node) {\n\t\t\t\tenvironment = createTypeEnvironment(\n\t\t\t\t\tnode,\n\t\t\t\t\tcontext.sourceCode.visitorKeys,\n\t\t\t\t);\n\t\t\t},\n\t\t\tTSTypeReference: reportIfUnsafe,\n\t\t\tTSTypeLiteral: reportIfUnsafe,\n\t\t\tTSMappedType: reportIfUnsafe,\n\t\t\tTSIndexSignature(node) {\n\t\t\t\tif (\n\t\t\t\t\tenvironment === null ||\n\t\t\t\t\tnode.typeAnnotation === null ||\n\t\t\t\t\tnode.parent.type === \"TSTypeLiteral\"\n\t\t\t\t)\n\t\t\t\t\treturn;\n\t\t\t\tconst unsafe = classifyUnsafeDictionaryValue(\n\t\t\t\t\tnode.typeAnnotation.typeAnnotation,\n\t\t\t\t\tenvironment,\n\t\t\t\t);\n\t\t\t\tif (unsafe !== null) report(node, unsafe.unsafeValue);\n\t\t\t},\n\t\t};\n\t},\n});\n","// The round trip costs the file its one piece of real evidence: the initializer showed what the\n// value was, the annotation threw that away, and the assertion re-invents it by hand, so a typo in\n// the asserted type is unreachable by the checker. Nothing needs it off, since a value that\n// genuinely arrives unknown is never locally widened.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree, Variable } from \"@oxlint/plugins\";\n\ntype BroadTypeKind = \"top\" | \"object\" | \"record\";\n\ntype KnownValueEvidence = {\n readonly type: ESTree.TSType | null;\n};\n\nconst functionBoundaryTypes = new Set([\n \"ArrowFunctionExpression\",\n \"FunctionDeclaration\",\n \"FunctionExpression\",\n \"TSDeclareFunction\",\n \"TSEmptyBodyFunctionExpression\",\n]);\n\nfunction unwrapExpressionParentheses(expression: ESTree.Expression): ESTree.Expression {\n let current = expression;\n while (current.type === \"ParenthesizedExpression\") current = current.expression;\n return current;\n}\n\nfunction unwrapTypeParentheses(type: ESTree.TSType): ESTree.TSType {\n let current = type;\n while (current.type === \"TSParenthesizedType\") current = current.typeAnnotation;\n return current;\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n return type.typeName.type === \"Identifier\" ? type.typeName.name : null;\n}\n\nfunction isUnknownOrAnyType(type: ESTree.TSType): boolean {\n const unwrapped = unwrapTypeParentheses(type);\n return unwrapped.type === \"TSUnknownKeyword\" || unwrapped.type === \"TSAnyKeyword\";\n}\n\nfunction isBroadRecordKeyType(type: ESTree.TSType): boolean {\n const unwrapped = unwrapTypeParentheses(type);\n if (\n unwrapped.type === \"TSStringKeyword\" ||\n unwrapped.type === \"TSNumberKeyword\" ||\n unwrapped.type === \"TSSymbolKeyword\"\n ) {\n return true;\n }\n if (unwrapped.type === \"TSUnionType\") return unwrapped.types.every(isBroadRecordKeyType);\n return unwrapped.type === \"TSTypeReference\" && typeReferenceName(unwrapped) === \"PropertyKey\";\n}\n\nfunction isBroadRecordType(type: ESTree.TSType): boolean {\n const unwrapped = unwrapTypeParentheses(type);\n\n if (unwrapped.type === \"TSTypeReference\") {\n if (typeReferenceName(unwrapped) === \"Readonly\") {\n const [inner] = unwrapped.typeArguments?.params ?? [];\n return inner !== undefined && isBroadRecordType(inner);\n }\n\n if (typeReferenceName(unwrapped) !== \"Record\") return false;\n const parameters = unwrapped.typeArguments?.params ?? [];\n return (\n parameters.length === 2 &&\n parameters[0] !== undefined &&\n parameters[1] !== undefined &&\n isBroadRecordKeyType(parameters[0]) &&\n isUnknownOrAnyType(parameters[1])\n );\n }\n\n if (unwrapped.type !== \"TSTypeLiteral\" || unwrapped.members.length !== 1) return false;\n const [member] = unwrapped.members;\n const [parameter] = member?.type === \"TSIndexSignature\" ? member.parameters : [];\n return (\n member?.type === \"TSIndexSignature\" &&\n member.parameters.length === 1 &&\n parameter !== undefined &&\n isBroadRecordKeyType(parameter.typeAnnotation.typeAnnotation) &&\n isUnknownOrAnyType(member.typeAnnotation.typeAnnotation)\n );\n}\n\nfunction broadTypeKind(type: ESTree.TSType): BroadTypeKind | null {\n const unwrapped = unwrapTypeParentheses(type);\n if (unwrapped.type === \"TSUnknownKeyword\" || unwrapped.type === \"TSAnyKeyword\") return \"top\";\n if (unwrapped.type === \"TSObjectKeyword\") return \"object\";\n return isBroadRecordType(unwrapped) ? \"record\" : null;\n}\n\nfunction assertedExpression(\n node: ESTree.TSAsExpression | ESTree.TSTypeAssertion,\n): ESTree.Expression {\n return unwrapExpressionParentheses(node.expression);\n}\n\nfunction assertionFromExpression(\n expression: ESTree.Expression,\n): ESTree.TSAsExpression | ESTree.TSTypeAssertion | null {\n const unwrapped = unwrapExpressionParentheses(expression);\n return unwrapped.type === \"TSAsExpression\" || unwrapped.type === \"TSTypeAssertion\"\n ? unwrapped\n : null;\n}\n\nfunction normalizedTypeText(sourceText: string, type: ESTree.TSType): string {\n return sourceText.slice(type.start, type.end).replaceAll(/\\s+/gu, \"\");\n}\n\nfunction typesHaveSameSyntax(\n sourceText: string,\n left: ESTree.TSType | null,\n right: ESTree.TSType,\n): boolean {\n return (\n left !== null &&\n normalizedTypeText(sourceText, unwrapTypeParentheses(left)) ===\n normalizedTypeText(sourceText, unwrapTypeParentheses(right))\n );\n}\n\nfunction isDefinitelyObjectType(type: ESTree.TSType): boolean {\n const unwrapped = unwrapTypeParentheses(type);\n switch (unwrapped.type) {\n case \"TSArrayType\":\n case \"TSConstructorType\":\n case \"TSFunctionType\":\n case \"TSMappedType\":\n case \"TSObjectKeyword\":\n case \"TSTupleType\":\n return true;\n case \"TSTypeLiteral\":\n return unwrapped.members.length > 0;\n case \"TSIntersectionType\":\n return unwrapped.types.every(isDefinitelyObjectType);\n case \"TSTypeOperator\":\n return unwrapped.operator === \"readonly\" && isDefinitelyObjectType(unwrapped.typeAnnotation);\n default:\n return false;\n }\n}\n\nfunction isDefinitelyNarrowerRecordType(type: ESTree.TSType): boolean {\n const unwrapped = unwrapTypeParentheses(type);\n if (unwrapped.type === \"TSTypeLiteral\") {\n return unwrapped.members.some((member) => member.type !== \"TSIndexSignature\");\n }\n\n if (unwrapped.type !== \"TSTypeReference\") return false;\n if (typeReferenceName(unwrapped) === \"Readonly\") {\n const [inner] = unwrapped.typeArguments?.params ?? [];\n return inner !== undefined && isDefinitelyNarrowerRecordType(inner);\n }\n if (typeReferenceName(unwrapped) !== \"Record\") return false;\n\n const parameters = unwrapped.typeArguments?.params ?? [];\n return (\n parameters.length === 2 && parameters[1] !== undefined && !isUnknownOrAnyType(parameters[1])\n );\n}\n\nfunction functionBoundary(node: ESTree.Node): ESTree.Node | null {\n let current = node.parent;\n while (current !== null && current.type !== \"Program\") {\n if (functionBoundaryTypes.has(current.type)) return current;\n current = current.parent;\n }\n return null;\n}\n\nfunction resolvedVariableForIdentifier(\n scopes: readonly {\n readonly references: readonly {\n readonly identifier: ESTree.Node;\n readonly resolved: Variable | null;\n }[];\n }[],\n identifier: ESTree.IdentifierReference,\n): Variable | null {\n for (const scope of scopes) {\n const reference = scope.references.find(\n (candidate) =>\n candidate.identifier.start === identifier.start &&\n candidate.identifier.end === identifier.end,\n );\n if (reference !== undefined) return reference.resolved;\n }\n return null;\n}\n\nfunction variableDeclarator(variable: Variable): ESTree.VariableDeclarator | null {\n for (const definition of variable.defs) {\n if (definition.type === \"Variable\" && definition.node.type === \"VariableDeclarator\") {\n return definition.node;\n }\n }\n return null;\n}\n\nfunction knownValueEvidence(\n expression: ESTree.Expression,\n scopes: Parameters<typeof resolvedVariableForIdentifier>[0],\n boundary: ESTree.Node | null,\n visitedVariables: ReadonlySet<Variable>,\n): KnownValueEvidence | null {\n const unwrapped = unwrapExpressionParentheses(expression);\n\n if (unwrapped.type === \"TSAsExpression\" || unwrapped.type === \"TSTypeAssertion\") {\n if (broadTypeKind(unwrapped.typeAnnotation) !== null) return null;\n return { type: unwrapped.typeAnnotation };\n }\n\n if (unwrapped.type === \"Literal\" || unwrapped.type === \"TemplateLiteral\") {\n return { type: null };\n }\n\n if (\n unwrapped.type === \"ArrayExpression\" ||\n unwrapped.type === \"ArrowFunctionExpression\" ||\n unwrapped.type === \"ClassExpression\" ||\n unwrapped.type === \"FunctionExpression\" ||\n unwrapped.type === \"NewExpression\" ||\n unwrapped.type === \"ObjectExpression\"\n ) {\n return { type: null };\n }\n\n if (unwrapped.type !== \"Identifier\") return null;\n const variable = resolvedVariableForIdentifier(scopes, unwrapped);\n if (variable === null || visitedVariables.has(variable)) return null;\n\n const annotatedIdentifier = variable.identifiers.find(\n (identifier) => identifier.typeAnnotation !== null && identifier.typeAnnotation !== undefined,\n );\n const annotation = annotatedIdentifier?.typeAnnotation?.typeAnnotation;\n if (annotation !== undefined && annotatedIdentifier !== undefined) {\n if (functionBoundary(annotatedIdentifier) !== boundary || broadTypeKind(annotation) !== null) {\n return null;\n }\n return { type: annotation };\n }\n\n const declarator = variableDeclarator(variable);\n if (\n declarator === null ||\n declarator.parent.type !== \"VariableDeclaration\" ||\n declarator.parent.kind !== \"const\" ||\n declarator.init === null ||\n variable.references.some((reference) => reference.isWrite() && !reference.init) ||\n functionBoundary(declarator) !== boundary\n ) {\n return null;\n }\n\n return knownValueEvidence(\n declarator.init,\n scopes,\n boundary,\n new Set([...visitedVariables, variable]),\n );\n}\n\nfunction widenedBinding(\n variable: Variable,\n scopes: Parameters<typeof resolvedVariableForIdentifier>[0],\n): {\n readonly broadKind: BroadTypeKind;\n readonly evidence: KnownValueEvidence;\n readonly declaredAt: number;\n readonly boundary: ESTree.Node | null;\n} | null {\n const declarator = variableDeclarator(variable);\n if (\n declarator === null ||\n declarator.parent.type !== \"VariableDeclaration\" ||\n declarator.parent.kind !== \"const\" ||\n declarator.id.type !== \"Identifier\" ||\n declarator.init === null ||\n variable.references.some((reference) => reference.isWrite() && !reference.init)\n ) {\n return null;\n }\n\n const boundary = functionBoundary(declarator);\n const declaredType = declarator.id.typeAnnotation?.typeAnnotation;\n const initializerAssertion = assertionFromExpression(declarator.init);\n const initializerBroadKind =\n initializerAssertion === null ? null : broadTypeKind(initializerAssertion.typeAnnotation);\n const declaredBroadKind = declaredType === undefined ? null : broadTypeKind(declaredType);\n const broadKind = declaredBroadKind ?? initializerBroadKind;\n if (broadKind === null) return null;\n\n const originalExpression =\n initializerAssertion !== null && initializerBroadKind !== null\n ? assertedExpression(initializerAssertion)\n : declarator.init;\n const evidence = knownValueEvidence(originalExpression, scopes, boundary, new Set([variable]));\n return evidence === null ? null : { broadKind, evidence, declaredAt: declarator.end, boundary };\n}\n\nfunction assertionIsNarrower(\n sourceText: string,\n broadKind: BroadTypeKind,\n evidence: KnownValueEvidence,\n assertedType: ESTree.TSType,\n): boolean {\n if (broadTypeKind(assertedType) !== null) return false;\n if (broadKind === \"top\") return true;\n if (typesHaveSameSyntax(sourceText, evidence.type, assertedType)) return true;\n if (broadKind === \"object\") return isDefinitelyObjectType(assertedType);\n return isDefinitelyNarrowerRecordType(assertedType);\n}\n\n/** Detect immutable local bindings that erase a known type and are later asserted back to a narrower type. */\nexport const noWidenThenAssertRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow local const flows that explicitly widen a known value before asserting the widened binding to a narrower type.\",\n },\n messages: {\n widenThenAssert:\n 'Binding \"{{name}}\" discards type evidence and later recreates it with an assertion. Keep the precise type from initialization through use; parse boundary input once.',\n },\n },\n createOnce(context) {\n let scopes: Parameters<typeof resolvedVariableForIdentifier>[0] = [];\n\n const checkAssertion = (node: ESTree.TSAsExpression | ESTree.TSTypeAssertion) => {\n const expression = assertedExpression(node);\n if (expression.type !== \"Identifier\") return;\n\n const variable = resolvedVariableForIdentifier(scopes, expression);\n if (variable === null) return;\n const widened = widenedBinding(variable, scopes);\n if (\n widened === null ||\n node.start <= widened.declaredAt ||\n functionBoundary(node) !== widened.boundary ||\n !assertionIsNarrower(\n context.sourceCode.text,\n widened.broadKind,\n widened.evidence,\n node.typeAnnotation,\n )\n ) {\n return;\n }\n\n context.report({\n node,\n messageId: \"widenThenAssert\",\n data: { name: expression.name },\n });\n };\n\n return {\n Program() {\n scopes = context.sourceCode.scopeManager.scopes;\n },\n TSAsExpression: checkAssertion,\n TSTypeAssertion: checkAssertion,\n };\n },\n});\n","// An assertion is a claim the checker cannot verify, so the sentence naming the check that already\n// ran is the only thing that makes it reviewable. Scope it off for test files, where a fixture's\n// assertions are all the same claim and repeating it is noise rather than review material; one\n// consumer measured 53 of them.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree, SourceCode } from \"@oxlint/plugins\";\n\ntype TypeAssertion = ESTree.TSAsExpression | ESTree.TSTypeAssertion;\n\nconst DEFAULT_SAFETY_MARKERS = [\"SAFETY\"] as const;\n\nconst commentOwnerKinds = new Set([\n \"ExpressionStatement\",\n \"PropertyDefinition\",\n \"ReturnStatement\",\n \"ThrowStatement\",\n \"VariableDeclaration\",\n]);\n\nfunction isConstAssertion(node: TypeAssertion): boolean {\n return (\n node.typeAnnotation.type === \"TSTypeReference\" &&\n node.typeAnnotation.typeName.type === \"Identifier\" &&\n node.typeAnnotation.typeName.name === \"const\"\n );\n}\n\nfunction configuredSafetyMarkers(option: unknown): readonly string[] {\n if (typeof option !== \"object\" || option === null || !(\"markers\" in option)) {\n return DEFAULT_SAFETY_MARKERS;\n }\n const configured = option.markers;\n if (!Array.isArray(configured)) return DEFAULT_SAFETY_MARKERS;\n const markers = configured.flatMap((marker) =>\n typeof marker === \"string\" && marker.trim().length > 0 ? [marker.trim()] : [],\n );\n return markers.length > 0 ? markers : DEFAULT_SAFETY_MARKERS;\n}\n\nfunction markerPattern(markers: readonly string[]): RegExp {\n const alternation = markers\n .map((marker) => marker.replaceAll(/[.*+?^${}()|[\\]\\\\]/gu, String.raw`\\$&`))\n .join(\"|\");\n return new RegExp(\n String.raw`(?:^|[^\\p{L}\\p{N}_])(?:${alternation})\\s*:\\s*\\S`,\n \"u\",\n );\n}\n\nfunction hasSafetyJustificationBefore(\n sourceCode: SourceCode,\n owner: ESTree.Node,\n assertion: TypeAssertion,\n pattern: RegExp,\n): boolean {\n return sourceCode\n .getCommentsBefore(owner)\n .some(\n (comment) => comment.end <= assertion.start && pattern.test(comment.value),\n );\n}\n\nfunction hasSafetyComment(\n sourceCode: SourceCode,\n node: TypeAssertion,\n pattern: RegExp,\n): boolean {\n let current: ESTree.Node = node;\n while (true) {\n if (hasSafetyJustificationBefore(sourceCode, current, node, pattern)) return true;\n if (commentOwnerKinds.has(current.type)) {\n const exportDeclaration = current.parent;\n return (\n exportDeclaration.type === \"ExportNamedDeclaration\" &&\n exportDeclaration.declaration === current &&\n hasSafetyJustificationBefore(sourceCode, exportDeclaration, node, pattern)\n );\n }\n if (current.parent.type === \"Program\") return false;\n current = current.parent;\n }\n}\n\n/** Require every non-const type assertion to state the invariant TypeScript cannot express. */\nexport const requireSafetyCommentForTypeAssertionRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Require a nearby SAFETY comment for every TypeScript type assertion except const assertions.\",\n },\n messages: {\n missingSafetyComment:\n \"This type assertion has no `{{marker}}:` justification. State the checked invariant immediately before the assertion or its containing statement.\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n markers: {\n type: \"array\",\n items: { type: \"string\", minLength: 1 },\n minItems: 1,\n uniqueItems: true,\n },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ markers: [\"SAFETY\"] }],\n },\n createOnce(context) {\n const patterns = new Map<string, RegExp>();\n\n const checkAssertion = (node: TypeAssertion) => {\n if (isConstAssertion(node)) return;\n const markers = configuredSafetyMarkers(context.options?.[0]);\n const patternKey = markers.join(\"\\u0000\");\n const pattern = patterns.get(patternKey) ?? markerPattern(markers);\n patterns.set(patternKey, pattern);\n if (hasSafetyComment(context.sourceCode, node, pattern)) return;\n context.report({\n node,\n messageId: \"missingSafetyComment\",\n data: { marker: markers[0] ?? DEFAULT_SAFETY_MARKERS[0] },\n });\n };\n\n return {\n TSAsExpression: checkAssertion,\n TSTypeAssertion: checkAssertion,\n };\n },\n});\n","import type { Options } from \"@oxlint/plugins\";\n\ntype OptionValue = Options[number];\n\n/**\n * Rule options arrive as parsed JSON from the linter config, so this is the one\n * place their shape is checked. Returns the first option when it is an object.\n */\nfunction firstOptionObject(options: Readonly<Options>): { readonly [key: string]: OptionValue } {\n const first = options[0];\n return typeof first === \"object\" && first !== null && !Array.isArray(first) ? first : {};\n}\n\n/** A string-valued key of the first option object, or undefined when absent or not a string. */\nexport function stringOption(options: Readonly<Options>, key: string): string | undefined {\n const value = firstOptionObject(options)[key];\n return typeof value === \"string\" ? value : undefined;\n}\n","// A string typed into a component is a string no translator will ever see, and it is found again\n// only when someone reads that file. Sending every visible word through the dictionary makes the\n// set of strings on screen countable. Scope it off for a surface no user reads in their own\n// language: a debug screen, a developer tools panel, a component gallery.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport { stringOption } from \"../shared/rule-options.ts\";\n\n// Three letters in a row, in any script. Digits, separators and bullets are not words.\nconst defaultWordPattern = String.raw`\\p{L}{3,}`;\n\n/** A string literal that is the whole expression of `{...}` placed among an element's children. */\nfunction isChildStringLiteral(\n node: ESTree.JSXExpressionContainer,\n): node is ESTree.JSXExpressionContainer & {\n readonly expression: ESTree.StringLiteral;\n} {\n const { expression, parent } = node;\n if (expression.type !== \"Literal\" || typeof expression.value !== \"string\") return false;\n return parent.type === \"JSXElement\" || parent.type === \"JSXFragment\";\n}\n\n/** Reject words written straight into JSX instead of coming from the translation dictionary. */\nexport const noHardcodedJsxTextRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow literal words in JSX children; every string on screen comes from the translation dictionary.\",\n },\n messages: {\n hardcodedText:\n \"Do not write words straight into JSX. Every string on screen comes from the translation dictionary.\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n pattern: { type: \"string\" },\n },\n additionalProperties: false,\n },\n ],\n },\n create(context) {\n const word = new RegExp(stringOption(context.options, \"pattern\") ?? defaultWordPattern, \"u\");\n return {\n JSXText(node) {\n if (word.test(node.value)) context.report({ node, messageId: \"hardcodedText\" });\n },\n JSXExpressionContainer(node) {\n if (isChildStringLiteral(node) && word.test(node.expression.value)) {\n context.report({ node: node.expression, messageId: \"hardcodedText\" });\n }\n },\n };\n },\n});\n","// An effect that computes state runs after the render that needed it, so the screen paints once\n// with the old value and again with the new one, and the dependency array becomes the place bugs\n// hide. Deriving during render, acting in the event handler and subscribing through a reactive\n// query cover the rest. Scope it off for the single file that wraps the hook, since a genuine\n// external subscription needs a real effect somewhere.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport { stringOption } from \"../shared/rule-options.ts\";\n\nconst effectHooks = new Set([\"useEffect\", \"useLayoutEffect\"]);\n\n/** The name a member expression reads, written `.useEffect` or `[\"useEffect\"]`; null when the key is not a literal name. */\nfunction memberPropertyName(node: ESTree.MemberExpression): string | null {\n const { property } = node;\n if (!node.computed) return property.type === \"Identifier\" ? property.name : null;\n return property.type === \"Literal\" && typeof property.value === \"string\" ? property.value : null;\n}\n\n/** The effect hook a call reaches, called bare (`useEffect(...)`) or through a member (`React.useEffect(...)`, `React[\"useEffect\"](...)`). */\nfunction calledEffectHook(callee: ESTree.Expression): string | null {\n if (callee.type === \"Identifier\") return effectHooks.has(callee.name) ? callee.name : null;\n if (callee.type !== \"MemberExpression\") return null;\n const name = memberPropertyName(callee);\n return name !== null && effectHooks.has(name) ? name : null;\n}\n\nfunction importedName(specifier: ESTree.ImportSpecifier): string {\n return specifier.imported.type === \"Identifier\"\n ? specifier.imported.name\n : specifier.imported.value;\n}\n\nfunction isTypeOnly(specifier: ESTree.ImportSpecifier): boolean {\n const declaration = specifier.parent;\n return (\n specifier.importKind === \"type\" ||\n (declaration.type === \"ImportDeclaration\" && declaration.importKind === \"type\")\n );\n}\n\n/** Reject `useEffect` and `useLayoutEffect`, called or imported. */\nexport const noUseEffectRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow useEffect and useLayoutEffect; derive during render, act in the event handler, or subscribe through a reactive query.\",\n },\n messages: {\n noEffect:\n \"Do not call {{name}}. Derive the value during render, do the work in the event handler, or subscribe through a reactive query.\",\n noEffectWithHint:\n \"Do not call {{name}}. Derive the value during render, do the work in the event handler, or subscribe through a reactive query. {{hint}}\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n hint: { type: \"string\" },\n },\n additionalProperties: false,\n },\n ],\n },\n create(context) {\n const hint = stringOption(context.options, \"hint\");\n const report = (node: ESTree.Node, name: string): void => {\n if (hint === undefined) {\n context.report({ node, messageId: \"noEffect\", data: { name } });\n } else {\n context.report({ node, messageId: \"noEffectWithHint\", data: { name, hint } });\n }\n };\n return {\n CallExpression(node) {\n const name = calledEffectHook(node.callee);\n if (name !== null) report(node, name);\n },\n ImportSpecifier(node) {\n if (isTypeOnly(node)) return;\n const name = importedName(node);\n if (effectHooks.has(name)) report(node, name);\n },\n };\n },\n});\n","// Expo replaces each `process.env.EXPO_PUBLIC_*` read textually at bundle time, so there is no\n// `process.env` object on the device: anything the substitution cannot see is `undefined` at\n// runtime and nothing fails at build time. Scope it off for code that never enters the app bundle,\n// a build script or a config file, anywhere `process.env` is a real object under Node.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\n// Measured against babel-preset-expo 54.0.12 (2026-09-18). `build/inline-env-vars.js`\n// registers a Babel `MemberExpression` visitor, matches the object with\n// `matchesPattern(\"process.env\")` and takes the key from `toComputedKey()`, which is a\n// string literal only for `.NAME` and `[\"NAME\"]`; `build/define-plugin.js` matches the\n// same way for `NODE_ENV` and the `EXPO_*` table. So the four shapes it replaces are\n// `process.env.NAME`, `process.env[\"NAME\"]`, `process[\"env\"].NAME` and\n// `process[\"env\"][\"NAME\"]`. It skips the left side of an assignment, it leaves a\n// template, a number and a computed variable alone, and it never sees an optional chain,\n// which Babel parses as `OptionalMemberExpression`, a node neither visitor is registered\n// for. This rule is the mirror of that list. It judges the shape and never the name:\n// which names carry a value depends on the bundler's environment and its define table.\n\n/** The name a member expression reads, the way Babel's `toComputedKey` does: `.NAME` and `[\"NAME\"]` only. */\nfunction literalKeyName(node: ESTree.MemberExpression): string | null {\n const { property } = node;\n if (!node.computed) return property.type === \"Identifier\" ? property.name : null;\n return property.type === \"Literal\" && typeof property.value === \"string\" ? property.value : null;\n}\n\n/** Whether a member expression is `process.env` or `process[\"env\"]`, the object the inliner matches. */\nfunction isProcessEnv(node: ESTree.MemberExpression): boolean {\n return (\n node.object.type === \"Identifier\" &&\n node.object.name === \"process\" &&\n literalKeyName(node) === \"env\"\n );\n}\n\n/** Whether a pattern takes `process.env` apart, in a declaration or in an assignment. */\nfunction isDestructured(node: ESTree.MemberExpression): boolean {\n const { parent } = node;\n let target: ESTree.Node | null = null;\n if (parent.type === \"VariableDeclarator\" && parent.init === node) target = parent.id;\n if (parent.type === \"AssignmentExpression\" && parent.right === node) target = parent.left;\n return target !== null && (target.type === \"ObjectPattern\" || target.type === \"ArrayPattern\");\n}\n\ntype ReadProblem = \"assigned\" | \"computed\" | \"literalKey\" | \"optionalChain\";\n\n/** What is wrong with a `process.env.KEY` read, or null when Expo replaces that exact shape. */\nfunction readProblem(\n env: ESTree.MemberExpression,\n read: ESTree.MemberExpression,\n): ReadProblem | null {\n const { parent } = read;\n if (parent.type === \"AssignmentExpression\" && parent.left === read) return \"assigned\";\n if (env.optional || read.optional) return \"optionalChain\";\n if (literalKeyName(read) !== null) return null;\n return read.property.type === \"Literal\" || read.property.type === \"TemplateLiteral\"\n ? \"literalKey\"\n : \"computed\";\n}\n\n/** Reject every use of `process.env` that Expo's textual inlining cannot see. */\nexport const staticPublicEnvRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Allow only the `process.env` reads Expo replaces at bundle time; everything else is undefined on the device.\",\n },\n messages: {\n destructured:\n \"Expo replaces each `process.env.EXPO_PUBLIC_*` read textually at bundle time, so there is no `process.env` object to destructure on the device. Read each variable as `process.env.NAME`.\",\n computed:\n \"Expo replaces each `process.env.EXPO_PUBLIC_*` read textually at bundle time, so a key it has to evaluate is undefined on the device. Read the variable as `process.env.NAME` with the name spelled out.\",\n literalKey:\n \"Expo reads a computed key only when it is a string literal, so a template or a number leaves the read in the bundle and it is undefined on the device. Read the variable as `process.env.NAME`.\",\n optionalChain:\n \"Expo's inliner never sees an optional chain, so `process.env?.NAME` survives into the bundle and is undefined on the device. Read the variable as `process.env.NAME`.\",\n assigned:\n \"Expo replaces reads, not writes: an assignment to `process.env` stays in the bundle and no inlined read will ever see it. Set the variable in the environment the bundler reads.\",\n bareValue:\n \"Expo replaces each `process.env.EXPO_PUBLIC_*` read textually at bundle time, so `process.env` passed around as a value is empty on the device. Read each variable as `process.env.NAME`.\",\n },\n },\n create(context) {\n return {\n MemberExpression(node) {\n if (!isProcessEnv(node)) return;\n const { parent } = node;\n if (parent.type === \"MemberExpression\" && parent.object === node) {\n const problem = readProblem(node, parent);\n if (problem !== null) context.report({ node: parent, messageId: problem });\n return;\n }\n if (isDestructured(node)) {\n context.report({ node: parent, messageId: \"destructured\" });\n return;\n }\n context.report({ node, messageId: \"bareValue\" });\n },\n };\n },\n});\n","import { eslintCompatPlugin } from \"@oxlint/plugins\";\n\nimport { noArrayFilterMapRule } from \"./anti-slop/rules/no-array-filter-map.ts\";\nimport { noChainedTypeAssertionsRule } from \"./anti-slop/rules/no-chained-type-assertions.ts\";\nimport { noConditionalEmptyObjectSpreadRule } from \"./anti-slop/rules/no-conditional-empty-object-spread.ts\";\nimport { noKnownValueWideningRule } from \"./anti-slop/rules/no-known-value-widening.ts\";\nimport { noModuleMockingRule } from \"./anti-slop/rules/no-module-mocking.ts\";\nimport { noObjectParametersRule } from \"./anti-slop/rules/no-object-parameters.ts\";\nimport { noReduceAccumulatorCopyRule } from \"./anti-slop/rules/no-reduce-accumulator-copy.ts\";\nimport { noReflectApplyRule } from \"./anti-slop/rules/no-reflect-apply.ts\";\nimport { noReflectGetRule } from \"./anti-slop/rules/no-reflect-get.ts\";\nimport { noRuntimeTypeofRule } from \"./anti-slop/rules/no-runtime-typeof.ts\";\nimport { noForbiddenTermInSymbolNamesRule } from \"./anti-slop/rules/no-shape-in-symbol-names.ts\";\nimport { noUnknownParametersRule } from \"./anti-slop/rules/no-unknown-parameters.ts\";\nimport { noUnknownReturnsRule } from \"./anti-slop/rules/no-unknown-returns.ts\";\nimport { noUnknownTypeAliasesRule } from \"./anti-slop/rules/no-unknown-type-aliases.ts\";\nimport { noUnsafeDictionaryTypeRule } from \"./anti-slop/rules/no-unsafe-dictionary-type.ts\";\nimport { noWidenThenAssertRule } from \"./anti-slop/rules/no-widen-then-assert.ts\";\nimport { requireSafetyCommentForTypeAssertionRule } from \"./anti-slop/rules/require-safety-comment-for-type-assertion.ts\";\nimport { noHardcodedJsxTextRule } from \"./rules/no-hardcoded-jsx-text.ts\";\nimport { noUseEffectRule } from \"./rules/no-use-effect.ts\";\nimport { staticPublicEnvRule } from \"./rules/static-public-env.ts\";\n\n// One plugin, one prefix. `rdjperron` is not on oxlint's reserved list, so the same\n// name works as a `jsPlugins` alias and as the prefix in every diagnostic and\n// every disable comment. `eslintCompatPlugin` adds a `create` shim to each\n// `createOnce` rule, which is what lets these run under ESLint as well.\nconst rdjperronPlugin = eslintCompatPlugin({\n meta: { name: \"rdjperron\" },\n rules: {\n \"no-array-filter-map\": noArrayFilterMapRule,\n \"no-chained-type-assertions\": noChainedTypeAssertionsRule,\n \"no-conditional-empty-object-spread\": noConditionalEmptyObjectSpreadRule,\n \"no-hardcoded-jsx-text\": noHardcodedJsxTextRule,\n \"no-known-value-widening\": noKnownValueWideningRule,\n \"no-module-mocking\": noModuleMockingRule,\n \"no-object-parameters\": noObjectParametersRule,\n \"no-reduce-accumulator-copy\": noReduceAccumulatorCopyRule,\n \"no-reflect-apply\": noReflectApplyRule,\n \"no-reflect-get\": noReflectGetRule,\n \"no-runtime-typeof\": noRuntimeTypeofRule,\n \"no-shape-in-symbol-names\": noForbiddenTermInSymbolNamesRule,\n \"no-unknown-parameters\": noUnknownParametersRule,\n \"no-unknown-returns\": noUnknownReturnsRule,\n \"no-unknown-type-aliases\": noUnknownTypeAliasesRule,\n \"no-unsafe-dictionary-type\": noUnsafeDictionaryTypeRule,\n \"no-use-effect\": noUseEffectRule,\n \"no-widen-then-assert\": noWidenThenAssertRule,\n \"require-safety-comment-for-type-assertion\": requireSafetyCommentForTypeAssertionRule,\n \"static-public-env\": staticPublicEnvRule,\n },\n});\n\nexport default rdjperronPlugin;\n"],"mappings":";;;AAGA,SAAgB,sBAAsB,MAAgC;CACpE,OACE,KAAK,SAAS,6BACd,KAAK,SAAS,qBACd,KAAK,SAAS,oBACd,KAAK,SAAS,qBACd,KAAK,SAAS,yBACd,KAAK,SAAS,yBAEd,OAAO,KAAK;CAEd,OAAO;AACT;;AAGA,SAAgB,oBAAoB,YAAwB,MAAoC;CAC9F,OAAO,sBAAsB,IAAI;CACjC,IAAI,KAAK,SAAS,cAAc,OAAO;CACvC,IAAI,QAAsB,WAAW,SAAS,IAAI;CAClD,OAAO,UAAU,MAAM;EACrB,MAAM,WAAW,MAAM,IAAI,IAAI,KAAK,IAAI;EACxC,IAAI,aAAa,KAAA,GAAW,OAAO;EACnC,QAAQ,MAAM;CAChB;CACA,OAAO;AACT;;AAGA,SAAgB,kBACd,MACgE;CAChE,OAAO,sBAAsB,IAAI;CACjC,IAAI,KAAK,SAAS,oBAAoB,OAAO;CAC7C,MAAM,WAAW,KAAK;CACtB,IAAI,CAAC,KAAK,YAAY,SAAS,SAAS,cACtC,OAAO;EAAE,MAAM,SAAS;EAAM,QAAQ,KAAK;CAAO;CAEpD,IAAI,KAAK,YAAY,SAAS,SAAS,aAAa,OAAO,SAAS,UAAU,UAC5E,OAAO;EAAE,MAAM,SAAS;EAAO,QAAQ,KAAK;CAAO;CAErD,OAAO;AACT;AAEA,SAAS,kBAAkB,MAA8B;CACvD,IAAI,KAAK,SAAS,iBAAiB,KAAK,SAAS,eAAe,OAAO;CACvE,IAAI,KAAK,SAAS,uBAAuB,OAAO,kBAAkB,KAAK,cAAc;CACrF,IAAI,KAAK,SAAS,oBAAoB,KAAK,aAAa,YACtD,OAAO,kBAAkB,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U;GACR,cACE;GACF,UACE;GACF,YACE;GACF,eACE;GACF,UACE;GACF,WACE;EACJ;CACF;CACA,OAAO,SAAS;EACd,OAAO,EACL,iBAAiB,MAAM;GACrB,IAAI,CAAC,aAAa,IAAI,GAAG;GACzB,MAAM,EAAE,WAAW;GACnB,IAAI,OAAO,SAAS,sBAAsB,OAAO,WAAW,MAAM;IAChE,MAAM,UAAU,YAAY,MAAM,MAAM;IACxC,IAAI,YAAY,MAAM,QAAQ,OAAO;KAAE,MAAM;KAAQ,WAAW;IAAQ,CAAC;IACzE;GACF;GACA,IAAI,eAAe,IAAI,GAAG;IACxB,QAAQ,OAAO;KAAE,MAAM;KAAQ,WAAW;IAAe,CAAC;IAC1D;GACF;GACA,QAAQ,OAAO;IAAE;IAAM,WAAW;GAAY,CAAC;EACjD,EACF;CACF;AACF,CAAC;;;AC5ED,MAAM,kBAAkB,mBAAmB;CACzC,MAAM,EAAE,MAAM,YAAY;CAC1B,OAAO;EACL,uBAAuB;EACvB,8BAA8B;EAC9B,sCAAsC;EACtC,yBAAyB;EACzB,2BAA2B;EAC3B,qBAAqB;EACrB,wBAAwB;EACxB,8BAA8B;EAC9B,oBAAoB;EACpB,kBAAkB;EAClB,qBAAqB;EACrB,4BAA4B;EAC5B,yBAAyB;EACzB,sBAAsB;EACtB,2BAA2B;EAC3B,6BAA6B;EAC7B,iBAAiB;EACjB,wBAAwB;EACxB,6CAA6C;EAC7C,qBAAqB;CACvB;AACF,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["isConstAssertion","isEmptyObjectExpression","isNode","typeReferenceName","typeReferenceName","variableDeclarator","importedName","typeReferenceName"],"sources":["../src/anti-slop/shared/array-method.ts","../src/anti-slop/rules/no-array-filter-map.ts","../src/anti-slop/rules/no-chained-type-assertions.ts","../src/anti-slop/rules/no-conditional-empty-object-spread.ts","../src/anti-slop/shared/lexical-type-parameters.ts","../src/anti-slop/shared/type-alias-resolution.ts","../src/anti-slop/shared/dictionary-types.ts","../src/anti-slop/shared/function-parameters.ts","../src/anti-slop/shared/scope.ts","../src/anti-slop/rules/no-known-value-widening.ts","../src/anti-slop/rules/no-module-mocking.ts","../src/anti-slop/rules/no-object-parameters.ts","../src/anti-slop/rules/no-reduce-accumulator-copy.ts","../src/anti-slop/shared/reflect-method.ts","../src/anti-slop/rules/no-reflect-apply.ts","../src/anti-slop/rules/no-reflect-get.ts","../src/anti-slop/rules/no-runtime-typeof.ts","../src/anti-slop/rules/no-shape-in-symbol-names.ts","../src/anti-slop/rules/no-unknown-parameters.ts","../src/anti-slop/rules/no-unknown-returns.ts","../src/anti-slop/rules/no-unknown-type-aliases.ts","../src/anti-slop/rules/no-unsafe-dictionary-type.ts","../src/anti-slop/rules/no-widen-then-assert.ts","../src/anti-slop/rules/require-safety-comment-for-type-assertion.ts","../src/shared/rule-options.ts","../src/rules/no-hardcoded-jsx-text.ts","../src/rules/no-use-effect.ts","../src/rules/static-public-env.ts","../src/index.ts"],"sourcesContent":["import type { ESTree, Scope, SourceCode, Variable } from \"@oxlint/plugins\";\n\n/** Unwrap syntax-only wrappers when inspecting array methods and accumulator references. */\nexport function unwrapArrayExpression(node: ESTree.Node): ESTree.Node {\n while (\n node.type === \"ParenthesizedExpression\" ||\n node.type === \"ChainExpression\" ||\n node.type === \"TSAsExpression\" ||\n node.type === \"TSTypeAssertion\" ||\n node.type === \"TSNonNullExpression\" ||\n node.type === \"TSSatisfiesExpression\"\n ) {\n node = node.expression;\n }\n return node;\n}\n\n/** Resolve a local binding by scope, not by identifier spelling. */\nexport function resolveArrayBinding(sourceCode: SourceCode, node: ESTree.Node): Variable | null {\n node = unwrapArrayExpression(node);\n if (node.type !== \"Identifier\") return null;\n let scope: Scope | null = sourceCode.getScope(node);\n while (scope !== null) {\n const variable = scope.set.get(node.name);\n if (variable !== undefined) return variable;\n scope = scope.upper;\n }\n return null;\n}\n\n/** Read static method names, including computed string literals, without evaluating expressions. */\nexport function arrayMethodTarget(\n node: ESTree.Node,\n): { readonly name: string; readonly object: ESTree.Node } | null {\n node = unwrapArrayExpression(node);\n if (node.type !== \"MemberExpression\") return null;\n const property = node.property;\n if (!node.computed && property.type === \"Identifier\") {\n return { name: property.name, object: node.object };\n }\n if (node.computed && property.type === \"Literal\" && typeof property.value === \"string\") {\n return { name: property.value, object: node.object };\n }\n return null;\n}\n\nfunction isArrayAnnotation(type: ESTree.TSType): boolean {\n if (type.type === \"TSArrayType\" || type.type === \"TSTupleType\") return true;\n if (type.type === \"TSParenthesizedType\") return isArrayAnnotation(type.typeAnnotation);\n if (type.type === \"TSTypeOperator\" && type.operator === \"readonly\") {\n return isArrayAnnotation(type.typeAnnotation);\n }\n return (\n type.type === \"TSTypeReference\" && type.typeName.type === \"Identifier\" &&\n (type.typeName.name === \"Array\" || type.typeName.name === \"ReadonlyArray\")\n );\n}\n\n/** Recognize local array evidence; unknown receivers and iterator pipelines are deliberately excluded. */\nexport function isKnownArrayExpression(\n sourceCode: SourceCode,\n node: ESTree.Node,\n visited = new Set<Variable>(),\n): boolean {\n node = unwrapArrayExpression(node);\n if (node.type === \"ArrayExpression\") return true;\n if (node.type === \"CallExpression\") {\n const method = arrayMethodTarget(node.callee);\n return (\n method !== null &&\n [\"map\", \"filter\", \"flatMap\", \"slice\", \"concat\", \"toSorted\", \"toReversed\", \"toSpliced\"].includes(method.name) &&\n isKnownArrayExpression(sourceCode, method.object, visited)\n );\n }\n if (node.type !== \"Identifier\") return false;\n const variable = resolveArrayBinding(sourceCode, node);\n if (variable === null || visited.has(variable)) return false;\n visited.add(variable);\n if (variable.references.some(reference => reference.isWrite() && !reference.init)) return false;\n for (const identifier of variable.identifiers) {\n const annotation = identifier.typeAnnotation?.typeAnnotation;\n if (annotation !== undefined) return isArrayAnnotation(annotation);\n }\n for (const definition of variable.defs) {\n if (\n definition.type === \"Variable\" && definition.node.type === \"VariableDeclarator\" &&\n definition.node.id.type === \"Identifier\" && definition.node.init !== null &&\n definition.node.parent.type === \"VariableDeclaration\" && definition.node.parent.kind === \"const\"\n ) {\n return isKnownArrayExpression(sourceCode, definition.node.init, visited);\n }\n }\n return false;\n}\n","// Two adjacent passes walk the data twice and allocate an array nobody reads, and a reviewer has\n// to hold both callbacks in mind to see what one pass would have produced. Nothing needs an\n// exception: `flatMap` and a plain loop both satisfy the rule, so fix the call instead of scoping\n// it off.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport { arrayMethodTarget, isKnownArrayExpression, unwrapArrayExpression } from \"../shared/array-method.ts\";\n\n/** Reject eager array filter/map pipelines; lazy iterator helpers remain allowed. */\nexport const noArrayFilterMapRule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: { description: \"Disallow adjacent array filter/map passes in favor of lazy iterator helpers or a single transformation.\" },\n messages: {\n arrayFilterMap: \"Avoid consecutive array `{{first}}` and `{{second}}` passes. Prefer `.values().{{first}}(...).{{second}}(...).toArray()` where iterator helpers are supported, or a single `flatMap`/mutating reducer. Preserve callback ordering, indexes, and filtering semantics.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const outer = arrayMethodTarget(node.callee);\n if (outer === null || (outer.name !== \"map\" && outer.name !== \"filter\")) return;\n const innerCall = unwrapArrayExpression(outer.object);\n if (innerCall.type !== \"CallExpression\") return;\n const inner = arrayMethodTarget(innerCall.callee);\n if (inner === null || inner.name !== (outer.name === \"map\" ? \"filter\" : \"map\")) return;\n if (!isKnownArrayExpression(context.sourceCode, inner.object)) return;\n context.report({ node, messageId: \"arrayFilterMap\", data: { first: inner.name, second: outer.name } });\n },\n };\n },\n});\n","// `input as unknown as User` exists to make the compiler stop objecting. The first assertion\n// throws away what the value was, the second invents what it now is, and nothing checked the value\n// in between. Nothing legitimate needs a chain, so drop the laundering step and let the\n// safety-comment rule ask what the remaining assertion knows.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree } from \"@oxlint/plugins\";\n\ntype TypeAssertionExpression = ESTree.TSAsExpression | ESTree.TSTypeAssertion;\n\nfunction isTypeAssertionExpression(node: ESTree.Node): node is TypeAssertionExpression {\n return node.type === \"TSAsExpression\" || node.type === \"TSTypeAssertion\";\n}\n\nfunction unwrapParenthesizedExpression(expression: ESTree.Expression): ESTree.Expression {\n let current = expression;\n while (current.type === \"ParenthesizedExpression\") {\n current = current.expression;\n }\n return current;\n}\n\nfunction isConstAssertion(node: TypeAssertionExpression): boolean {\n const { typeAnnotation } = node;\n return (\n typeAnnotation.type === \"TSTypeReference\" &&\n typeAnnotation.typeName.type === \"Identifier\" &&\n typeAnnotation.typeName.name === \"const\"\n );\n}\n\nfunction isOutermostAssertionInChain(node: TypeAssertionExpression): boolean {\n let current: ESTree.Expression = node;\n let parent = node.parent;\n\n while (parent.type === \"ParenthesizedExpression\" && parent.expression === current) {\n current = parent;\n parent = parent.parent;\n }\n\n return !isTypeAssertionExpression(parent) || parent.expression !== current;\n}\n\nfunction isForbiddenAssertionChain(node: TypeAssertionExpression): boolean {\n let assertionCount = 0;\n let hasNonConstAssertion = false;\n let current: ESTree.Expression = node;\n\n while (isTypeAssertionExpression(current)) {\n assertionCount += 1;\n hasNonConstAssertion ||= !isConstAssertion(current);\n current = unwrapParenthesizedExpression(current.expression);\n }\n\n return assertionCount > 1 && hasNonConstAssertion;\n}\n\n/** Disallow nested TypeScript type assertions, while permitting chains made only of const assertions. */\nexport const noChainedTypeAssertionsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow chained TypeScript as and angle-bracket assertions, including parenthesized chains.\",\n },\n messages: {\n chained:\n \"This assertion chain discards type evidence. Keep the original precise type, or parse untrusted input at its boundary before narrowing it.\",\n },\n },\n createOnce(context) {\n const checkTypeAssertion = (node: TypeAssertionExpression) => {\n if (!isOutermostAssertionInChain(node) || !isForbiddenAssertionChain(node)) return;\n context.report({ node, messageId: \"chained\" });\n };\n\n return {\n TSAsExpression: checkTypeAssertion,\n TSTypeAssertion: checkTypeAssertion,\n };\n },\n});\n","// `...(value !== undefined ? { value } : {})` is how a field becomes optional without anyone\n// saying so: the object's keys can be read only by evaluating the conditional. Nothing needs it\n// off, since building the object in statements states the omission where a reader looks for it.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree } from \"@oxlint/plugins\";\n\nfunction unwrapParentheses(node: ESTree.Expression): ESTree.Expression {\n let current = node;\n while (current.type === \"ParenthesizedExpression\") {\n current = current.expression;\n }\n return current;\n}\n\nfunction isEmptyObjectExpression(node: ESTree.Expression): boolean {\n return node.type === \"ObjectExpression\" && node.properties.length === 0;\n}\n\nfunction isConditionalEmptyObjectSpread(node: ESTree.Expression): boolean {\n const conditional = unwrapParentheses(node);\n return (\n conditional.type === \"ConditionalExpression\" &&\n (isEmptyObjectExpression(conditional.consequent) ||\n isEmptyObjectExpression(conditional.alternate))\n );\n}\n\n/** Ban conditional empty-object spreads without changing their omission semantics. */\nexport const noConditionalEmptyObjectSpreadRule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow object spreads that conditionally spread an empty object to omit fields.\",\n },\n messages: {\n avoid:\n \"This conditional spread hides property omission behind an empty object. Build the object in separate statements and add the property only when present.\",\n },\n },\n createOnce(context) {\n return {\n SpreadElement(node) {\n if (node.parent.type !== \"ObjectExpression\") return;\n\n if (isConditionalEmptyObjectSpread(node.argument)) {\n context.report({ node, messageId: \"avoid\" });\n }\n },\n };\n },\n});\n","import type { ESTree } from \"@oxlint/plugins\";\n\ntype VisitorKeys = Readonly<Record<string, readonly string[]>>;\n\nfunction isNode(value: unknown): value is ESTree.Node {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"type\" in value &&\n\t\ttypeof value.type === \"string\"\n\t);\n}\n\nfunction collectInferTypeParameterNames(\n\tnode: ESTree.Node,\n\tvisitorKeys: VisitorKeys,\n\tnames: Set<string>,\n): void {\n\tif (node.type === \"TSInferType\") names.add(node.typeParameter.name.name);\n\tconst record = node as unknown as Readonly<Record<string, unknown>>;\n\tfor (const key of visitorKeys[node.type] ?? []) {\n\t\tconst value = record[key];\n\t\tif (isNode(value)) {\n\t\t\tcollectInferTypeParameterNames(value, visitorKeys, names);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!Array.isArray(value)) continue;\n\t\tfor (const child of value) {\n\t\t\tif (isNode(child)) collectInferTypeParameterNames(child, visitorKeys, names);\n\t\t}\n\t}\n}\n\n/** Collect type binders that are in scope at a node and can shadow module aliases. */\nexport function lexicalTypeParameterNames(\n\tnode: ESTree.Node,\n\tvisitorKeys: VisitorKeys,\n): ReadonlySet<string> {\n\tconst names = new Set<string>();\n\tlet descendant: ESTree.Node = node;\n\tlet current: ESTree.Node | null = node;\n\twhile (current !== null && current.type !== \"Program\") {\n\t\tif (\"typeParameters\" in current) {\n\t\t\tfor (const parameter of current.typeParameters?.params ?? []) {\n\t\t\t\tnames.add(parameter.name.name);\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tcurrent.type === \"TSMappedType\" &&\n\t\t\t(descendant === current.nameType || descendant === current.typeAnnotation)\n\t\t) {\n\t\t\tnames.add(current.key.name);\n\t\t}\n\t\tif (current.type === \"TSConditionalType\" && descendant === current.trueType) {\n\t\t\tcollectInferTypeParameterNames(current.extendsType, visitorKeys, names);\n\t\t}\n\t\tdescendant = current;\n\t\tcurrent = current.parent;\n\t}\n\treturn names;\n}\n","import type { ESTree } from \"@oxlint/plugins\";\n\nimport { lexicalTypeParameterNames } from \"./lexical-type-parameters.ts\";\n\ntype VisitorKeys = Readonly<Record<string, readonly string[]>>;\ntype TypeScope = ESTree.Node;\n\ntype TypeBinding = {\n\treadonly alias: ESTree.TSTypeAliasDeclaration | null;\n\treadonly name: string;\n\treadonly scope: TypeScope;\n};\n\ntype Substitution = {\n\treadonly substitutions: Substitutions;\n\treadonly type: ESTree.TSType;\n};\n\ntype Substitutions = ReadonlyMap<string, Substitution>;\n\nexport type TypeAliasEnvironment = {\n\treadonly aliases: readonly ESTree.TSTypeAliasDeclaration[];\n\treadonly bindingsByName: ReadonlyMap<string, readonly TypeBinding[]>;\n\treadonly visitorKeys: VisitorKeys;\n};\n\nexport type ResolvedTypeMatcher = (\n\ttype: ESTree.TSType,\n\tmatches: (child: ESTree.TSType) => boolean,\n) => boolean;\n\nconst environmentsByProgram = new WeakMap<ESTree.Program, TypeAliasEnvironment>();\n\nfunction isNode(value: unknown): value is ESTree.Node {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"type\" in value &&\n\t\ttypeof value.type === \"string\"\n\t);\n}\n\nfunction enclosingTypeScope(node: ESTree.Node): TypeScope {\n\tlet current: ESTree.Node | null = node.parent;\n\twhile (current !== null) {\n\t\tif (\n\t\t\tcurrent.type === \"Program\" ||\n\t\t\tcurrent.type === \"BlockStatement\" ||\n\t\t\tcurrent.type === \"TSModuleBlock\" ||\n\t\t\tcurrent.type === \"StaticBlock\" ||\n\t\t\tcurrent.type === \"SwitchStatement\"\n\t\t) {\n\t\t\treturn current;\n\t\t}\n\t\tcurrent = current.parent;\n\t}\n\treturn node;\n}\n\nfunction declaredTypeBinding(node: ESTree.Node): {\n\treadonly alias: ESTree.TSTypeAliasDeclaration | null;\n\treadonly name: string;\n} | null {\n\tif (node.type === \"TSTypeAliasDeclaration\") {\n\t\treturn { alias: node, name: node.id.name };\n\t}\n\tif (\n\t\tnode.type === \"TSInterfaceDeclaration\" ||\n\t\tnode.type === \"TSEnumDeclaration\" ||\n\t\tnode.type === \"ClassDeclaration\" ||\n\t\tnode.type === \"ClassExpression\"\n\t) {\n\t\treturn node.id === null ? null : { alias: null, name: node.id.name };\n\t}\n\tif (\n\t\tnode.type === \"ImportSpecifier\" ||\n\t\tnode.type === \"ImportDefaultSpecifier\" ||\n\t\tnode.type === \"ImportNamespaceSpecifier\"\n\t) {\n\t\treturn { alias: null, name: node.local.name };\n\t}\n\treturn null;\n}\n\nfunction collectTypeBindings(\n\tnode: ESTree.Node,\n\tvisitorKeys: VisitorKeys,\n\tbindingsByName: Map<string, TypeBinding[]>,\n\taliases: ESTree.TSTypeAliasDeclaration[],\n): void {\n\tconst declared = declaredTypeBinding(node);\n\tif (declared !== null) {\n\t\tconst bindings = bindingsByName.get(declared.name) ?? [];\n\t\tbindings.push({ ...declared, scope: enclosingTypeScope(node) });\n\t\tbindingsByName.set(declared.name, bindings);\n\t\tif (declared.alias !== null) aliases.push(declared.alias);\n\t}\n\n\t// SAFETY: Oxlint's visitor keys identify only ESTree child-node properties.\n\tconst fields = node as unknown as Readonly<Record<string, unknown>>;\n\tfor (const key of visitorKeys[node.type] ?? []) {\n\t\tconst value = fields[key];\n\t\tif (isNode(value)) {\n\t\t\tcollectTypeBindings(value, visitorKeys, bindingsByName, aliases);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!Array.isArray(value)) continue;\n\t\tfor (const child of value) {\n\t\t\tif (isNode(child)) {\n\t\t\t\tcollectTypeBindings(child, visitorKeys, bindingsByName, aliases);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Collect every lexical type alias and competing type binding in a program. */\nexport function createTypeAliasEnvironment(\n\tprogram: ESTree.Program,\n\tvisitorKeys: VisitorKeys,\n): TypeAliasEnvironment {\n\tconst cached = environmentsByProgram.get(program);\n\tif (cached !== undefined) return cached;\n\tconst bindingsByName = new Map<string, TypeBinding[]>();\n\tconst aliases: ESTree.TSTypeAliasDeclaration[] = [];\n\tcollectTypeBindings(program, visitorKeys, bindingsByName, aliases);\n\tconst environment = { aliases, bindingsByName, visitorKeys };\n\tenvironmentsByProgram.set(program, environment);\n\treturn environment;\n}\n\nfunction ancestorDistance(ancestor: ESTree.Node, node: ESTree.Node): number | null {\n\tlet current: ESTree.Node | null = node;\n\tlet distance = 0;\n\twhile (current !== null) {\n\t\tif (current === ancestor) return distance;\n\t\tcurrent = current.parent;\n\t\tdistance += 1;\n\t}\n\treturn null;\n}\n\nfunction nearestTypeBindings(\n\tname: string,\n\tuse: ESTree.Node,\n\tenvironment: TypeAliasEnvironment,\n): readonly TypeBinding[] {\n\tconst candidates = environment.bindingsByName.get(name) ?? [];\n\tlet nearestDistance = Number.POSITIVE_INFINITY;\n\tlet nearest: TypeBinding[] = [];\n\tfor (const candidate of candidates) {\n\t\tconst distance = ancestorDistance(candidate.scope, use);\n\t\tif (distance === null || distance > nearestDistance) continue;\n\t\tif (distance === nearestDistance) {\n\t\t\tnearest.push(candidate);\n\t\t\tcontinue;\n\t\t}\n\t\tnearestDistance = distance;\n\t\tnearest = [candidate];\n\t}\n\treturn nearest;\n}\n\n/** Resolve the nearest visible alias with this name, respecting lexical shadowing. */\nexport function visibleTypeAlias(\n\tname: string,\n\tuse: ESTree.Node,\n\tenvironment: TypeAliasEnvironment,\n): ESTree.TSTypeAliasDeclaration | null {\n\tif (lexicalTypeParameterNames(use, environment.visitorKeys).has(name)) return null;\n\tconst bindings = nearestTypeBindings(name, use, environment);\n\treturn bindings.length === 1 ? (bindings[0]?.alias ?? null) : null;\n}\n\n/** Return whether a local declaration shadows a built-in type at this use. */\nexport function hasVisibleTypeBinding(\n\tname: string,\n\tuse: ESTree.Node,\n\tenvironment: TypeAliasEnvironment,\n): boolean {\n\treturn (\n\t\tlexicalTypeParameterNames(use, environment.visitorKeys).has(name) ||\n\t\tnearestTypeBindings(name, use, environment).length > 0\n\t);\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n\treturn type.typeName.type === \"Identifier\" ? type.typeName.name : null;\n}\n\nfunction aliasSubstitutions(\n\talias: ESTree.TSTypeAliasDeclaration,\n\treference: ESTree.TSTypeReference,\n\tbase: Substitutions,\n): Substitutions | null {\n\tconst parameters = alias.typeParameters?.params ?? [];\n\tconst arguments_ = reference.typeArguments?.params ?? [];\n\tconst next = new Map(base);\n\tfor (const [index, parameter] of parameters.entries()) {\n\t\tconst explicitArgument = arguments_[index];\n\t\tconst argument = explicitArgument ?? parameter.default;\n\t\tif (argument === null || argument === undefined) return null;\n\t\tconst argumentSubstitutions = explicitArgument === undefined ? next : base;\n\t\tnext.set(parameter.name.name, {\n\t\t\ttype: argument,\n\t\t\tsubstitutions: new Map(argumentSubstitutions),\n\t\t});\n\t}\n\treturn next;\n}\n\n/** Match a type after resolving visible aliases and substituting their type parameters. */\nexport function resolvedTypeMatches(\n\ttype: ESTree.TSType,\n\tenvironment: TypeAliasEnvironment,\n\tmatcher: ResolvedTypeMatcher,\n): boolean {\n\tconst evaluate = (\n\t\tcurrent: ESTree.TSType,\n\t\tsubstitutions: Substitutions,\n\t\tresolvingAliases: ReadonlySet<ESTree.TSTypeAliasDeclaration>,\n\t): boolean => {\n\t\tif (current.type === \"TSTypeReference\") {\n\t\t\tconst name = typeReferenceName(current);\n\t\t\tif (name !== null) {\n\t\t\t\tconst substitution = substitutions.get(name);\n\t\t\t\tif (substitution !== undefined && !current.typeArguments?.params.length) {\n\t\t\t\t\treturn evaluate(\n\t\t\t\t\t\tsubstitution.type,\n\t\t\t\t\t\tsubstitution.substitutions,\n\t\t\t\t\t\tresolvingAliases,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tconst alias = visibleTypeAlias(name, current, environment);\n\t\t\t\tif (alias !== null && !resolvingAliases.has(alias)) {\n\t\t\t\t\tconst nextSubstitutions = aliasSubstitutions(alias, current, substitutions);\n\t\t\t\t\tif (nextSubstitutions !== null) {\n\t\t\t\t\t\tconst nextResolving = new Set(resolvingAliases);\n\t\t\t\t\t\tnextResolving.add(alias);\n\t\t\t\t\t\treturn evaluate(alias.typeAnnotation, nextSubstitutions, nextResolving);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn matcher(current, (child) =>\n\t\t\tevaluate(child, substitutions, resolvingAliases),\n\t\t);\n\t};\n\n\treturn evaluate(type, new Map(), new Set());\n}\n","import type { ESTree } from \"@oxlint/plugins\";\n\nimport {\n\tcreateTypeAliasEnvironment,\n\thasVisibleTypeBinding,\n\tvisibleTypeAlias,\n\ttype TypeAliasEnvironment as LexicalTypeAliasEnvironment,\n} from \"./type-alias-resolution.ts\";\n\nconst BUILT_INS = new Set([\n\t\"Record\",\n\t\"Readonly\",\n\t\"Partial\",\n\t\"Required\",\n\t\"Pick\",\n\t\"Omit\",\n\t\"PropertyKey\",\n\t\"NonNullable\",\n]);\nconst TRANSPARENT_WRAPPERS = new Set([\"Readonly\", \"Partial\", \"Required\", \"NonNullable\"]);\n\ntype TypeAliasEnvironment = ReadonlyMap<string, ESTree.TSType>;\n\ntype ResolvedType = {\n\treadonly type: ESTree.TSType;\n\treadonly substitutions: TypeAliasEnvironment;\n};\n\nexport type UnsafeDictionary = {\n\treadonly kind: \"unsafe-dictionary\";\n\treadonly unsafeValue: \"any\" | \"empty-object\" | \"object\" | \"union\" | \"unknown\";\n};\n\nexport type WideningTargetKind =\n\t| \"anonymous object\"\n\t| \"generic container\"\n\t| \"object\"\n\t| \"open dictionary\"\n\t| \"unknown\";\n\nexport type WideningTarget = {\n\treadonly kind: WideningTargetKind;\n};\n\nexport type TypeEnvironment = {\n\treadonly interfaces: ReadonlyMap<string, readonly ESTree.TSInterfaceDeclaration[]>;\n\treadonly typeAliases: LexicalTypeAliasEnvironment;\n};\n\nfunction declaredStatement(statement: ESTree.Statement): ESTree.Node | null {\n\treturn statement.type === \"ExportNamedDeclaration\" ||\n\t\tstatement.type === \"ExportDefaultDeclaration\"\n\t\t? (statement.declaration ?? null)\n\t\t: statement;\n}\n\nexport function createTypeEnvironment(\n\tprogram: ESTree.Program,\n\tvisitorKeys: Readonly<Record<string, readonly string[]>>,\n): TypeEnvironment {\n\tconst interfaces = new Map<string, ESTree.TSInterfaceDeclaration[]>();\n\n\tfor (const statement of program.body) {\n\t\tconst declaration = declaredStatement(statement);\n\t\tif (declaration?.type !== \"TSInterfaceDeclaration\") continue;\n\t\tconst declarations = interfaces.get(declaration.id.name) ?? [];\n\t\tdeclarations.push(declaration);\n\t\tinterfaces.set(declaration.id.name, declarations);\n\t}\n\n\treturn {\n\t\tinterfaces,\n\t\ttypeAliases: createTypeAliasEnvironment(program, visitorKeys),\n\t};\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n\treturn type.typeName.type === \"Identifier\" ? type.typeName.name : null;\n}\n\nfunction isBuiltIn(\n\tname: string,\n\tuse: ESTree.Node,\n\tenvironment: TypeEnvironment,\n): boolean {\n\treturn (\n\t\tBUILT_INS.has(name) &&\n\t\t!hasVisibleTypeBinding(name, use, environment.typeAliases)\n\t);\n}\n\nfunction isUnappliedReferenceTo(type: ESTree.TSType, name: string): boolean {\n\tconst unwrapped = unwrapTransparentType(type);\n\treturn (\n\t\tunwrapped.type === \"TSTypeReference\" &&\n\t\ttypeReferenceName(unwrapped) === name &&\n\t\t(unwrapped.typeArguments === null ||\n\t\t\tunwrapped.typeArguments === undefined ||\n\t\t\tunwrapped.typeArguments.params.length === 0)\n\t);\n}\n\nfunction unwrapTransparentType(type: ESTree.TSType): ESTree.TSType {\n\tlet current = type;\n\twhile (\n\t\tcurrent.type === \"TSParenthesizedType\" ||\n\t\t(current.type === \"TSTypeOperator\" && current.operator === \"readonly\")\n\t) {\n\t\tcurrent = current.typeAnnotation;\n\t}\n\treturn current;\n}\n\nfunction isNeverType(type: ESTree.TSType): boolean {\n\treturn unwrapTransparentType(type).type === \"TSNeverKeyword\";\n}\n\nfunction isEffectivelyEmptyMember(member: ESTree.TSSignature): boolean {\n\treturn (\n\t\tmember.type === \"TSPropertySignature\" &&\n\t\tmember.optional === true &&\n\t\tmember.typeAnnotation !== null &&\n\t\tmember.typeAnnotation !== undefined &&\n\t\tisNeverType(member.typeAnnotation.typeAnnotation)\n\t);\n}\n\nfunction isEffectivelyEmptyTypeLiteral(type: ESTree.TSTypeLiteral): boolean {\n\treturn type.members.length === 0 || type.members.every(isEffectivelyEmptyMember);\n}\n\nfunction isEffectivelyEmptyInterface(\n\tdeclarations: readonly ESTree.TSInterfaceDeclaration[],\n): boolean {\n\tif (declarations.length !== 1) return false;\n\tconst [type] = declarations;\n\treturn (\n\t\ttype !== undefined &&\n\t\ttype.extends.length === 0 &&\n\t\t(type.body.body.length === 0 || type.body.body.every(isEffectivelyEmptyMember))\n\t);\n}\n\nfunction resolvedSubstitutionArgument(\n\ttype: ESTree.TSType,\n\tbase: TypeAliasEnvironment,\n\tresolving: ReadonlySet<string> = new Set(),\n): ESTree.TSType {\n\tconst unwrapped = unwrapTransparentType(type);\n\tif (unwrapped.type !== \"TSTypeReference\") return type;\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null || resolving.has(name)) return type;\n\tconst substitution = base.get(name);\n\tif (substitution === undefined) return type;\n\tconst nextResolving = new Set(resolving);\n\tnextResolving.add(name);\n\treturn resolvedSubstitutionArgument(substitution, base, nextResolving);\n}\n\nfunction aliasSubstitution(\n\talias: ESTree.TSTypeAliasDeclaration,\n\ttype: ESTree.TSTypeReference,\n\tbase: TypeAliasEnvironment,\n): TypeAliasEnvironment | null {\n\tconst parameters = alias.typeParameters?.params ?? [];\n\tconst arguments_ = type.typeArguments?.params ?? [];\n\tconst next = new Map(base);\n\tfor (const [index, parameter] of parameters.entries()) {\n\t\tconst argument = arguments_[index] ?? parameter.default;\n\t\tif (argument === null || argument === undefined) return null;\n\t\tnext.set(parameter.name.name, resolvedSubstitutionArgument(argument, next));\n\t}\n\treturn next;\n}\n\nfunction unsafeDirectValue(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n\tsubstitutions: TypeAliasEnvironment,\n\tresolvingAliases: ReadonlySet<string>,\n): UnsafeDictionary[\"unsafeValue\"] | null {\n\tconst unwrapped = unwrapTransparentType(type);\n\tif (unwrapped.type === \"TSUnknownKeyword\") return \"unknown\";\n\tif (unwrapped.type === \"TSAnyKeyword\") return \"any\";\n\tif (unwrapped.type === \"TSObjectKeyword\") return \"object\";\n\tif (unwrapped.type === \"TSTypeLiteral\" && isEffectivelyEmptyTypeLiteral(unwrapped))\n\t\treturn \"empty-object\";\n\tif (unwrapped.type === \"TSUnionType\") {\n\t\treturn unwrapped.types.some(\n\t\t\t(member) => unsafeDirectValue(member, environment, substitutions, resolvingAliases) !== null,\n\t\t)\n\t\t\t? \"union\"\n\t\t\t: null;\n\t}\n\tif (unwrapped.type === \"TSIntersectionType\") {\n\t\tconst unsafeMembers = unwrapped.types.map((member) =>\n\t\t\tunsafeDirectValue(member, environment, substitutions, resolvingAliases),\n\t\t);\n\t\tif (unsafeMembers.includes(\"any\")) return \"any\";\n\t\tconst first = unsafeMembers[0];\n\t\treturn first !== undefined && unsafeMembers.every((member) => member !== null) ? first : null;\n\t}\n\tif (unwrapped.type !== \"TSTypeReference\") return null;\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null) return null;\n\tif (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst wrapped = unwrapped.typeArguments?.params[0];\n\t\treturn wrapped === undefined\n\t\t\t? null\n\t\t\t: unsafeDirectValue(wrapped, environment, substitutions, resolvingAliases);\n\t}\n\tconst substitution = substitutions.get(name);\n\tif (substitution !== undefined) {\n\t\treturn isUnappliedReferenceTo(substitution, name)\n\t\t\t? null\n\t\t\t: unsafeDirectValue(substitution, environment, substitutions, resolvingAliases);\n\t}\n\tconst interfaceDeclarations = environment.interfaces.get(name);\n\tif (interfaceDeclarations !== undefined) {\n\t\treturn isEffectivelyEmptyInterface(interfaceDeclarations) ? \"empty-object\" : null;\n\t}\n\tconst alias = visibleTypeAlias(name, unwrapped, environment.typeAliases);\n\tif (alias === null || resolvingAliases.has(name)) return null;\n\tconst nextSubstitutions = aliasSubstitution(alias, unwrapped, substitutions);\n\tif (nextSubstitutions === null) return null;\n\tconst nextResolving = new Set(resolvingAliases);\n\tnextResolving.add(name);\n\treturn unsafeDirectValue(alias.typeAnnotation, environment, nextSubstitutions, nextResolving);\n}\n\nfunction dictionaryValueTypes(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n\tsubstitutions: TypeAliasEnvironment,\n\tresolvingAliases: ReadonlySet<string>,\n): readonly ResolvedType[] {\n\tconst unwrapped = unwrapTransparentType(type);\n\n\tif (unwrapped.type === \"TSTypeLiteral\") {\n\t\treturn unwrapped.members.flatMap((member): readonly ResolvedType[] =>\n\t\t\tmember.type === \"TSIndexSignature\" && member.typeAnnotation !== null\n\t\t\t\t? [{ type: member.typeAnnotation.typeAnnotation, substitutions }]\n\t\t\t\t: [],\n\t\t);\n\t}\n\n\tif (unwrapped.type === \"TSMappedType\") {\n\t\treturn unwrapped.typeAnnotation === null\n\t\t\t? []\n\t\t\t: [{ type: unwrapped.typeAnnotation, substitutions }];\n\t}\n\n\tif (unwrapped.type !== \"TSTypeReference\") return [];\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null) return [];\n\n\tconst substitution = substitutions.get(name);\n\tif (substitution !== undefined) {\n\t\treturn isUnappliedReferenceTo(substitution, name)\n\t\t\t? []\n\t\t\t: dictionaryValueTypes(substitution, environment, substitutions, resolvingAliases);\n\t}\n\n\tif (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst wrapped = unwrapped.typeArguments?.params[0];\n\t\treturn wrapped === undefined\n\t\t\t? []\n\t\t\t: dictionaryValueTypes(wrapped, environment, substitutions, resolvingAliases);\n\t}\n\n\tif (name === \"Record\" && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst value = unwrapped.typeArguments?.params[1] ?? null;\n\t\treturn value === null ? [] : [{ type: value, substitutions }];\n\t}\n\n\tif (\n\t\t(name === \"Pick\" || name === \"Omit\") &&\n\t\tisBuiltIn(name, unwrapped, environment)\n\t) {\n\t\tconst source = unwrapped.typeArguments?.params[0];\n\t\treturn source === undefined\n\t\t\t? []\n\t\t\t: dictionaryValueTypes(source, environment, substitutions, resolvingAliases);\n\t}\n\n\tconst alias = visibleTypeAlias(name, unwrapped, environment.typeAliases);\n\tif (alias === null || resolvingAliases.has(name)) return [];\n\tconst nextSubstitutions = aliasSubstitution(alias, unwrapped, substitutions);\n\tif (nextSubstitutions === null) return [];\n\tconst nextResolving = new Set(resolvingAliases);\n\tnextResolving.add(name);\n\treturn dictionaryValueTypes(alias.typeAnnotation, environment, nextSubstitutions, nextResolving);\n}\n\nexport function classifyUnsafeDictionaryValue(\n\tvalueType: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n): UnsafeDictionary | null {\n\tconst unsafeValue = unsafeDirectValue(valueType, environment, new Map(), new Set());\n\treturn unsafeValue === null ? null : { kind: \"unsafe-dictionary\", unsafeValue };\n}\n\nexport function classifyUnsafeDictionary(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n): UnsafeDictionary | null {\n\tfor (const valueType of dictionaryValueTypes(type, environment, new Map(), new Set())) {\n\t\tconst unsafeValue = unsafeDirectValue(\n\t\t\tvalueType.type,\n\t\t\tenvironment,\n\t\t\tvalueType.substitutions,\n\t\t\tnew Set(),\n\t\t);\n\t\tif (unsafeValue !== null) return { kind: \"unsafe-dictionary\", unsafeValue };\n\t}\n\treturn null;\n}\n\nexport function classifyWideningTarget(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n): WideningTarget | null {\n\tconst unwrapped = unwrapTransparentType(type);\n\tif (unwrapped.type === \"TSUnknownKeyword\") return { kind: \"unknown\" };\n\tif (unwrapped.type === \"TSObjectKeyword\") return { kind: \"object\" };\n\tif (unwrapped.type === \"TSTypeLiteral\") {\n\t\treturn unwrapped.members.some((member) => member.type === \"TSIndexSignature\")\n\t\t\t? { kind: \"open dictionary\" }\n\t\t\t: unwrapped.members.length > 0\n\t\t\t\t? { kind: \"anonymous object\" }\n\t\t\t\t: null;\n\t}\n\tif (unwrapped.type === \"TSMappedType\") return { kind: \"open dictionary\" };\n\tif (unwrapped.type !== \"TSTypeReference\") return null;\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null) return null;\n\tif (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst wrapped = unwrapped.typeArguments?.params[0];\n\t\treturn wrapped === undefined ? null : classifyWideningTarget(wrapped, environment);\n\t}\n\tif (name === \"Record\" && isBuiltIn(name, unwrapped, environment)) {\n\t\treturn hasBroadRecordKey(unwrapped, environment, new Map())\n\t\t\t? { kind: \"open dictionary\" }\n\t\t\t: null;\n\t}\n\tconst alias = visibleTypeAlias(name, unwrapped, environment.typeAliases);\n\tif (alias === null) return null;\n\tif ((alias.typeParameters?.params.length ?? 0) > 0) {\n\t\tconst substitutions = aliasSubstitution(alias, unwrapped, new Map());\n\t\tconst resolved =\n\t\t\tsubstitutions === null\n\t\t\t\t? null\n\t\t\t\t: classifyAliasBroadTarget(\n\t\t\t\t\t\talias.typeAnnotation,\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t\tsubstitutions,\n\t\t\t\t\t\tnew Set([name]),\n\t\t\t\t\t);\n\t\treturn resolved?.kind === \"open dictionary\" ? { kind: \"generic container\" } : null;\n\t}\n\tconst substitutions = aliasSubstitution(alias, unwrapped, new Map());\n\tif (substitutions === null) return null;\n\tconst resolved = classifyAliasBroadTarget(\n\t\talias.typeAnnotation,\n\t\tenvironment,\n\t\tsubstitutions,\n\t\tnew Set([name]),\n\t);\n\treturn resolved;\n}\n\nfunction hasBroadRecordKey(\n\ttype: ESTree.TSTypeReference,\n\tenvironment: TypeEnvironment,\n\tsubstitutions: TypeAliasEnvironment,\n): boolean {\n\tconst key = type.typeArguments?.params[0];\n\treturn key === undefined || isBroadMappedKey(key, environment, substitutions);\n}\n\nfunction isBroadMappedKey(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n\tsubstitutions: TypeAliasEnvironment,\n\tvisitedAliases: ReadonlySet<string> = new Set(),\n): boolean {\n\tconst unwrapped = unwrapTransparentType(type);\n\tif (\n\t\tunwrapped.type === \"TSStringKeyword\" ||\n\t\tunwrapped.type === \"TSNumberKeyword\" ||\n\t\tunwrapped.type === \"TSSymbolKeyword\"\n\t) {\n\t\treturn true;\n\t}\n\tif (unwrapped.type === \"TSUnionType\") {\n\t\treturn unwrapped.types.some((member) =>\n\t\t\tisBroadMappedKey(member, environment, substitutions, visitedAliases),\n\t\t);\n\t}\n\tif (unwrapped.type !== \"TSTypeReference\") return false;\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null) return false;\n\tconst substitution = substitutions.get(name);\n\tif (substitution !== undefined && !isUnappliedReferenceTo(substitution, name)) {\n\t\treturn isBroadMappedKey(substitution, environment, substitutions, visitedAliases);\n\t}\n\tif (name === \"PropertyKey\" && isBuiltIn(name, unwrapped, environment)) return true;\n\tconst alias = visibleTypeAlias(name, unwrapped, environment.typeAliases);\n\tif (\n\t\talias === null ||\n\t\t(alias.typeParameters?.params.length ?? 0) > 0 ||\n\t\tvisitedAliases.has(name)\n\t) {\n\t\treturn false;\n\t}\n\tconst nextVisited = new Set(visitedAliases);\n\tnextVisited.add(name);\n\treturn isBroadMappedKey(alias.typeAnnotation, environment, substitutions, nextVisited);\n}\n\nfunction classifyAliasBroadTarget(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n\tsubstitutions: TypeAliasEnvironment,\n\tresolvingAliases: ReadonlySet<string>,\n): WideningTarget | null {\n\tconst unwrapped = unwrapTransparentType(type);\n\tif (unwrapped.type === \"TSUnknownKeyword\") return { kind: \"unknown\" };\n\tif (unwrapped.type === \"TSObjectKeyword\") return { kind: \"object\" };\n\tif (unwrapped.type === \"TSTypeLiteral\") {\n\t\treturn unwrapped.members.some((member) => member.type === \"TSIndexSignature\")\n\t\t\t? { kind: \"open dictionary\" }\n\t\t\t: null;\n\t}\n\tif (unwrapped.type === \"TSMappedType\") {\n\t\treturn isBroadMappedKey(unwrapped.constraint, environment, substitutions)\n\t\t\t? { kind: \"open dictionary\" }\n\t\t\t: null;\n\t}\n\tif (unwrapped.type !== \"TSTypeReference\") return null;\n\tconst name = typeReferenceName(unwrapped);\n\tif (name === null) return null;\n\tconst substitution = substitutions.get(name);\n\tif (substitution !== undefined) {\n\t\treturn isUnappliedReferenceTo(substitution, name)\n\t\t\t? null\n\t\t\t: classifyAliasBroadTarget(\n\t\t\t\t\tsubstitution,\n\t\t\t\t\tenvironment,\n\t\t\t\t\tsubstitutions,\n\t\t\t\t\tresolvingAliases,\n\t\t\t\t);\n\t}\n\tif (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst wrapped = unwrapped.typeArguments?.params[0];\n\t\treturn wrapped === undefined\n\t\t\t? null\n\t\t\t: classifyAliasBroadTarget(wrapped, environment, substitutions, resolvingAliases);\n\t}\n\tif (name === \"Record\" && isBuiltIn(name, unwrapped, environment)) {\n\t\treturn hasBroadRecordKey(unwrapped, environment, substitutions)\n\t\t\t? { kind: \"open dictionary\" }\n\t\t\t: null;\n\t}\n\tconst alias = visibleTypeAlias(name, unwrapped, environment.typeAliases);\n\tif (alias === null || resolvingAliases.has(name)) return null;\n\tconst nextSubstitutions = aliasSubstitution(alias, unwrapped, substitutions);\n\tif (nextSubstitutions === null) return null;\n\tconst nextResolving = new Set(resolvingAliases);\n\tnextResolving.add(name);\n\treturn classifyAliasBroadTarget(\n\t\talias.typeAnnotation,\n\t\tenvironment,\n\t\tnextSubstitutions,\n\t\tnextResolving,\n\t);\n}\n\nexport function isPopulatedObjectExpression(expression: ESTree.Expression): boolean {\n\tlet current = expression;\n\twhile (\n\t\tcurrent.type === \"ParenthesizedExpression\" ||\n\t\tcurrent.type === \"TSAsExpression\" ||\n\t\tcurrent.type === \"TSTypeAssertion\" ||\n\t\tcurrent.type === \"TSNonNullExpression\"\n\t) {\n\t\tcurrent = current.expression;\n\t}\n\treturn current.type === \"ObjectExpression\" && current.properties.length > 0;\n}\n\nexport function isKnownEvidenceExpression(expression: ESTree.Expression): boolean {\n\tlet current = expression;\n\twhile (\n\t\tcurrent.type === \"ParenthesizedExpression\" ||\n\t\tcurrent.type === \"TSAsExpression\" ||\n\t\tcurrent.type === \"TSTypeAssertion\" ||\n\t\tcurrent.type === \"TSNonNullExpression\" ||\n\t\tcurrent.type === \"TSSatisfiesExpression\"\n\t) {\n\t\tcurrent = current.expression;\n\t}\n\tif (current.type === \"ObjectExpression\") return true;\n\treturn (\n\t\tcurrent.type === \"ArrayExpression\" ||\n\t\tcurrent.type === \"ArrowFunctionExpression\" ||\n\t\tcurrent.type === \"ClassExpression\" ||\n\t\tcurrent.type === \"FunctionExpression\" ||\n\t\tcurrent.type === \"NewExpression\" ||\n\t\tcurrent.type === \"Literal\" ||\n\t\tcurrent.type === \"TemplateLiteral\" ||\n\t\tcurrent.type === \"UnaryExpression\"\n\t);\n}\n","import type { ESTree, SourceCode } from \"@oxlint/plugins\";\n\nexport type FunctionParameter = ESTree.ParamPattern;\n\n/** Return whether a type is or contains TypeScript's absorbing unknown top type. */\nexport function containsUnknownType(type: ESTree.TSType): boolean {\n\tif (type.type === \"TSUnknownKeyword\") return true;\n\tif (type.type === \"TSParenthesizedType\") return containsUnknownType(type.typeAnnotation);\n\treturn type.type === \"TSUnionType\" && type.types.some(containsUnknownType);\n}\n\n/** Return the TypeScript annotation attached to a function parameter or its wrapped binding. */\nexport function functionParameterTypeAnnotation(\n\tparameter: FunctionParameter,\n): ESTree.TSTypeAnnotation | null | undefined {\n\tif (parameter.type === \"TSParameterProperty\") {\n\t\treturn functionParameterTypeAnnotation(parameter.parameter);\n\t}\n\tif (parameter.type === \"RestElement\") {\n\t\treturn parameter.typeAnnotation ?? functionParameterTypeAnnotation(parameter.argument);\n\t}\n\tif (parameter.type === \"AssignmentPattern\") {\n\t\treturn parameter.typeAnnotation ?? functionParameterTypeAnnotation(parameter.left);\n\t}\n\treturn parameter.typeAnnotation;\n}\n\n/** Return only a function parameter's local binding, excluding its annotation and default value. */\nexport function functionParameterBindingName(\n\tparameter: FunctionParameter,\n\tsourceCode: SourceCode,\n): string {\n\tif (parameter.type === \"TSParameterProperty\") {\n\t\treturn functionParameterBindingName(parameter.parameter, sourceCode);\n\t}\n\tif (parameter.type === \"AssignmentPattern\") {\n\t\treturn functionParameterBindingName(parameter.left, sourceCode);\n\t}\n\tif (parameter.type === \"RestElement\") {\n\t\treturn functionParameterBindingName(parameter.argument, sourceCode);\n\t}\n\tif (parameter.type === \"Identifier\") return parameter.name;\n\n\tconst sourceText = sourceCode.getText(parameter);\n\tconst annotationStart = parameter.typeAnnotation?.start;\n\treturn annotationStart === undefined\n\t\t? sourceText\n\t\t: sourceText.slice(0, annotationStart - parameter.start).trimEnd();\n}\n","import type { ESTree, Scope, SourceCode, Variable } from \"@oxlint/plugins\";\n\n/** Resolve an identifier to its binding by walking lexical scopes upward. */\nexport function resolveVariable(\n\tsourceCode: SourceCode,\n\tidentifier: ESTree.IdentifierReference,\n): Variable | null {\n\tlet scope: Scope | null = sourceCode.getScope(identifier);\n\twhile (scope !== null) {\n\t\tconst variable = scope.set.get(identifier.name);\n\t\tif (variable !== undefined) return variable;\n\t\tscope = scope.upper;\n\t}\n\treturn null;\n}\n","// Annotating a literal whose keys are right there as `Record<string, Command>` makes the compiler\n// forget which keys exist, so `commands.strat` type checks. The annotation looks like extra rigour\n// and is the opposite. Nothing measured has needed it off: `satisfies` and a named interface cover\n// the annotate-for-safety habit.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport {\n\tclassifyUnsafeDictionaryValue,\n\tclassifyWideningTarget,\n\tcreateTypeEnvironment,\n\tisKnownEvidenceExpression,\n\ttype TypeEnvironment,\n\ttype WideningTarget,\n} from \"../shared/dictionary-types.ts\";\nimport {\n\tcontainsUnknownType,\n\tfunctionParameterBindingName,\n\tfunctionParameterTypeAnnotation,\n} from \"../shared/function-parameters.ts\";\nimport { resolveVariable } from \"../shared/scope.ts\";\n\nimport type { ESTree, SourceCode, Variable } from \"@oxlint/plugins\";\n\ntype FunctionExpression = ESTree.ArrowFunctionExpression | ESTree.Function;\n\nfunction unwrapExpression(expression: ESTree.Expression): ESTree.Expression {\n\tlet current = expression;\n\twhile (\n\t\tcurrent.type === \"ParenthesizedExpression\" ||\n\t\tcurrent.type === \"TSAsExpression\" ||\n\t\tcurrent.type === \"TSSatisfiesExpression\" ||\n\t\tcurrent.type === \"TSTypeAssertion\" ||\n\t\tcurrent.type === \"TSNonNullExpression\"\n\t) {\n\t\tcurrent = current.expression;\n\t}\n\treturn current;\n}\n\nfunction variableDeclarator(variable: Variable): ESTree.VariableDeclarator | null {\n\tif (variable.defs.length !== 1) return null;\n\tconst [definition] = variable.defs;\n\treturn definition?.type === \"Variable\" && definition.node.type === \"VariableDeclarator\"\n\t\t? definition.node\n\t\t: null;\n}\n\nfunction isStableConstVariable(variable: Variable, declarator: ESTree.VariableDeclarator): boolean {\n\treturn (\n\t\tdeclarator.parent.type === \"VariableDeclaration\" &&\n\t\tdeclarator.parent.kind === \"const\" &&\n\t\tvariable.references.every((reference) => reference.init || !reference.isWrite())\n\t);\n}\n\nfunction hasKnownEvidence(\n\tsourceCode: SourceCode,\n\texpression: ESTree.Expression,\n\tvisitedVariables = new Set<Variable>(),\n): boolean {\n\tif (isKnownEvidenceExpression(expression)) return true;\n\tconst unwrapped = unwrapExpression(expression);\n\tif (unwrapped.type !== \"Identifier\") return false;\n\tconst variable = resolveVariable(sourceCode, unwrapped);\n\tif (variable === null || visitedVariables.has(variable)) return false;\n\tconst declarator = variableDeclarator(variable);\n\tif (\n\t\tdeclarator === null ||\n\t\tdeclarator.init === null ||\n\t\t!isStableConstVariable(variable, declarator)\n\t) {\n\t\treturn false;\n\t}\n\tvisitedVariables.add(variable);\n\treturn hasKnownEvidence(sourceCode, declarator.init, visitedVariables);\n}\n\nfunction isFunctionExpression(node: ESTree.Node): node is FunctionExpression {\n\treturn (\n\t\tnode.type === \"ArrowFunctionExpression\" ||\n\t\tnode.type === \"FunctionDeclaration\" ||\n\t\tnode.type === \"FunctionExpression\" ||\n\t\tnode.type === \"TSDeclareFunction\" ||\n\t\tnode.type === \"TSEmptyBodyFunctionExpression\"\n\t);\n}\n\nfunction localFunctionForCall(\n\tsourceCode: SourceCode,\n\tcallee: ESTree.Expression,\n): FunctionExpression | null {\n\tconst unwrapped = unwrapExpression(callee);\n\tif (isFunctionExpression(unwrapped)) return unwrapped;\n\tif (unwrapped.type !== \"Identifier\") return null;\n\tconst variable = resolveVariable(sourceCode, unwrapped);\n\tif (variable === null || variable.defs.length !== 1) return null;\n\tconst [definition] = variable.defs;\n\tif (definition === undefined) return null;\n\tif (definition.type === \"FunctionName\" && isFunctionExpression(definition.node)) {\n\t\treturn definition.node;\n\t}\n\tif (definition.type !== \"Variable\" || definition.node.type !== \"VariableDeclarator\") {\n\t\treturn null;\n\t}\n\tconst initializer = definition.node.init;\n\tif (initializer === null) return null;\n\tconst unwrappedInitializer = unwrapExpression(initializer);\n\treturn isFunctionExpression(unwrappedInitializer) ? unwrappedInitializer : null;\n}\n\nfunction variableTypeAnnotation(\n\tsourceCode: SourceCode,\n\tvariable: Variable,\n): ESTree.TSTypeAnnotation | null {\n\tif (variable.defs.length !== 1) return null;\n\tconst [definition] = variable.defs;\n\tif (definition === undefined) return null;\n\tif (\n\t\tdefinition.type === \"Variable\" &&\n\t\tdefinition.node.type === \"VariableDeclarator\" &&\n\t\tdefinition.node.id.type === \"Identifier\"\n\t) {\n\t\treturn definition.node.id.typeAnnotation ?? null;\n\t}\n\tif (definition.type !== \"Parameter\" || !isFunctionExpression(definition.node)) {\n\t\treturn null;\n\t}\n\tconst parameter = definition.node.params.find(\n\t\t(candidate) =>\n\t\t\tfunctionParameterBindingName(candidate, sourceCode) === variable.name,\n\t);\n\treturn parameter === undefined ? null : (functionParameterTypeAnnotation(parameter) ?? null);\n}\n\nfunction hasInformativeType(\n\ttype: ESTree.TSType,\n\tenvironment: TypeEnvironment,\n): boolean {\n\treturn classifyUnsafeDictionaryValue(type, environment) === null;\n}\n\nfunction hasKnownCallArgumentEvidence(\n\tsourceCode: SourceCode,\n\texpression: ESTree.Expression,\n\tenvironment: TypeEnvironment,\n\tvisitedVariables = new Set<Variable>(),\n): boolean {\n\tif (expression.type === \"ParenthesizedExpression\" || expression.type === \"TSNonNullExpression\") {\n\t\treturn hasKnownCallArgumentEvidence(\n\t\t\tsourceCode,\n\t\t\texpression.expression,\n\t\t\tenvironment,\n\t\t\tvisitedVariables,\n\t\t);\n\t}\n\tif (expression.type === \"TSAsExpression\" || expression.type === \"TSTypeAssertion\") {\n\t\treturn hasInformativeType(expression.typeAnnotation, environment);\n\t}\n\tif (expression.type === \"TSSatisfiesExpression\") {\n\t\treturn hasKnownCallArgumentEvidence(\n\t\t\tsourceCode,\n\t\t\texpression.expression,\n\t\t\tenvironment,\n\t\t\tvisitedVariables,\n\t\t);\n\t}\n\tif (expression.type === \"CallExpression\") {\n\t\tconst owner = localFunctionForCall(sourceCode, expression.callee);\n\t\tconst returnType = owner?.returnType?.typeAnnotation;\n\t\treturn returnType !== undefined && hasInformativeType(returnType, environment);\n\t}\n\tif (expression.type !== \"Identifier\") return isKnownEvidenceExpression(expression);\n\tconst variable = resolveVariable(sourceCode, expression);\n\tif (variable === null || visitedVariables.has(variable)) return false;\n\tconst annotation = variableTypeAnnotation(sourceCode, variable);\n\tif (annotation !== null) {\n\t\treturn hasInformativeType(annotation.typeAnnotation, environment);\n\t}\n\tconst declarator = variableDeclarator(variable);\n\tif (\n\t\tdeclarator === null ||\n\t\tdeclarator.init === null ||\n\t\t!isStableConstVariable(variable, declarator)\n\t) {\n\t\treturn false;\n\t}\n\tvisitedVariables.add(variable);\n\treturn hasKnownCallArgumentEvidence(\n\t\tsourceCode,\n\t\tdeclarator.init,\n\t\tenvironment,\n\t\tvisitedVariables,\n\t);\n}\n\nfunction typePredicateSubjectIndex(\n\tsourceCode: SourceCode,\n\towner: FunctionExpression,\n): number | null {\n\tconst predicate = owner.returnType?.typeAnnotation;\n\tif (predicate?.type !== \"TSTypePredicate\" || predicate.parameterName.type !== \"Identifier\") {\n\t\treturn null;\n\t}\n\tconst predicateParameterName = predicate.parameterName.name;\n\tconst index = owner.params.findIndex(\n\t\t(parameter) =>\n\t\t\tfunctionParameterBindingName(parameter, sourceCode) === predicateParameterName,\n\t);\n\treturn index === -1 ? null : index;\n}\n\nfunction annotationTarget(\n\tannotation: ESTree.TSTypeAnnotation | null | undefined,\n\tenvironment: TypeEnvironment,\n): WideningTarget | null {\n\treturn annotation === null || annotation === undefined\n\t\t? null\n\t\t: classifyWideningTarget(annotation.typeAnnotation, environment);\n}\n\nfunction enclosingFunction(node: ESTree.Node): FunctionExpression | null {\n\tlet current: ESTree.Node | null = node.parent;\n\twhile (current !== null && current.type !== \"Program\") {\n\t\tif (\n\t\t\tcurrent.type === \"ArrowFunctionExpression\" ||\n\t\t\tcurrent.type === \"FunctionDeclaration\" ||\n\t\t\tcurrent.type === \"FunctionExpression\"\n\t\t) {\n\t\t\treturn current;\n\t\t}\n\t\tcurrent = current.parent;\n\t}\n\treturn null;\n}\n\nfunction sourceKeyName(sourceCode: SourceCode, key: ESTree.PropertyKey): string {\n\tif (key.type === \"Identifier\" || key.type === \"PrivateIdentifier\") return key.name;\n\tif (key.type === \"Literal\") return String(key.value);\n\treturn sourceCode.getText(key);\n}\n\nfunction functionName(sourceCode: SourceCode, owner: FunctionExpression | null): string {\n\tif (owner === null) return \"anonymous function\";\n\tif (owner.id !== null) return owner.id.name;\n\tconst parent = owner.parent;\n\tif (parent.type === \"VariableDeclarator\" && parent.id.type === \"Identifier\")\n\t\treturn parent.id.name;\n\tif (parent.type === \"MethodDefinition\") return sourceKeyName(sourceCode, parent.key);\n\treturn \"anonymous function\";\n}\n\nfunction isEmptyObjectExpression(expression: ESTree.Expression): boolean {\n\tconst unwrapped = unwrapExpression(expression);\n\treturn unwrapped.type === \"ObjectExpression\" && unwrapped.properties.length === 0;\n}\n\nfunction isDictionaryAccumulatorTarget(destination: WideningTarget): boolean {\n\treturn destination.kind === \"open dictionary\" || destination.kind === \"generic container\";\n}\n\nfunction hasParentAssertion(node: ESTree.Node): boolean {\n\treturn node.parent?.type === \"TSAsExpression\" || node.parent?.type === \"TSTypeAssertion\";\n}\n\n/** Detect sound syntactic cases where a known value is explicitly widened and loses evidence. */\nexport const noKnownValueWideningRule = defineRule({\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow syntactically established values from flowing into explicitly broad or anonymous target types that discard useful evidence.\",\n\t\t},\n\t\tmessages: {\n\t\t\twidening:\n\t\t\t\t\"The explicit {{target}} type on {{subject}} discards known type evidence. Keep inference, validate with `satisfies`, or use a named owner contract.\",\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tlet environment: TypeEnvironment | null = null;\n\n\t\tconst reportFlow = (\n\t\t\texpression: ESTree.Expression,\n\t\t\tdestination: WideningTarget | null,\n\t\t\tsubject: string,\n\t\t) => {\n\t\t\tif (destination === null) return;\n\t\t\tif (\n\t\t\t\tisDictionaryAccumulatorTarget(destination) &&\n\t\t\t\tisEmptyObjectExpression(expression)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!hasKnownEvidence(context.sourceCode, expression)) return;\n\t\t\tcontext.report({\n\t\t\t\tnode: expression,\n\t\t\t\tmessageId: \"widening\",\n\t\t\t\tdata: { subject, target: destination.kind },\n\t\t\t});\n\t\t};\n\n\t\tconst targetFromAnnotation = (annotation: ESTree.TSTypeAnnotation | null | undefined) =>\n\t\t\tenvironment === null ? null : annotationTarget(annotation, environment);\n\n\t\treturn {\n\t\t\tProgram(node) {\n\t\t\t\tenvironment = createTypeEnvironment(\n\t\t\t\t\tnode,\n\t\t\t\t\tcontext.sourceCode.visitorKeys,\n\t\t\t\t);\n\t\t\t},\n\t\t\tVariableDeclarator(node) {\n\t\t\t\tif (node.init === null || node.id.type !== \"Identifier\") return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.init,\n\t\t\t\t\ttargetFromAnnotation(node.id.typeAnnotation),\n\t\t\t\t\t`binding \\`${node.id.name}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tPropertyDefinition(node) {\n\t\t\t\tif (node.value === null) return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.value,\n\t\t\t\t\ttargetFromAnnotation(node.typeAnnotation),\n\t\t\t\t\t`property \\`${sourceKeyName(context.sourceCode, node.key)}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tAccessorProperty(node) {\n\t\t\t\tif (node.value === null) return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.value,\n\t\t\t\t\ttargetFromAnnotation(node.typeAnnotation),\n\t\t\t\t\t`property \\`${sourceKeyName(context.sourceCode, node.key)}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tAssignmentExpression(node) {\n\t\t\t\tif (node.operator !== \"=\" || node.left.type !== \"Identifier\") return;\n\t\t\t\tconst variable = resolveVariable(context.sourceCode, node.left);\n\t\t\t\tif (variable === null) return;\n\t\t\t\tconst declarator = variableDeclarator(variable);\n\t\t\t\tif (declarator === null || declarator.id.type !== \"Identifier\") return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.right,\n\t\t\t\t\ttargetFromAnnotation(declarator.id.typeAnnotation),\n\t\t\t\t\t`binding \\`${declarator.id.name}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tCallExpression(node) {\n\t\t\t\tif (environment === null) return;\n\t\t\t\tconst owner = localFunctionForCall(context.sourceCode, node.callee);\n\t\t\t\tif (owner === null) return;\n\t\t\t\tconst parameterIndex = typePredicateSubjectIndex(context.sourceCode, owner);\n\t\t\t\tif (parameterIndex === null) return;\n\t\t\t\tconst parameter = owner.params[parameterIndex];\n\t\t\t\tconst argument = node.arguments[parameterIndex];\n\t\t\t\tif (parameter === undefined || argument === undefined || argument.type === \"SpreadElement\") {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst parameterAnnotation = functionParameterTypeAnnotation(parameter);\n\t\t\t\tif (\n\t\t\t\t\tparameterAnnotation === null ||\n\t\t\t\t\tparameterAnnotation === undefined ||\n\t\t\t\t\t!containsUnknownType(parameterAnnotation.typeAnnotation)\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\t!hasKnownCallArgumentEvidence(\n\t\t\t\t\t\tcontext.sourceCode,\n\t\t\t\t\t\targument,\n\t\t\t\t\t\tenvironment,\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: argument,\n\t\t\t\t\tmessageId: \"widening\",\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tsubject: `argument for parameter \\`${functionParameterBindingName(parameter, context.sourceCode)}\\` of \\`${functionName(context.sourceCode, owner)}\\``,\n\t\t\t\t\t\ttarget: \"unknown\",\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t\tReturnStatement(node) {\n\t\t\t\tif (node.argument === null) return;\n\t\t\t\tconst owner = enclosingFunction(node);\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.argument,\n\t\t\t\t\ttargetFromAnnotation(owner?.returnType),\n\t\t\t\t\t`return value of \\`${functionName(context.sourceCode, owner)}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tArrowFunctionExpression(node) {\n\t\t\t\tif (node.body.type === \"BlockStatement\") return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.body,\n\t\t\t\t\ttargetFromAnnotation(node.returnType),\n\t\t\t\t\t`return value of \\`${functionName(context.sourceCode, node)}\\``,\n\t\t\t\t);\n\t\t\t},\n\t\t\tTSAsExpression(node) {\n\t\t\t\tif (environment === null || hasParentAssertion(node)) return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.expression,\n\t\t\t\t\tclassifyWideningTarget(node.typeAnnotation, environment),\n\t\t\t\t\t\"assertion\",\n\t\t\t\t);\n\t\t\t},\n\t\t\tTSTypeAssertion(node) {\n\t\t\t\tif (environment === null || hasParentAssertion(node)) return;\n\t\t\t\treportFlow(\n\t\t\t\t\tnode.expression,\n\t\t\t\t\tclassifyWideningTarget(node.typeAnnotation, environment),\n\t\t\t\t\t\"assertion\",\n\t\t\t\t);\n\t\t\t},\n\t\t};\n\t},\n});\n","// A module mock replaces a dependency by file path, so the test exercises the mock and proves\n// nothing about the seam the code actually uses; when the real module's API changes the test keeps\n// passing. Scope it off only for a third-party module with no injectable seam, in that one test\n// file, naming the dependency so the exception disappears when the seam is added.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport { resolveVariable } from \"../shared/scope.ts\";\n\nimport type { ESTree, SourceCode } from \"@oxlint/plugins\";\n\nconst moduleMockMethods = new Set([\"doMock\", \"mock\", \"unstable_mockModule\"]);\n\nfunction importedName(node: ESTree.Node): string | null {\n if (node.type !== \"ImportSpecifier\") return null;\n return node.imported.type === \"Identifier\" ? node.imported.name : node.imported.value;\n}\n\nfunction isTestFrameworkObject(\n sourceCode: SourceCode,\n expression: ESTree.Expression,\n): expression is ESTree.IdentifierReference {\n if (expression.type !== \"Identifier\") return false;\n if (\n (expression.name === \"vi\" || expression.name === \"jest\") &&\n sourceCode.isGlobalReference(expression)\n ) {\n return true;\n }\n\n const variable = resolveVariable(sourceCode, expression);\n if (variable === null || variable.defs.length === 0) {\n return expression.name === \"vi\" || expression.name === \"jest\";\n }\n return variable.defs.some((definition) => {\n if (definition.type !== \"ImportBinding\" || definition.parent?.type !== \"ImportDeclaration\") {\n return false;\n }\n const source = definition.parent.source.value;\n const name = importedName(definition.node);\n return (source === \"vitest\" && name === \"vi\") || (source === \"@jest/globals\" && name === \"jest\");\n });\n}\n\nfunction moduleMockCall(sourceCode: SourceCode, callee: ESTree.Expression): boolean {\n if (!(\"property\" in callee) || !(\"object\" in callee) || !(\"computed\" in callee)) return false;\n if (!isTestFrameworkObject(sourceCode, callee.object)) return false;\n const property = callee.property;\n const method = callee.computed\n ? property.type === \"Literal\" &&\n (property.value === \"doMock\" ||\n property.value === \"mock\" ||\n property.value === \"unstable_mockModule\")\n ? property.value\n : null\n : property.type === \"Identifier\"\n ? property.name\n : null;\n return method !== null && moduleMockMethods.has(method);\n}\n\n/** Ban test framework module mocking in favor of real dependency seams. */\nexport const noModuleMockingRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Vitest and Jest module mocking; tests must replace dependencies through real interfaces.\",\n },\n messages: {\n moduleMock:\n \"Replace module mocking with dependency injection through a real interface, service layer, or faithful test implementation.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type === \"Super\" || node.callee.type === \"V8IntrinsicExpression\") return;\n if (moduleMockCall(context.sourceCode, node.callee)) {\n context.report({ node, messageId: \"moduleMock\" });\n }\n },\n };\n },\n});\n","// `object` tells a caller only that the value is not a primitive, so every field read in the body\n// needs a cast, an index signature or `Reflect`, and the call site gets no help at all. Scope it\n// off for a declaration file mirroring a signature you do not own, where narrowing the parameter\n// would misdescribe what the library accepts.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport {\n\tfunctionParameterBindingName,\n\tfunctionParameterTypeAnnotation,\n} from \"../shared/function-parameters.ts\";\nimport {\n\tcreateTypeAliasEnvironment,\n\tresolvedTypeMatches,\n\ttype TypeAliasEnvironment,\n} from \"../shared/type-alias-resolution.ts\";\ntype ParameterOwner =\n\t| ESTree.ArrowFunctionExpression\n\t| ESTree.Function\n\t| ESTree.TSCallSignatureDeclaration\n\t| ESTree.TSConstructSignatureDeclaration\n\t| ESTree.TSConstructorType\n\t| ESTree.TSFunctionType\n\t| ESTree.TSMethodSignature;\n\n/** Ban the broad object type on function inputs, including local aliases to object. */\nexport const noObjectParametersRule = defineRule({\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow object function parameters; inputs must use an owner-provided type and be parsed at their boundary.\",\n\t\t},\n\t\tmessages: {\n\t\t\tobjectParameter:\n\t\t\t\t\"Parameter `{{parameter}}` uses the broad `object` type. Accept a named owner type; parse external input at its boundary before calling this function.\",\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tlet environment: TypeAliasEnvironment | null = null;\n\n\t\tconst resolvesToObject = (type: ESTree.TSType): boolean =>\n\t\t\tenvironment !== null &&\n\t\t\tresolvedTypeMatches(type, environment, (resolved, matches) => {\n\t\t\t\tif (resolved.type === \"TSObjectKeyword\") return true;\n\t\t\t\tif (resolved.type === \"TSParenthesizedType\") {\n\t\t\t\t\treturn matches(resolved.typeAnnotation);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\tresolved.type === \"TSUnionType\" && resolved.types.some(matches)\n\t\t\t\t);\n\t\t\t});\n\n\t\tconst checkParameters = (node: ParameterOwner) => {\n\t\t\tfor (const parameter of node.params) {\n\t\t\t\tconst annotation = functionParameterTypeAnnotation(parameter);\n\t\t\t\tif (annotation === null || annotation === undefined) continue;\n\t\t\t\tif (!resolvesToObject(annotation.typeAnnotation)) continue;\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: annotation.typeAnnotation,\n\t\t\t\t\tmessageId: \"objectParameter\",\n\t\t\t\t\tdata: { parameter: functionParameterBindingName(parameter, context.sourceCode) },\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\treturn {\n\t\t\tProgram(node) {\n\t\t\t\tenvironment = createTypeAliasEnvironment(\n\t\t\t\t\tnode,\n\t\t\t\t\tcontext.sourceCode.visitorKeys,\n\t\t\t\t);\n\t\t\t},\n\t\t\tArrowFunctionExpression: checkParameters,\n\t\t\tFunctionDeclaration: checkParameters,\n\t\t\tFunctionExpression: checkParameters,\n\t\t\tTSCallSignatureDeclaration: checkParameters,\n\t\t\tTSConstructSignatureDeclaration: checkParameters,\n\t\t\tTSConstructorType: checkParameters,\n\t\t\tTSDeclareFunction: checkParameters,\n\t\t\tTSEmptyBodyFunctionExpression: checkParameters,\n\t\t\tTSFunctionType: checkParameters,\n\t\t\tTSMethodSignature: checkParameters,\n\t\t};\n\t},\n});\n","// Copying the accumulator on every step allocates an object per element and copies everything\n// collected so far, so the work grows with the square of the input. It reads as careful\n// immutability and is a performance bug at any real size. Nothing needs it off: the accumulator\n// belongs to the reduction, so mutating it and returning it is safe.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree, SourceCode, Variable } from \"@oxlint/plugins\";\n\nimport {\n arrayMethodTarget,\n isKnownArrayExpression,\n resolveArrayBinding,\n unwrapArrayExpression,\n} from \"../shared/array-method.ts\";\n\nfunction enclosingReducer(node: ESTree.Node) {\n let parent = node.parent;\n while (parent !== null) {\n if (parent.type === \"FunctionDeclaration\") return null;\n if (parent.type === \"ArrowFunctionExpression\" || parent.type === \"FunctionExpression\") {\n const callback = parent;\n let owner: ESTree.Node | null = callback.parent;\n while (owner !== null && unwrapArrayExpression(owner) === callback) owner = owner.parent;\n if (owner?.type !== \"CallExpression\") return null;\n const method = arrayMethodTarget(owner.callee);\n const firstArgument = owner.arguments[0];\n if (\n method === null || (method.name !== \"reduce\" && method.name !== \"reduceRight\") ||\n owner.arguments.length > 2 || firstArgument === undefined ||\n unwrapArrayExpression(firstArgument) !== callback\n ) return null;\n const firstParameter = callback.params[0];\n const accumulator = firstParameter?.type === \"AssignmentPattern\" ? firstParameter.left : firstParameter;\n if (accumulator?.type !== \"Identifier\") return null;\n return { callback, accumulator, initialValue: owner.arguments[1] };\n }\n parent = parent.parent;\n }\n return null;\n}\n\nfunction referencesAccumulator(\n sourceCode: SourceCode,\n node: ESTree.Node,\n accumulator: Variable,\n visited = new Set<Variable>(),\n): boolean {\n const variable = resolveArrayBinding(sourceCode, node);\n if (variable === null || visited.has(variable)) return false;\n if (variable === accumulator) return true;\n visited.add(variable);\n if (variable.references.some(reference => reference.isWrite() && !reference.init)) return false;\n for (const definition of variable.defs) {\n if (\n definition.type === \"Variable\" && definition.node.type === \"VariableDeclarator\" &&\n definition.node.id.type === \"Identifier\" && definition.node.init !== null &&\n definition.node.parent.type === \"VariableDeclaration\" && definition.node.parent.kind === \"const\"\n ) {\n return referencesAccumulator(sourceCode, definition.node.init, accumulator, visited);\n }\n }\n return false;\n}\n\nfunction isGlobalCopyOwner(sourceCode: SourceCode, node: ESTree.Node, name: string): boolean {\n node = unwrapArrayExpression(node);\n if (node.type !== \"Identifier\" || node.name !== name) return false;\n const variable = resolveArrayBinding(sourceCode, node);\n return variable === null || variable.defs.length === 0;\n}\n\n/** Reject non-spread copies of reducer accumulators; pair with oxc/no-accumulating-spread. */\nexport const noReduceAccumulatorCopyRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Disallow copying growing reducer accumulators with Object.assign, Array.from, or array copy methods.\" },\n messages: {\n accumulatorCopy: \"Do not copy the reducer accumulator on every iteration; growing copies can cause quadratic work. Mutate a fresh, locally owned accumulator and return it, or use an iterator pipeline/flatMap.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const method = arrayMethodTarget(node.callee);\n if (method === null) return;\n const reducer = enclosingReducer(node);\n if (reducer === null) return;\n const accumulator = context.sourceCode.getDeclaredVariables(reducer.callback).find(variable =>\n variable.identifiers.some(identifier => identifier.start === reducer.accumulator.start),\n );\n if (accumulator === undefined) return;\n const isAccumulator = (expression: ESTree.Node) =>\n referencesAccumulator(context.sourceCode, expression, accumulator);\n let copiesAccumulator = false;\n if (method.name === \"assign\" && isGlobalCopyOwner(context.sourceCode, method.object, \"Object\")) {\n const target = node.arguments[0];\n copiesAccumulator = (\n target !== undefined && unwrapArrayExpression(target).type === \"ObjectExpression\" &&\n node.arguments.slice(1).some(isAccumulator)\n );\n } else if (method.name === \"from\" && isGlobalCopyOwner(context.sourceCode, method.object, \"Array\")) {\n const source = node.arguments[0];\n copiesAccumulator = source !== undefined && isAccumulator(source);\n } else if ([\"concat\", \"slice\", \"toSpliced\", \"toSorted\", \"toReversed\", \"with\"].includes(method.name)) {\n const initialValue = reducer.initialValue;\n const arrayAccumulator = initialValue !== undefined &&\n isKnownArrayExpression(context.sourceCode, initialValue);\n copiesAccumulator = arrayAccumulator && isAccumulator(method.object);\n }\n if (copiesAccumulator) context.report({ node, messageId: \"accumulatorCopy\" });\n },\n };\n },\n});\n","import { resolveVariable } from \"./scope.ts\";\n\nimport type { ESTree, SourceCode } from \"@oxlint/plugins\";\n\nfunction isGlobalReflect(sourceCode: SourceCode, expression: ESTree.Expression): boolean {\n if (expression.type !== \"Identifier\" || expression.name !== \"Reflect\") return false;\n if (sourceCode.isGlobalReference(expression)) return true;\n const variable = resolveVariable(sourceCode, expression);\n return variable === null || variable.defs.length === 0;\n}\n\n/** Reports whether a call target names one method on the global Reflect object. */\nexport function isGlobalReflectMethodCall(\n sourceCode: SourceCode,\n callee: ESTree.Expression,\n methodName: string,\n): boolean {\n if (!(\"property\" in callee) || !(\"object\" in callee) || !(\"computed\" in callee)) return false;\n if (!isGlobalReflect(sourceCode, callee.object)) return false;\n const property = callee.property;\n return callee.computed\n ? property.type === \"Literal\" && property.value === methodName\n : property.type === \"Identifier\" && property.name === methodName;\n}\n","// `Reflect.apply` takes the arguments as an array, so the checker sees nothing about arity or\n// argument types and every mistake surfaces at runtime. It also hides who is being called, the one\n// thing a reader wants from a dispatch site. Scope it off for a `Proxy` `apply` trap, where\n// forwarding this way is the documented means of keeping the original behaviour.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport { isGlobalReflectMethodCall } from \"../shared/reflect-method.ts\";\n\n/** Ban Reflect.apply, which bypasses ordinary typed function calls. */\nexport const noReflectApplyRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Reflect.apply; call typed functions directly or model dynamic dispatch behind an interface.\",\n },\n messages: {\n reflectApply:\n \"Replace `Reflect.apply` with a typed function call. Model dynamic dispatch behind a named interface.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type === \"Super\" || node.callee.type === \"V8IntrinsicExpression\") return;\n if (isGlobalReflectMethodCall(context.sourceCode, node.callee, \"apply\")) {\n context.report({ node, messageId: \"reflectApply\" });\n }\n },\n };\n },\n});\n","// `Reflect.get` returns `any` and asks the checker no questions, so a misspelled key and a renamed\n// field both survive to runtime. It is usually reached for when the value was never parsed into a\n// type that has the field. Scope it off for a `Proxy` `get` trap, where forwarding with the right\n// receiver is what keeps getters on the prototype chain working.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport { isGlobalReflectMethodCall } from \"../shared/reflect-method.ts\";\n\n/** Ban Reflect.get, which bypasses ordinary property access and useful type evidence. */\nexport const noReflectGetRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Reflect.get; use typed property access or parse dynamic input into a domain type.\",\n },\n messages: {\n reflectGet:\n \"Replace `Reflect.get` with typed property access. Parse dynamic input into a named domain type before reading it.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type === \"Super\" || node.callee.type === \"V8IntrinsicExpression\") return;\n if (isGlobalReflectMethodCall(context.sourceCode, node.callee, \"get\")) {\n context.report({ node, messageId: \"reflectGet\" });\n }\n },\n };\n },\n});\n","// `typeof value === \"string\"` says how a value is represented, not what it means or where it came\n// from, so narrowing this way scatters half a parser across the branches that consume it. Scope it\n// off for a decoder module, the one place per kind of outside value where that parse belongs, and\n// for tests, where asserting the shape of your own public API reads as unparsed input.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\ntype RuntimeFunction = ESTree.ArrowFunctionExpression | ESTree.Function;\n\nfunction isRuntimeFunction(node: ESTree.Node): node is RuntimeFunction {\n\treturn (\n\t\tnode.type === \"ArrowFunctionExpression\" ||\n\t\tnode.type === \"FunctionDeclaration\" ||\n\t\tnode.type === \"FunctionExpression\"\n\t);\n}\n\nfunction isInsideTypeGuard(node: ESTree.Node): boolean {\n\tlet current: ESTree.Node | null = node.parent;\n\twhile (current !== null && current.type !== \"Program\") {\n\t\tif (isRuntimeFunction(current)) {\n\t\t\treturn current.returnType?.typeAnnotation.type === \"TSTypePredicate\";\n\t\t}\n\t\tcurrent = current.parent;\n\t}\n\treturn false;\n}\n\n/** Return whether typeof safely probes for the existence of a possibly absent binding. */\nfunction isExistenceProbe(node: ESTree.UnaryExpression): boolean {\n\tconst parent = node.parent;\n\tif (parent.type !== \"BinaryExpression\") return false;\n\tif (![\"===\", \"!==\", \"==\", \"!=\"].includes(parent.operator)) return false;\n\tconst other = parent.left === node ? parent.right : parent.left;\n\treturn other.type === \"Literal\" && other.value === \"undefined\";\n}\n\n/** Disallow runtime typeof checks that narrow unparsed values instead of decoding them. */\nexport const noRuntimeTypeofRule = defineRule({\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow runtime typeof checks; external values must be decoded into meaningful types at their I/O boundary.\",\n\t\t},\n\t\tmessages: {\n\t\t\truntimeTypeof:\n\t\t\t\t\"A `typeof` check narrows a representation without establishing its contract. Parse input at its I/O boundary, then branch on the domain value.\",\n\t\t\truntimeTypeofWithHint:\n\t\t\t\t\"A `typeof` check narrows a representation without establishing its contract. Parse input at its I/O boundary, then branch on the domain value. {{hint}}\",\n\t\t},\n\t\tschema: [\n\t\t\t{\n\t\t\t\ttype: \"object\",\n\t\t\t\tproperties: {\n\t\t\t\t\tallowInTypeGuards: { type: \"boolean\" },\n\t\t\t\t\thint: { type: \"string\" },\n\t\t\t\t},\n\t\t\t\tadditionalProperties: false,\n\t\t\t},\n\t\t],\n\t\tdefaultOptions: [{ allowInTypeGuards: false }],\n\t},\n\tcreateOnce(context) {\n\t\treturn {\n\t\t\tUnaryExpression(node) {\n\t\t\t\tconst option = context.options?.[0];\n\t\t\t\tconst configured =\n\t\t\t\t\ttypeof option === \"object\" && option !== null && !Array.isArray(option);\n\t\t\t\tconst allowInTypeGuards = configured && option.allowInTypeGuards === true;\n\t\t\t\tconst hint = configured && typeof option.hint === \"string\" ? option.hint : undefined;\n\t\t\t\tif (\n\t\t\t\t\tnode.operator === \"typeof\" &&\n\t\t\t\t\t!isExistenceProbe(node) &&\n\t\t\t\t\t(!allowInTypeGuards || !isInsideTypeGuard(node))\n\t\t\t\t) {\n\t\t\t\t\tif (hint === undefined) {\n\t\t\t\t\t\tcontext.report({ node, messageId: \"runtimeTypeof\" });\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext.report({ node, messageId: \"runtimeTypeofWithHint\", data: { hint } });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n});\n","// `PayloadShape` and `userShape` name the structure of a value instead of its role, the tell of a\n// type written to satisfy the compiler rather than to describe the domain, and the name outlives\n// every refactor that changes what the value is for. The word has to open a segment, so `shapeOf`\n// and `shapes` report while `reshape` does not. Scope it off where a shape is the domain itself:\n// drawing, geometry, a layout engine.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree } from \"@oxlint/plugins\";\n\nconst FORBIDDEN_SYMBOL_NAME = \"shape\";\n\n// One word of an identifier: an acronym run, a capitalised word, a lowercase run\n// or a digit run. camelCase, PascalCase, snake_case and SCREAMING_CASE all split\n// here, and `XMLShape` splits into `XML` and `Shape`.\nconst IDENTIFIER_WORD = /[A-Z]+(?![a-z])|[A-Z]?[a-z]+|\\d+/gu;\n\nfunction containsForbiddenSymbolName(name: string): boolean {\n const words = name.match(IDENTIFIER_WORD) ?? [];\n return words.some((word) => word.toLowerCase().startsWith(FORBIDDEN_SYMBOL_NAME));\n}\n\n/** Return whether an identifier names a statically accessed member owned by another value. */\nfunction isBorrowedMemberName(node: ESTree.Node): boolean {\n const parent = node.parent;\n if (parent === null || parent.type !== \"MemberExpression\") return false;\n return parent.property === node && parent.computed === false;\n}\n\n/** Ban the word \"shape\" in every JavaScript and TypeScript symbol name. */\nexport const noForbiddenTermInSymbolNamesRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n 'Disallow the word \"shape\" in JavaScript, TypeScript, private, and JSX symbol names.',\n },\n messages: {\n forbiddenSymbolName:\n 'Rename symbol \"{{name}}\" for its domain role; \"shape\" describes structure rather than ownership.',\n },\n },\n createOnce(context) {\n const reportForbiddenSymbolName = (node: ESTree.Node & { name: string }) => {\n if (!containsForbiddenSymbolName(node.name) || isBorrowedMemberName(node)) return;\n context.report({\n node,\n messageId: \"forbiddenSymbolName\",\n data: { name: node.name },\n });\n };\n\n return {\n Identifier: reportForbiddenSymbolName,\n PrivateIdentifier: reportForbiddenSymbolName,\n JSXIdentifier: reportForbiddenSymbolName,\n };\n },\n});\n","// An `unknown` parameter moves the parsing work from the caller, who knows what the value is, to\n// the body, which does not, so every call site passes whatever it has. Scope it off for the error\n// decoder that turns a rejection into a domain failure: TypeScript types a `catch` binding as\n// `unknown`, so that one contract is honest.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport {\n containsUnknownType,\n functionParameterBindingName,\n functionParameterTypeAnnotation,\n} from \"../shared/function-parameters.ts\";\ntype ParameterOwner =\n | ESTree.ArrowFunctionExpression\n | ESTree.Function\n | ESTree.TSCallSignatureDeclaration\n | ESTree.TSConstructSignatureDeclaration\n | ESTree.TSConstructorType\n | ESTree.TSFunctionType\n | ESTree.TSMethodSignature;\n\nfunction isTypePredicateSubject(owner: ParameterOwner, parameterName: string): boolean {\n const predicate = owner.returnType?.typeAnnotation;\n return (\n predicate?.type === \"TSTypePredicate\" &&\n predicate.parameterName.type === \"Identifier\" &&\n predicate.parameterName.name === parameterName\n );\n}\n\n/** Disallow unknown inputs except explicitly named error-cause enrichment. */\nexport const noUnknownParametersRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow explicitly unknown function parameters except `cause` and type-predicate subjects; decode unknown input at its I/O boundary instead.\",\n },\n messages: {\n unknownParameter:\n \"Parameter `{{parameter}}` leaves input unparsed. Accept a named domain type; run the expected schema or parser at the I/O boundary before calling this function.\",\n unknownParameterWithHint:\n \"Parameter `{{parameter}}` leaves input unparsed. Accept a named domain type; run the expected schema or parser at the I/O boundary before calling this function. {{hint}}\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n hint: { type: \"string\" },\n },\n additionalProperties: false,\n },\n ],\n },\n createOnce(context) {\n const checkParameters = (node: ParameterOwner) => {\n const option = context.options?.[0];\n const configured = typeof option === \"object\" && option !== null && !Array.isArray(option);\n const hint = configured && typeof option.hint === \"string\" ? option.hint : undefined;\n for (const parameter of node.params) {\n const annotation = functionParameterTypeAnnotation(parameter);\n if (annotation === null || annotation === undefined) continue;\n if (!containsUnknownType(annotation.typeAnnotation)) continue;\n const name = functionParameterBindingName(parameter, context.sourceCode);\n if (name === \"cause\" || isTypePredicateSubject(node, name)) continue;\n if (hint === undefined) {\n context.report({\n node: annotation.typeAnnotation,\n messageId: \"unknownParameter\",\n data: { parameter: name },\n });\n } else {\n context.report({\n node: annotation.typeAnnotation,\n messageId: \"unknownParameterWithHint\",\n data: { parameter: name, hint },\n });\n }\n }\n };\n\n return {\n ArrowFunctionExpression: checkParameters,\n FunctionDeclaration: checkParameters,\n FunctionExpression: checkParameters,\n TSCallSignatureDeclaration: checkParameters,\n TSConstructSignatureDeclaration: checkParameters,\n TSConstructorType: checkParameters,\n TSDeclareFunction: checkParameters,\n TSEmptyBodyFunctionExpression: checkParameters,\n TSFunctionType: checkParameters,\n TSMethodSignature: checkParameters,\n };\n },\n});\n","// A function returning `unknown` hands its caller a value and no way to use it, so the caller\n// either asserts or writes the parse the function should have done, once per call site. Scope it\n// off for a declaration file mirroring an external API whose real return type is `unknown`,\n// `JSON.parse` being the obvious one.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport {\n createTypeAliasEnvironment,\n resolvedTypeMatches,\n type TypeAliasEnvironment,\n} from \"../shared/type-alias-resolution.ts\";\n\ntype FunctionWithReturnType =\n | ESTree.ArrowFunctionExpression\n | ESTree.Function\n | ESTree.TSCallSignatureDeclaration\n | ESTree.TSConstructSignatureDeclaration\n | ESTree.TSConstructorType\n | ESTree.TSFunctionType\n | ESTree.TSMethodSignature;\n\n/** Ban function contracts that return unknown instead of a parsed domain type. */\nexport const noUnknownReturnsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow functions whose explicit return contract is unknown or Promise<unknown>.\",\n },\n messages: {\n unknownReturn:\n \"This function exposes `unknown` to its caller. Parse the value at its boundary and return a named domain type.\",\n },\n },\n createOnce(context) {\n let environment: TypeAliasEnvironment | null = null;\n\n const resolvesToUnknown = (type: ESTree.TSType): boolean =>\n environment !== null &&\n resolvedTypeMatches(type, environment, (resolved, matches) => {\n if (resolved.type === \"TSUnknownKeyword\") return true;\n if (resolved.type === \"TSParenthesizedType\") {\n return matches(resolved.typeAnnotation);\n }\n if (resolved.type === \"TSUnionType\") return resolved.types.some(matches);\n if (\n resolved.type !== \"TSTypeReference\" ||\n resolved.typeName.type !== \"Identifier\" ||\n (resolved.typeName.name !== \"Promise\" &&\n resolved.typeName.name !== \"PromiseLike\")\n ) {\n return false;\n }\n const value = resolved.typeArguments?.params[0];\n return value !== undefined && matches(value);\n });\n\n const checkReturnType = (node: FunctionWithReturnType) => {\n const annotation = node.returnType;\n if (annotation === null || annotation === undefined) return;\n if (!resolvesToUnknown(annotation.typeAnnotation)) return;\n context.report({ node: annotation.typeAnnotation, messageId: \"unknownReturn\" });\n };\n\n return {\n Program(node) {\n environment = createTypeAliasEnvironment(\n node,\n context.sourceCode.visitorKeys,\n );\n },\n ArrowFunctionExpression: checkReturnType,\n FunctionDeclaration: checkReturnType,\n FunctionExpression: checkReturnType,\n TSCallSignatureDeclaration: checkReturnType,\n TSConstructSignatureDeclaration: checkReturnType,\n TSConstructorType: checkReturnType,\n TSDeclareFunction: checkReturnType,\n TSEmptyBodyFunctionExpression: checkReturnType,\n TSFunctionType: checkReturnType,\n TSMethodSignature: checkReturnType,\n };\n },\n});\n","// `type Payload = unknown` gives a vague type a confident name, so every signature that uses it\n// reads as if it were parsed. A union hides it just as quietly, since `string | unknown` is\n// `unknown`. Nothing needs it off: where `unknown` is genuinely right, writing it at that spot is\n// clearer than a name that conceals it.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport {\n\tcreateTypeAliasEnvironment,\n\tresolvedTypeMatches,\n\ttype TypeAliasEnvironment,\n} from \"../shared/type-alias-resolution.ts\";\n\n/** Ban named aliases that merely conceal TypeScript's unknown top type. */\nexport const noUnknownTypeAliasesRule = defineRule({\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow type aliases whose resolved type is unknown; unknown must remain visible at an allowed boundary.\",\n\t\t},\n\t\tmessages: {\n\t\t\tunknownAlias:\n\t\t\t\t\"Type alias `{{alias}}` hides `unknown`. Keep `unknown` explicit at the parsing boundary or on an allowed `cause` field; otherwise use the parsed owner type.\",\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tlet environment: TypeAliasEnvironment | null = null;\n\n\t\tconst resolvesToUnknown = (type: ESTree.TSType): boolean =>\n\t\t\tenvironment !== null &&\n\t\t\tresolvedTypeMatches(type, environment, (resolved, matches) => {\n\t\t\t\tif (resolved.type === \"TSUnknownKeyword\") return true;\n\t\t\t\tif (resolved.type === \"TSParenthesizedType\") {\n\t\t\t\t\treturn matches(resolved.typeAnnotation);\n\t\t\t\t}\n\t\t\t\treturn resolved.type === \"TSUnionType\" && resolved.types.some(matches);\n\t\t\t});\n\n\t\treturn {\n\t\t\tProgram(node) {\n\t\t\t\tenvironment = createTypeAliasEnvironment(\n\t\t\t\t\tnode,\n\t\t\t\t\tcontext.sourceCode.visitorKeys,\n\t\t\t\t);\n\t\t\t},\n\t\t\tTSTypeAliasDeclaration(node) {\n\t\t\t\tif (!resolvesToUnknown(node.typeAnnotation)) return;\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: node.id,\n\t\t\t\t\tmessageId: \"unknownAlias\",\n\t\t\t\t\tdata: { alias: node.id.name },\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t},\n});\n","// `Record<string, unknown>` promises a lookup and delivers nothing: every read needs a cast, and\n// the cast is written at each call site by someone guessing. The type is usually a stand-in for a\n// schema nobody wrote. Scope it off for the one module that holds a decoded JSON object before any\n// field is read, never for its callers.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport {\n\tclassifyUnsafeDictionary,\n\tclassifyUnsafeDictionaryValue,\n\tcreateTypeEnvironment,\n\ttype TypeEnvironment,\n} from \"../shared/dictionary-types.ts\";\nimport { visibleTypeAlias } from \"../shared/type-alias-resolution.ts\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nconst typeNodeKinds: ReadonlySet<string> = new Set([\n\t\"JSDocNonNullableType\",\n\t\"JSDocNullableType\",\n\t\"JSDocUnknownType\",\n\t\"TSAnyKeyword\",\n\t\"TSArrayType\",\n\t\"TSBigIntKeyword\",\n\t\"TSBooleanKeyword\",\n\t\"TSConditionalType\",\n\t\"TSConstructorType\",\n\t\"TSFunctionType\",\n\t\"TSImportType\",\n\t\"TSIndexedAccessType\",\n\t\"TSInferType\",\n\t\"TSIntersectionType\",\n\t\"TSIntrinsicKeyword\",\n\t\"TSLiteralType\",\n\t\"TSMappedType\",\n\t\"TSNamedTupleMember\",\n\t\"TSNeverKeyword\",\n\t\"TSNullKeyword\",\n\t\"TSNumberKeyword\",\n\t\"TSObjectKeyword\",\n\t\"TSParenthesizedType\",\n\t\"TSStringKeyword\",\n\t\"TSSymbolKeyword\",\n\t\"TSTemplateLiteralType\",\n\t\"TSThisType\",\n\t\"TSTupleType\",\n\t\"TSTypeLiteral\",\n\t\"TSTypeOperator\",\n\t\"TSTypePredicate\",\n\t\"TSTypeQuery\",\n\t\"TSTypeReference\",\n\t\"TSUndefinedKeyword\",\n\t\"TSUnionType\",\n\t\"TSUnknownKeyword\",\n\t\"TSVoidKeyword\",\n]);\n\nfunction isTypeNode(node: ESTree.Node): node is ESTree.TSType {\n\treturn typeNodeKinds.has(node.type);\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n\treturn type.typeName.type === \"Identifier\" ? type.typeName.name : null;\n}\n\nfunction isInsideTypeAliasDeclaration(node: ESTree.Node): boolean {\n\tlet current: ESTree.Node | null = node.parent;\n\twhile (current !== null && current.type !== \"Program\") {\n\t\tif (current.type === \"TSTypeAliasDeclaration\") return true;\n\t\tcurrent = current.parent;\n\t}\n\treturn false;\n}\n\nfunction isPlainAliasConsumerUse(node: ESTree.TSType, environment: TypeEnvironment): boolean {\n\tif (node.type !== \"TSTypeReference\" || node.typeArguments?.params.length) return false;\n\tconst name = typeReferenceName(node);\n\treturn (\n\t\tname !== null &&\n\t\tvisibleTypeAlias(name, node, environment.typeAliases) !== null &&\n\t\t!isInsideTypeAliasDeclaration(node)\n\t);\n}\n\nfunction isInsideTypeParameterConstraint(node: ESTree.TSType): boolean {\n\tlet child: ESTree.Node = node;\n\tlet parent: ESTree.Node | null = child.parent;\n\twhile (parent !== null && parent.type !== \"Program\") {\n\t\tif (parent.type === \"TSTypeParameter\" && parent.constraint === child) return true;\n\t\tchild = parent;\n\t\tparent = child.parent;\n\t}\n\treturn false;\n}\n\nfunction shouldReportType(node: ESTree.TSType, environment: TypeEnvironment): boolean {\n\tif (isInsideTypeParameterConstraint(node)) return false;\n\tif (isPlainAliasConsumerUse(node, environment)) return false;\n\tif (classifyUnsafeDictionary(node, environment) === null) return false;\n\tlet current: ESTree.Node | null = node.parent;\n\twhile (current !== null && current.type !== \"Program\") {\n\t\tif (isTypeNode(current) && classifyUnsafeDictionary(current, environment) !== null)\n\t\t\treturn false;\n\t\tcurrent = current.parent;\n\t}\n\treturn true;\n}\n\n/** Disallow object-dictionary contracts whose direct value type is an unsafe escape hatch. */\nexport const noUnsafeDictionaryTypeRule = defineRule({\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow object-dictionary contracts whose direct value type is unknown, any, object, {}, or a union/alias containing one of those escape hatches.\",\n\t\t},\n\t\tmessages: {\n\t\t\tunsafeDictionary:\n\t\t\t\t\"This dictionary's {{value}} value type gives callers no concrete value contract. Use an owner/schema-derived value type; parse external payloads before insertion.\",\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tlet environment: TypeEnvironment | null = null;\n\t\tconst report = (node: ESTree.Node, value: string) => {\n\t\t\tcontext.report({ node, messageId: \"unsafeDictionary\", data: { value } });\n\t\t};\n\t\tconst reportIfUnsafe = (node: ESTree.TSType) => {\n\t\t\tif (environment === null || !shouldReportType(node, environment)) return;\n\t\t\tconst unsafe = classifyUnsafeDictionary(node, environment);\n\t\t\tif (unsafe === null) return;\n\t\t\treport(node, unsafe.unsafeValue);\n\t\t};\n\n\t\treturn {\n\t\t\tProgram(node) {\n\t\t\t\tenvironment = createTypeEnvironment(\n\t\t\t\t\tnode,\n\t\t\t\t\tcontext.sourceCode.visitorKeys,\n\t\t\t\t);\n\t\t\t},\n\t\t\tTSTypeReference: reportIfUnsafe,\n\t\t\tTSTypeLiteral: reportIfUnsafe,\n\t\t\tTSMappedType: reportIfUnsafe,\n\t\t\tTSIndexSignature(node) {\n\t\t\t\tif (\n\t\t\t\t\tenvironment === null ||\n\t\t\t\t\tnode.typeAnnotation === null ||\n\t\t\t\t\tnode.parent.type === \"TSTypeLiteral\"\n\t\t\t\t)\n\t\t\t\t\treturn;\n\t\t\t\tconst unsafe = classifyUnsafeDictionaryValue(\n\t\t\t\t\tnode.typeAnnotation.typeAnnotation,\n\t\t\t\t\tenvironment,\n\t\t\t\t);\n\t\t\t\tif (unsafe !== null) report(node, unsafe.unsafeValue);\n\t\t\t},\n\t\t};\n\t},\n});\n","// The round trip costs the file its one piece of real evidence: the initializer showed what the\n// value was, the annotation threw that away, and the assertion re-invents it by hand, so a typo in\n// the asserted type is unreachable by the checker. Nothing needs it off, since a value that\n// genuinely arrives unknown is never locally widened.\n\nimport { defineRule } from \"@oxlint/plugins\";\nimport type { ESTree, Variable } from \"@oxlint/plugins\";\n\ntype BroadTypeKind = \"top\" | \"object\" | \"record\";\n\ntype KnownValueEvidence = {\n readonly type: ESTree.TSType | null;\n};\n\nconst functionBoundaryTypes = new Set([\n \"ArrowFunctionExpression\",\n \"FunctionDeclaration\",\n \"FunctionExpression\",\n \"TSDeclareFunction\",\n \"TSEmptyBodyFunctionExpression\",\n]);\n\nfunction unwrapExpressionParentheses(expression: ESTree.Expression): ESTree.Expression {\n let current = expression;\n while (current.type === \"ParenthesizedExpression\") current = current.expression;\n return current;\n}\n\nfunction unwrapTypeParentheses(type: ESTree.TSType): ESTree.TSType {\n let current = type;\n while (current.type === \"TSParenthesizedType\") current = current.typeAnnotation;\n return current;\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n return type.typeName.type === \"Identifier\" ? type.typeName.name : null;\n}\n\nfunction isUnknownOrAnyType(type: ESTree.TSType): boolean {\n const unwrapped = unwrapTypeParentheses(type);\n return unwrapped.type === \"TSUnknownKeyword\" || unwrapped.type === \"TSAnyKeyword\";\n}\n\nfunction isBroadRecordKeyType(type: ESTree.TSType): boolean {\n const unwrapped = unwrapTypeParentheses(type);\n if (\n unwrapped.type === \"TSStringKeyword\" ||\n unwrapped.type === \"TSNumberKeyword\" ||\n unwrapped.type === \"TSSymbolKeyword\"\n ) {\n return true;\n }\n if (unwrapped.type === \"TSUnionType\") return unwrapped.types.every(isBroadRecordKeyType);\n return unwrapped.type === \"TSTypeReference\" && typeReferenceName(unwrapped) === \"PropertyKey\";\n}\n\nfunction isBroadRecordType(type: ESTree.TSType): boolean {\n const unwrapped = unwrapTypeParentheses(type);\n\n if (unwrapped.type === \"TSTypeReference\") {\n if (typeReferenceName(unwrapped) === \"Readonly\") {\n const [inner] = unwrapped.typeArguments?.params ?? [];\n return inner !== undefined && isBroadRecordType(inner);\n }\n\n if (typeReferenceName(unwrapped) !== \"Record\") return false;\n const parameters = unwrapped.typeArguments?.params ?? [];\n return (\n parameters.length === 2 &&\n parameters[0] !== undefined &&\n parameters[1] !== undefined &&\n isBroadRecordKeyType(parameters[0]) &&\n isUnknownOrAnyType(parameters[1])\n );\n }\n\n if (unwrapped.type !== \"TSTypeLiteral\" || unwrapped.members.length !== 1) return false;\n const [member] = unwrapped.members;\n const [parameter] = member?.type === \"TSIndexSignature\" ? member.parameters : [];\n return (\n member?.type === \"TSIndexSignature\" &&\n member.parameters.length === 1 &&\n parameter !== undefined &&\n isBroadRecordKeyType(parameter.typeAnnotation.typeAnnotation) &&\n isUnknownOrAnyType(member.typeAnnotation.typeAnnotation)\n );\n}\n\nfunction broadTypeKind(type: ESTree.TSType): BroadTypeKind | null {\n const unwrapped = unwrapTypeParentheses(type);\n if (unwrapped.type === \"TSUnknownKeyword\" || unwrapped.type === \"TSAnyKeyword\") return \"top\";\n if (unwrapped.type === \"TSObjectKeyword\") return \"object\";\n return isBroadRecordType(unwrapped) ? \"record\" : null;\n}\n\nfunction assertedExpression(\n node: ESTree.TSAsExpression | ESTree.TSTypeAssertion,\n): ESTree.Expression {\n return unwrapExpressionParentheses(node.expression);\n}\n\nfunction assertionFromExpression(\n expression: ESTree.Expression,\n): ESTree.TSAsExpression | ESTree.TSTypeAssertion | null {\n const unwrapped = unwrapExpressionParentheses(expression);\n return unwrapped.type === \"TSAsExpression\" || unwrapped.type === \"TSTypeAssertion\"\n ? unwrapped\n : null;\n}\n\nfunction normalizedTypeText(sourceText: string, type: ESTree.TSType): string {\n return sourceText.slice(type.start, type.end).replaceAll(/\\s+/gu, \"\");\n}\n\nfunction typesHaveSameSyntax(\n sourceText: string,\n left: ESTree.TSType | null,\n right: ESTree.TSType,\n): boolean {\n return (\n left !== null &&\n normalizedTypeText(sourceText, unwrapTypeParentheses(left)) ===\n normalizedTypeText(sourceText, unwrapTypeParentheses(right))\n );\n}\n\nfunction isDefinitelyObjectType(type: ESTree.TSType): boolean {\n const unwrapped = unwrapTypeParentheses(type);\n switch (unwrapped.type) {\n case \"TSArrayType\":\n case \"TSConstructorType\":\n case \"TSFunctionType\":\n case \"TSMappedType\":\n case \"TSObjectKeyword\":\n case \"TSTupleType\":\n return true;\n case \"TSTypeLiteral\":\n return unwrapped.members.length > 0;\n case \"TSIntersectionType\":\n return unwrapped.types.every(isDefinitelyObjectType);\n case \"TSTypeOperator\":\n return unwrapped.operator === \"readonly\" && isDefinitelyObjectType(unwrapped.typeAnnotation);\n default:\n return false;\n }\n}\n\nfunction isDefinitelyNarrowerRecordType(type: ESTree.TSType): boolean {\n const unwrapped = unwrapTypeParentheses(type);\n if (unwrapped.type === \"TSTypeLiteral\") {\n return unwrapped.members.some((member) => member.type !== \"TSIndexSignature\");\n }\n\n if (unwrapped.type !== \"TSTypeReference\") return false;\n if (typeReferenceName(unwrapped) === \"Readonly\") {\n const [inner] = unwrapped.typeArguments?.params ?? [];\n return inner !== undefined && isDefinitelyNarrowerRecordType(inner);\n }\n if (typeReferenceName(unwrapped) !== \"Record\") return false;\n\n const parameters = unwrapped.typeArguments?.params ?? [];\n return (\n parameters.length === 2 && parameters[1] !== undefined && !isUnknownOrAnyType(parameters[1])\n );\n}\n\nfunction functionBoundary(node: ESTree.Node): ESTree.Node | null {\n let current = node.parent;\n while (current !== null && current.type !== \"Program\") {\n if (functionBoundaryTypes.has(current.type)) return current;\n current = current.parent;\n }\n return null;\n}\n\nfunction resolvedVariableForIdentifier(\n scopes: readonly {\n readonly references: readonly {\n readonly identifier: ESTree.Node;\n readonly resolved: Variable | null;\n }[];\n }[],\n identifier: ESTree.IdentifierReference,\n): Variable | null {\n for (const scope of scopes) {\n const reference = scope.references.find(\n (candidate) =>\n candidate.identifier.start === identifier.start &&\n candidate.identifier.end === identifier.end,\n );\n if (reference !== undefined) return reference.resolved;\n }\n return null;\n}\n\nfunction variableDeclarator(variable: Variable): ESTree.VariableDeclarator | null {\n for (const definition of variable.defs) {\n if (definition.type === \"Variable\" && definition.node.type === \"VariableDeclarator\") {\n return definition.node;\n }\n }\n return null;\n}\n\nfunction knownValueEvidence(\n expression: ESTree.Expression,\n scopes: Parameters<typeof resolvedVariableForIdentifier>[0],\n boundary: ESTree.Node | null,\n visitedVariables: ReadonlySet<Variable>,\n): KnownValueEvidence | null {\n const unwrapped = unwrapExpressionParentheses(expression);\n\n if (unwrapped.type === \"TSAsExpression\" || unwrapped.type === \"TSTypeAssertion\") {\n if (broadTypeKind(unwrapped.typeAnnotation) !== null) return null;\n return { type: unwrapped.typeAnnotation };\n }\n\n if (unwrapped.type === \"Literal\" || unwrapped.type === \"TemplateLiteral\") {\n return { type: null };\n }\n\n if (\n unwrapped.type === \"ArrayExpression\" ||\n unwrapped.type === \"ArrowFunctionExpression\" ||\n unwrapped.type === \"ClassExpression\" ||\n unwrapped.type === \"FunctionExpression\" ||\n unwrapped.type === \"NewExpression\" ||\n unwrapped.type === \"ObjectExpression\"\n ) {\n return { type: null };\n }\n\n if (unwrapped.type !== \"Identifier\") return null;\n const variable = resolvedVariableForIdentifier(scopes, unwrapped);\n if (variable === null || visitedVariables.has(variable)) return null;\n\n const annotatedIdentifier = variable.identifiers.find(\n (identifier) => identifier.typeAnnotation !== null && identifier.typeAnnotation !== undefined,\n );\n const annotation = annotatedIdentifier?.typeAnnotation?.typeAnnotation;\n if (annotation !== undefined && annotatedIdentifier !== undefined) {\n if (functionBoundary(annotatedIdentifier) !== boundary || broadTypeKind(annotation) !== null) {\n return null;\n }\n return { type: annotation };\n }\n\n const declarator = variableDeclarator(variable);\n if (\n declarator === null ||\n declarator.parent.type !== \"VariableDeclaration\" ||\n declarator.parent.kind !== \"const\" ||\n declarator.init === null ||\n variable.references.some((reference) => reference.isWrite() && !reference.init) ||\n functionBoundary(declarator) !== boundary\n ) {\n return null;\n }\n\n return knownValueEvidence(\n declarator.init,\n scopes,\n boundary,\n new Set([...visitedVariables, variable]),\n );\n}\n\nfunction widenedBinding(\n variable: Variable,\n scopes: Parameters<typeof resolvedVariableForIdentifier>[0],\n): {\n readonly broadKind: BroadTypeKind;\n readonly evidence: KnownValueEvidence;\n readonly declaredAt: number;\n readonly boundary: ESTree.Node | null;\n} | null {\n const declarator = variableDeclarator(variable);\n if (\n declarator === null ||\n declarator.parent.type !== \"VariableDeclaration\" ||\n declarator.parent.kind !== \"const\" ||\n declarator.id.type !== \"Identifier\" ||\n declarator.init === null ||\n variable.references.some((reference) => reference.isWrite() && !reference.init)\n ) {\n return null;\n }\n\n const boundary = functionBoundary(declarator);\n const declaredType = declarator.id.typeAnnotation?.typeAnnotation;\n const initializerAssertion = assertionFromExpression(declarator.init);\n const initializerBroadKind =\n initializerAssertion === null ? null : broadTypeKind(initializerAssertion.typeAnnotation);\n const declaredBroadKind = declaredType === undefined ? null : broadTypeKind(declaredType);\n const broadKind = declaredBroadKind ?? initializerBroadKind;\n if (broadKind === null) return null;\n\n const originalExpression =\n initializerAssertion !== null && initializerBroadKind !== null\n ? assertedExpression(initializerAssertion)\n : declarator.init;\n const evidence = knownValueEvidence(originalExpression, scopes, boundary, new Set([variable]));\n return evidence === null ? null : { broadKind, evidence, declaredAt: declarator.end, boundary };\n}\n\nfunction assertionIsNarrower(\n sourceText: string,\n broadKind: BroadTypeKind,\n evidence: KnownValueEvidence,\n assertedType: ESTree.TSType,\n): boolean {\n if (broadTypeKind(assertedType) !== null) return false;\n if (broadKind === \"top\") return true;\n if (typesHaveSameSyntax(sourceText, evidence.type, assertedType)) return true;\n if (broadKind === \"object\") return isDefinitelyObjectType(assertedType);\n return isDefinitelyNarrowerRecordType(assertedType);\n}\n\n/** Detect immutable local bindings that erase a known type and are later asserted back to a narrower type. */\nexport const noWidenThenAssertRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow local const flows that explicitly widen a known value before asserting the widened binding to a narrower type.\",\n },\n messages: {\n widenThenAssert:\n 'Binding \"{{name}}\" discards type evidence and later recreates it with an assertion. Keep the precise type from initialization through use; parse boundary input once.',\n },\n },\n createOnce(context) {\n let scopes: Parameters<typeof resolvedVariableForIdentifier>[0] = [];\n\n const checkAssertion = (node: ESTree.TSAsExpression | ESTree.TSTypeAssertion) => {\n const expression = assertedExpression(node);\n if (expression.type !== \"Identifier\") return;\n\n const variable = resolvedVariableForIdentifier(scopes, expression);\n if (variable === null) return;\n const widened = widenedBinding(variable, scopes);\n if (\n widened === null ||\n node.start <= widened.declaredAt ||\n functionBoundary(node) !== widened.boundary ||\n !assertionIsNarrower(\n context.sourceCode.text,\n widened.broadKind,\n widened.evidence,\n node.typeAnnotation,\n )\n ) {\n return;\n }\n\n context.report({\n node,\n messageId: \"widenThenAssert\",\n data: { name: expression.name },\n });\n };\n\n return {\n Program() {\n scopes = context.sourceCode.scopeManager.scopes;\n },\n TSAsExpression: checkAssertion,\n TSTypeAssertion: checkAssertion,\n };\n },\n});\n","// An assertion is a claim the checker cannot verify, so the sentence naming the check that already\n// ran is the only thing that makes it reviewable. Scope it off for test files, where a fixture's\n// assertions are all the same claim and repeating it is noise rather than review material; one\n// consumer measured 53 of them.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree, SourceCode } from \"@oxlint/plugins\";\n\ntype TypeAssertion = ESTree.TSAsExpression | ESTree.TSTypeAssertion;\n\nconst DEFAULT_SAFETY_MARKERS = [\"SAFETY\"] as const;\n\nconst commentOwnerKinds = new Set([\n \"ExpressionStatement\",\n \"PropertyDefinition\",\n \"ReturnStatement\",\n \"ThrowStatement\",\n \"VariableDeclaration\",\n]);\n\nfunction isConstAssertion(node: TypeAssertion): boolean {\n return (\n node.typeAnnotation.type === \"TSTypeReference\" &&\n node.typeAnnotation.typeName.type === \"Identifier\" &&\n node.typeAnnotation.typeName.name === \"const\"\n );\n}\n\nfunction configuredSafetyMarkers(option: unknown): readonly string[] {\n if (typeof option !== \"object\" || option === null || !(\"markers\" in option)) {\n return DEFAULT_SAFETY_MARKERS;\n }\n const configured = option.markers;\n if (!Array.isArray(configured)) return DEFAULT_SAFETY_MARKERS;\n const markers = configured.flatMap((marker) =>\n typeof marker === \"string\" && marker.trim().length > 0 ? [marker.trim()] : [],\n );\n return markers.length > 0 ? markers : DEFAULT_SAFETY_MARKERS;\n}\n\nfunction markerPattern(markers: readonly string[]): RegExp {\n const alternation = markers\n .map((marker) => marker.replaceAll(/[.*+?^${}()|[\\]\\\\]/gu, String.raw`\\$&`))\n .join(\"|\");\n return new RegExp(\n String.raw`(?:^|[^\\p{L}\\p{N}_])(?:${alternation})\\s*:\\s*\\S`,\n \"u\",\n );\n}\n\nfunction hasSafetyJustificationBefore(\n sourceCode: SourceCode,\n owner: ESTree.Node,\n assertion: TypeAssertion,\n pattern: RegExp,\n): boolean {\n return sourceCode\n .getCommentsBefore(owner)\n .some(\n (comment) => comment.end <= assertion.start && pattern.test(comment.value),\n );\n}\n\nfunction hasSafetyComment(\n sourceCode: SourceCode,\n node: TypeAssertion,\n pattern: RegExp,\n): boolean {\n let current: ESTree.Node = node;\n while (true) {\n if (hasSafetyJustificationBefore(sourceCode, current, node, pattern)) return true;\n if (commentOwnerKinds.has(current.type)) {\n const exportDeclaration = current.parent;\n return (\n exportDeclaration.type === \"ExportNamedDeclaration\" &&\n exportDeclaration.declaration === current &&\n hasSafetyJustificationBefore(sourceCode, exportDeclaration, node, pattern)\n );\n }\n if (current.parent.type === \"Program\") return false;\n current = current.parent;\n }\n}\n\n/** Require every non-const type assertion to state the invariant TypeScript cannot express. */\nexport const requireSafetyCommentForTypeAssertionRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Require a nearby SAFETY comment for every TypeScript type assertion except const assertions.\",\n },\n messages: {\n missingSafetyComment:\n \"This type assertion has no `{{marker}}:` justification. State the checked invariant immediately before the assertion or its containing statement.\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n markers: {\n type: \"array\",\n items: { type: \"string\", minLength: 1 },\n minItems: 1,\n uniqueItems: true,\n },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ markers: [\"SAFETY\"] }],\n },\n createOnce(context) {\n const patterns = new Map<string, RegExp>();\n\n const checkAssertion = (node: TypeAssertion) => {\n if (isConstAssertion(node)) return;\n const markers = configuredSafetyMarkers(context.options?.[0]);\n const patternKey = markers.join(\"\\u0000\");\n const pattern = patterns.get(patternKey) ?? markerPattern(markers);\n patterns.set(patternKey, pattern);\n if (hasSafetyComment(context.sourceCode, node, pattern)) return;\n context.report({\n node,\n messageId: \"missingSafetyComment\",\n data: { marker: markers[0] ?? DEFAULT_SAFETY_MARKERS[0] },\n });\n };\n\n return {\n TSAsExpression: checkAssertion,\n TSTypeAssertion: checkAssertion,\n };\n },\n});\n","import type { Options } from \"@oxlint/plugins\";\n\ntype OptionValue = Options[number];\n\n/**\n * Rule options arrive as parsed JSON from the linter config, so this is the one\n * place their shape is checked. Returns the first option when it is an object.\n */\nfunction firstOptionObject(options: Readonly<Options>): { readonly [key: string]: OptionValue } {\n const first = options[0];\n return typeof first === \"object\" && first !== null && !Array.isArray(first) ? first : {};\n}\n\n/** A string-valued key of the first option object, or undefined when absent or not a string. */\nexport function stringOption(options: Readonly<Options>, key: string): string | undefined {\n const value = firstOptionObject(options)[key];\n return typeof value === \"string\" ? value : undefined;\n}\n","// A string typed into a component is a string no translator will ever see, and it is found again\n// only when someone reads that file. Sending every visible word through the dictionary makes the\n// set of strings on screen countable. Scope it off for a surface no user reads in their own\n// language: a debug screen, a developer tools panel, a component gallery.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport { stringOption } from \"../shared/rule-options.ts\";\n\n// Three letters in a row, in any script. Digits, separators and bullets are not words.\nconst defaultWordPattern = String.raw`\\p{L}{3,}`;\n\n/** A string literal that is the whole expression of `{...}` placed among an element's children. */\nfunction isChildStringLiteral(\n node: ESTree.JSXExpressionContainer,\n): node is ESTree.JSXExpressionContainer & {\n readonly expression: ESTree.StringLiteral;\n} {\n const { expression, parent } = node;\n if (expression.type !== \"Literal\" || typeof expression.value !== \"string\") return false;\n return parent.type === \"JSXElement\" || parent.type === \"JSXFragment\";\n}\n\n/** Reject words written straight into JSX instead of coming from the translation dictionary. */\nexport const noHardcodedJsxTextRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow literal words in JSX children; every string on screen comes from the translation dictionary.\",\n },\n messages: {\n hardcodedText:\n \"Do not write words straight into JSX. Every string on screen comes from the translation dictionary.\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n pattern: { type: \"string\" },\n },\n additionalProperties: false,\n },\n ],\n },\n create(context) {\n const word = new RegExp(stringOption(context.options, \"pattern\") ?? defaultWordPattern, \"u\");\n return {\n JSXText(node) {\n if (word.test(node.value)) context.report({ node, messageId: \"hardcodedText\" });\n },\n JSXExpressionContainer(node) {\n if (isChildStringLiteral(node) && word.test(node.expression.value)) {\n context.report({ node: node.expression, messageId: \"hardcodedText\" });\n }\n },\n };\n },\n});\n","// An effect that computes state runs after the render that needed it, so the screen paints once\n// with the old value and again with the new one, and the dependency array becomes the place bugs\n// hide. Deriving during render, acting in the event handler and subscribing through a reactive\n// query cover the rest. Scope it off for the single file that wraps the hook, since a genuine\n// external subscription needs a real effect somewhere.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\nimport { stringOption } from \"../shared/rule-options.ts\";\n\nconst effectHooks = new Set([\"useEffect\", \"useLayoutEffect\"]);\n\n/** The name a member expression reads, written `.useEffect` or `[\"useEffect\"]`; null when the key is not a literal name. */\nfunction memberPropertyName(node: ESTree.MemberExpression): string | null {\n const { property } = node;\n if (!node.computed) return property.type === \"Identifier\" ? property.name : null;\n return property.type === \"Literal\" && typeof property.value === \"string\" ? property.value : null;\n}\n\n/** The effect hook a call reaches, called bare (`useEffect(...)`) or through a member (`React.useEffect(...)`, `React[\"useEffect\"](...)`). */\nfunction calledEffectHook(callee: ESTree.Expression): string | null {\n if (callee.type === \"Identifier\") return effectHooks.has(callee.name) ? callee.name : null;\n if (callee.type !== \"MemberExpression\") return null;\n const name = memberPropertyName(callee);\n return name !== null && effectHooks.has(name) ? name : null;\n}\n\nfunction importedName(specifier: ESTree.ImportSpecifier): string {\n return specifier.imported.type === \"Identifier\"\n ? specifier.imported.name\n : specifier.imported.value;\n}\n\nfunction isTypeOnly(specifier: ESTree.ImportSpecifier): boolean {\n const declaration = specifier.parent;\n return (\n specifier.importKind === \"type\" ||\n (declaration.type === \"ImportDeclaration\" && declaration.importKind === \"type\")\n );\n}\n\n/** Reject `useEffect` and `useLayoutEffect`, called or imported. */\nexport const noUseEffectRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow useEffect and useLayoutEffect; derive during render, act in the event handler, or subscribe through a reactive query.\",\n },\n messages: {\n noEffect:\n \"Do not call {{name}}. Derive the value during render, do the work in the event handler, or subscribe through a reactive query.\",\n noEffectWithHint:\n \"Do not call {{name}}. Derive the value during render, do the work in the event handler, or subscribe through a reactive query. {{hint}}\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n hint: { type: \"string\" },\n },\n additionalProperties: false,\n },\n ],\n },\n create(context) {\n const hint = stringOption(context.options, \"hint\");\n const report = (node: ESTree.Node, name: string): void => {\n if (hint === undefined) {\n context.report({ node, messageId: \"noEffect\", data: { name } });\n } else {\n context.report({ node, messageId: \"noEffectWithHint\", data: { name, hint } });\n }\n };\n return {\n CallExpression(node) {\n const name = calledEffectHook(node.callee);\n if (name !== null) report(node, name);\n },\n ImportSpecifier(node) {\n if (isTypeOnly(node)) return;\n const name = importedName(node);\n if (effectHooks.has(name)) report(node, name);\n },\n };\n },\n});\n","// Expo replaces each `process.env.EXPO_PUBLIC_*` read textually at bundle time, so there is no\n// `process.env` object on the device: anything the substitution cannot see is `undefined` at\n// runtime and nothing fails at build time. Scope it off for code that never enters the app bundle,\n// a build script or a config file, anywhere `process.env` is a real object under Node.\n\nimport { defineRule } from \"@oxlint/plugins\";\n\nimport type { ESTree } from \"@oxlint/plugins\";\n\n// Measured against babel-preset-expo 54.0.12 (2026-09-18). `build/inline-env-vars.js`\n// registers a Babel `MemberExpression` visitor, matches the object with\n// `matchesPattern(\"process.env\")` and takes the key from `toComputedKey()`, which is a\n// string literal only for `.NAME` and `[\"NAME\"]`; `build/define-plugin.js` matches the\n// same way for `NODE_ENV` and the `EXPO_*` table. So the four shapes it replaces are\n// `process.env.NAME`, `process.env[\"NAME\"]`, `process[\"env\"].NAME` and\n// `process[\"env\"][\"NAME\"]`. It skips the left side of an assignment, it leaves a\n// template, a number and a computed variable alone, and it never sees an optional chain,\n// which Babel parses as `OptionalMemberExpression`, a node neither visitor is registered\n// for. This rule is the mirror of that list. It judges the shape and never the name:\n// which names carry a value depends on the bundler's environment and its define table.\n\n/** The name a member expression reads, the way Babel's `toComputedKey` does: `.NAME` and `[\"NAME\"]` only. */\nfunction literalKeyName(node: ESTree.MemberExpression): string | null {\n const { property } = node;\n if (!node.computed) return property.type === \"Identifier\" ? property.name : null;\n return property.type === \"Literal\" && typeof property.value === \"string\" ? property.value : null;\n}\n\n/** Whether a member expression is `process.env` or `process[\"env\"]`, the object the inliner matches. */\nfunction isProcessEnv(node: ESTree.MemberExpression): boolean {\n return (\n node.object.type === \"Identifier\" &&\n node.object.name === \"process\" &&\n literalKeyName(node) === \"env\"\n );\n}\n\n/** Whether a pattern takes `process.env` apart, in a declaration or in an assignment. */\nfunction isDestructured(node: ESTree.MemberExpression): boolean {\n const { parent } = node;\n let target: ESTree.Node | null = null;\n if (parent.type === \"VariableDeclarator\" && parent.init === node) target = parent.id;\n if (parent.type === \"AssignmentExpression\" && parent.right === node) target = parent.left;\n return target !== null && (target.type === \"ObjectPattern\" || target.type === \"ArrayPattern\");\n}\n\ntype ReadProblem = \"assigned\" | \"computed\" | \"literalKey\" | \"optionalChain\";\n\n/** What is wrong with a `process.env.KEY` read, or null when Expo replaces that exact shape. */\nfunction readProblem(\n env: ESTree.MemberExpression,\n read: ESTree.MemberExpression,\n): ReadProblem | null {\n const { parent } = read;\n if (parent.type === \"AssignmentExpression\" && parent.left === read) return \"assigned\";\n if (env.optional || read.optional) return \"optionalChain\";\n if (literalKeyName(read) !== null) return null;\n return read.property.type === \"Literal\" || read.property.type === \"TemplateLiteral\"\n ? \"literalKey\"\n : \"computed\";\n}\n\n/** Reject every use of `process.env` that Expo's textual inlining cannot see. */\nexport const staticPublicEnvRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Allow only the `process.env` reads Expo replaces at bundle time; everything else is undefined on the device.\",\n },\n messages: {\n destructured:\n \"Expo replaces each `process.env.EXPO_PUBLIC_*` read textually at bundle time, so there is no `process.env` object to destructure on the device. Read each variable as `process.env.NAME`.\",\n computed:\n \"Expo replaces each `process.env.EXPO_PUBLIC_*` read textually at bundle time, so a key it has to evaluate is undefined on the device. Read the variable as `process.env.NAME` with the name spelled out.\",\n literalKey:\n \"Expo reads a computed key only when it is a string literal, so a template or a number leaves the read in the bundle and it is undefined on the device. Read the variable as `process.env.NAME`.\",\n optionalChain:\n \"Expo's inliner never sees an optional chain, so `process.env?.NAME` survives into the bundle and is undefined on the device. Read the variable as `process.env.NAME`.\",\n assigned:\n \"Expo replaces reads, not writes: an assignment to `process.env` stays in the bundle and no inlined read will ever see it. Set the variable in the environment the bundler reads.\",\n bareValue:\n \"Expo replaces each `process.env.EXPO_PUBLIC_*` read textually at bundle time, so `process.env` passed around as a value is empty on the device. Read each variable as `process.env.NAME`.\",\n },\n },\n create(context) {\n return {\n MemberExpression(node) {\n if (!isProcessEnv(node)) return;\n const { parent } = node;\n if (parent.type === \"MemberExpression\" && parent.object === node) {\n const problem = readProblem(node, parent);\n if (problem !== null) context.report({ node: parent, messageId: problem });\n return;\n }\n if (isDestructured(node)) {\n context.report({ node: parent, messageId: \"destructured\" });\n return;\n }\n context.report({ node, messageId: \"bareValue\" });\n },\n };\n },\n});\n","import { eslintCompatPlugin } from \"@oxlint/plugins\";\n\nimport { noArrayFilterMapRule } from \"./anti-slop/rules/no-array-filter-map.ts\";\nimport { noChainedTypeAssertionsRule } from \"./anti-slop/rules/no-chained-type-assertions.ts\";\nimport { noConditionalEmptyObjectSpreadRule } from \"./anti-slop/rules/no-conditional-empty-object-spread.ts\";\nimport { noKnownValueWideningRule } from \"./anti-slop/rules/no-known-value-widening.ts\";\nimport { noModuleMockingRule } from \"./anti-slop/rules/no-module-mocking.ts\";\nimport { noObjectParametersRule } from \"./anti-slop/rules/no-object-parameters.ts\";\nimport { noReduceAccumulatorCopyRule } from \"./anti-slop/rules/no-reduce-accumulator-copy.ts\";\nimport { noReflectApplyRule } from \"./anti-slop/rules/no-reflect-apply.ts\";\nimport { noReflectGetRule } from \"./anti-slop/rules/no-reflect-get.ts\";\nimport { noRuntimeTypeofRule } from \"./anti-slop/rules/no-runtime-typeof.ts\";\nimport { noForbiddenTermInSymbolNamesRule } from \"./anti-slop/rules/no-shape-in-symbol-names.ts\";\nimport { noUnknownParametersRule } from \"./anti-slop/rules/no-unknown-parameters.ts\";\nimport { noUnknownReturnsRule } from \"./anti-slop/rules/no-unknown-returns.ts\";\nimport { noUnknownTypeAliasesRule } from \"./anti-slop/rules/no-unknown-type-aliases.ts\";\nimport { noUnsafeDictionaryTypeRule } from \"./anti-slop/rules/no-unsafe-dictionary-type.ts\";\nimport { noWidenThenAssertRule } from \"./anti-slop/rules/no-widen-then-assert.ts\";\nimport { requireSafetyCommentForTypeAssertionRule } from \"./anti-slop/rules/require-safety-comment-for-type-assertion.ts\";\nimport { noHardcodedJsxTextRule } from \"./rules/no-hardcoded-jsx-text.ts\";\nimport { noUseEffectRule } from \"./rules/no-use-effect.ts\";\nimport { staticPublicEnvRule } from \"./rules/static-public-env.ts\";\n\n// One plugin, one prefix. `rdjperron` is not on oxlint's reserved list, so the same\n// name works as a `jsPlugins` alias and as the prefix in every diagnostic and\n// every disable comment. `eslintCompatPlugin` adds a `create` shim to each\n// `createOnce` rule, which is what lets these run under ESLint as well.\nconst rdjperronPlugin = eslintCompatPlugin({\n meta: { name: \"rdjperron\" },\n rules: {\n \"no-array-filter-map\": noArrayFilterMapRule,\n \"no-chained-type-assertions\": noChainedTypeAssertionsRule,\n \"no-conditional-empty-object-spread\": noConditionalEmptyObjectSpreadRule,\n \"no-hardcoded-jsx-text\": noHardcodedJsxTextRule,\n \"no-known-value-widening\": noKnownValueWideningRule,\n \"no-module-mocking\": noModuleMockingRule,\n \"no-object-parameters\": noObjectParametersRule,\n \"no-reduce-accumulator-copy\": noReduceAccumulatorCopyRule,\n \"no-reflect-apply\": noReflectApplyRule,\n \"no-reflect-get\": noReflectGetRule,\n \"no-runtime-typeof\": noRuntimeTypeofRule,\n \"no-shape-in-symbol-names\": noForbiddenTermInSymbolNamesRule,\n \"no-unknown-parameters\": noUnknownParametersRule,\n \"no-unknown-returns\": noUnknownReturnsRule,\n \"no-unknown-type-aliases\": noUnknownTypeAliasesRule,\n \"no-unsafe-dictionary-type\": noUnsafeDictionaryTypeRule,\n \"no-use-effect\": noUseEffectRule,\n \"no-widen-then-assert\": noWidenThenAssertRule,\n \"require-safety-comment-for-type-assertion\": requireSafetyCommentForTypeAssertionRule,\n \"static-public-env\": staticPublicEnvRule,\n },\n});\n\nexport default rdjperronPlugin;\n"],"mappings":";;;AAGA,SAAgB,sBAAsB,MAAgC;CACpE,OACE,KAAK,SAAS,6BACd,KAAK,SAAS,qBACd,KAAK,SAAS,oBACd,KAAK,SAAS,qBACd,KAAK,SAAS,yBACd,KAAK,SAAS,yBAEd,OAAO,KAAK;CAEd,OAAO;AACT;;AAGA,SAAgB,oBAAoB,YAAwB,MAAoC;CAC9F,OAAO,sBAAsB,IAAI;CACjC,IAAI,KAAK,SAAS,cAAc,OAAO;CACvC,IAAI,QAAsB,WAAW,SAAS,IAAI;CAClD,OAAO,UAAU,MAAM;EACrB,MAAM,WAAW,MAAM,IAAI,IAAI,KAAK,IAAI;EACxC,IAAI,aAAa,KAAA,GAAW,OAAO;EACnC,QAAQ,MAAM;CAChB;CACA,OAAO;AACT;;AAGA,SAAgB,kBACd,MACgE;CAChE,OAAO,sBAAsB,IAAI;CACjC,IAAI,KAAK,SAAS,oBAAoB,OAAO;CAC7C,MAAM,WAAW,KAAK;CACtB,IAAI,CAAC,KAAK,YAAY,SAAS,SAAS,cACtC,OAAO;EAAE,MAAM,SAAS;EAAM,QAAQ,KAAK;CAAO;CAEpD,IAAI,KAAK,YAAY,SAAS,SAAS,aAAa,OAAO,SAAS,UAAU,UAC5E,OAAO;EAAE,MAAM,SAAS;EAAO,QAAQ,KAAK;CAAO;CAErD,OAAO;AACT;AAEA,SAAS,kBAAkB,MAA8B;CACvD,I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