@boringnode/tooling 0.0.0-stage → 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/anti_slop/index.ts","../src/anti_slop/rules/no-array-filter-map.ts","../src/anti_slop/shared/array-method.ts","../src/anti_slop/rules/no-chained-type-assertions.ts","../src/anti_slop/rules/no-conditional-empty-object-spread.ts","../src/anti_slop/rules/no-known-value-widening.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-module-mocking.ts","../src/anti_slop/rules/no-object-parameters.ts","../src/anti_slop/rules/no-reduce-accumulator-copy.ts","../src/anti_slop/rules/no-reflect-apply.ts","../src/anti_slop/shared/reflect-method.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/vendor/eslint-stylistic/padding-line-ast.ts","../src/anti_slop/vendor/eslint-stylistic/padding-line-between-statements.ts","../src/anti_slop/rules/require-readable-spacing.ts","../src/anti_slop/rules/require-safety-comment-for-type-assertion.ts"],"sourcesContent":["import { eslintCompatPlugin } from '@oxlint/plugins';\nimport { noArrayFilterMapRule } from './rules/no-array-filter-map.ts';\nimport { noChainedTypeAssertionsRule } from './rules/no-chained-type-assertions.ts';\nimport { noConditionalEmptyObjectSpreadRule } from './rules/no-conditional-empty-object-spread.ts';\nimport { noKnownValueWideningRule } from './rules/no-known-value-widening.ts';\nimport { noModuleMockingRule } from './rules/no-module-mocking.ts';\nimport { noObjectParametersRule } from './rules/no-object-parameters.ts';\nimport { noReduceAccumulatorCopyRule } from './rules/no-reduce-accumulator-copy.ts';\nimport { noReflectApplyRule } from './rules/no-reflect-apply.ts';\nimport { noReflectGetRule } from './rules/no-reflect-get.ts';\nimport { noRuntimeTypeofRule } from './rules/no-runtime-typeof.ts';\nimport { noForbiddenTermInSymbolNamesRule } from './rules/no-shape-in-symbol-names.ts';\nimport { noUnknownParametersRule } from './rules/no-unknown-parameters.ts';\nimport { noUnknownReturnsRule } from './rules/no-unknown-returns.ts';\nimport { noUnknownTypeAliasesRule } from './rules/no-unknown-type-aliases.ts';\nimport { noUnsafeDictionaryTypeRule } from './rules/no-unsafe-dictionary-type.ts';\nimport { noWidenThenAssertRule } from './rules/no-widen-then-assert.ts';\nimport { requireReadableSpacingRule } from './rules/require-readable-spacing.ts';\nimport { requireSafetyCommentForTypeAssertionRule } from './rules/require-safety-comment-for-type-assertion.ts';\n\n/** Generic Oxlint rules that reject low-evidence and low-signal implementation patterns. */\nconst antiSlopPlugin = eslintCompatPlugin({\n\tmeta: { name: 'anti-slop' },\n\trules: {\n\t\t'no-array-filter-map': noArrayFilterMapRule,\n\t\t'no-reduce-accumulator-copy': noReduceAccumulatorCopyRule,\n\t\t'no-chained-type-assertions': noChainedTypeAssertionsRule,\n\t\t'no-conditional-empty-object-spread': noConditionalEmptyObjectSpreadRule,\n\t\t'no-known-value-widening': noKnownValueWideningRule,\n\t\t'no-module-mocking': noModuleMockingRule,\n\t\t'no-object-parameters': noObjectParametersRule,\n\t\t'no-reflect-apply': noReflectApplyRule,\n\t\t'no-reflect-get': noReflectGetRule,\n\t\t'no-runtime-typeof': noRuntimeTypeofRule,\n\t\t'no-unsafe-dictionary-type': noUnsafeDictionaryTypeRule,\n\t\t'no-shape-in-symbol-names': noForbiddenTermInSymbolNamesRule,\n\t\t'no-unknown-parameters': noUnknownParametersRule,\n\t\t'no-unknown-returns': noUnknownReturnsRule,\n\t\t'no-unknown-type-aliases': noUnknownTypeAliasesRule,\n\t\t'no-widen-then-assert': noWidenThenAssertRule,\n\t\t'require-readable-spacing': requireReadableSpacingRule,\n\t\t'require-safety-comment-for-type-assertion': requireSafetyCommentForTypeAssertionRule,\n\t},\n});\n\nexport default antiSlopPlugin;\n","import { defineRule } from '@oxlint/plugins';\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\tmeta: {\n\t\ttype: 'suggestion',\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t'Disallow adjacent array filter/map passes in favor of lazy iterator helpers or a single transformation.',\n\t\t},\n\t\tmessages: {\n\t\t\tarrayFilterMap:\n\t\t\t\t'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\t\t},\n\t},\n\tcreateOnce(context) {\n\t\treturn {\n\t\t\tCallExpression(node) {\n\t\t\t\tconst outer = arrayMethodTarget(node.callee);\n\t\t\t\tif (outer === null || (outer.name !== 'map' && outer.name !== 'filter')) return;\n\t\t\t\tconst innerCall = unwrapArrayExpression(outer.object);\n\t\t\t\tif (innerCall.type !== 'CallExpression') return;\n\t\t\t\tconst inner = arrayMethodTarget(innerCall.callee);\n\t\t\t\tif (inner === null || inner.name !== (outer.name === 'map' ? 'filter' : 'map')) return;\n\t\t\t\tif (!isKnownArrayExpression(context.sourceCode, inner.object)) return;\n\t\t\t\tcontext.report({ node, messageId: 'arrayFilterMap', data: { first: inner.name, second: outer.name } });\n\t\t\t},\n\t\t};\n\t},\n});\n","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\twhile (\n\t\tnode.type === 'ParenthesizedExpression' ||\n\t\tnode.type === 'ChainExpression' ||\n\t\tnode.type === 'TSAsExpression' ||\n\t\tnode.type === 'TSTypeAssertion' ||\n\t\tnode.type === 'TSNonNullExpression' ||\n\t\tnode.type === 'TSSatisfiesExpression'\n\t) {\n\t\tnode = node.expression;\n\t}\n\treturn 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\tnode = unwrapArrayExpression(node);\n\tif (node.type !== 'Identifier') return null;\n\tlet scope: Scope | null = sourceCode.getScope(node);\n\twhile (scope !== null) {\n\t\tconst variable = scope.set.get(node.name);\n\t\tif (variable !== undefined) return variable;\n\t\tscope = scope.upper;\n\t}\n\treturn null;\n}\n\n/** Read static method names, including computed string literals, without evaluating expressions. */\nexport function arrayMethodTarget(node: ESTree.Node): { readonly name: string; readonly object: ESTree.Node } | null {\n\tnode = unwrapArrayExpression(node);\n\tif (node.type !== 'MemberExpression') return null;\n\tconst property = node.property;\n\tif (!node.computed && property.type === 'Identifier') {\n\t\treturn { name: property.name, object: node.object };\n\t}\n\tif (node.computed && property.type === 'Literal' && typeof property.value === 'string') {\n\t\treturn { name: property.value, object: node.object };\n\t}\n\treturn null;\n}\n\nfunction isArrayAnnotation(type: ESTree.TSType): boolean {\n\tif (type.type === 'TSArrayType' || type.type === 'TSTupleType') return true;\n\tif (type.type === 'TSParenthesizedType') return isArrayAnnotation(type.typeAnnotation);\n\tif (type.type === 'TSTypeOperator' && type.operator === 'readonly') {\n\t\treturn isArrayAnnotation(type.typeAnnotation);\n\t}\n\treturn (\n\t\ttype.type === 'TSTypeReference' &&\n\t\ttype.typeName.type === 'Identifier' &&\n\t\t(type.typeName.name === 'Array' || type.typeName.name === 'ReadonlyArray')\n\t);\n}\n\n/** Recognize local array evidence; unknown receivers and iterator pipelines are deliberately excluded. */\nexport function isKnownArrayExpression(\n\tsourceCode: SourceCode,\n\tnode: ESTree.Node,\n\tvisited = new Set<Variable>(),\n): boolean {\n\tnode = unwrapArrayExpression(node);\n\tif (node.type === 'ArrayExpression') return true;\n\tif (node.type === 'CallExpression') {\n\t\tconst method = arrayMethodTarget(node.callee);\n\t\treturn (\n\t\t\tmethod !== null &&\n\t\t\t['map', 'filter', 'flatMap', 'slice', 'concat', 'toSorted', 'toReversed', 'toSpliced'].includes(method.name) &&\n\t\t\tisKnownArrayExpression(sourceCode, method.object, visited)\n\t\t);\n\t}\n\tif (node.type !== 'Identifier') return false;\n\tconst variable = resolveArrayBinding(sourceCode, node);\n\tif (variable === null || visited.has(variable)) return false;\n\tvisited.add(variable);\n\tif (variable.references.some((reference) => reference.isWrite() && !reference.init)) return false;\n\tfor (const identifier of variable.identifiers) {\n\t\tconst annotation = identifier.typeAnnotation?.typeAnnotation;\n\t\tif (annotation !== undefined) return isArrayAnnotation(annotation);\n\t}\n\tfor (const definition of variable.defs) {\n\t\tif (\n\t\t\tdefinition.type === 'Variable' &&\n\t\t\tdefinition.node.type === 'VariableDeclarator' &&\n\t\t\tdefinition.node.id.type === 'Identifier' &&\n\t\t\tdefinition.node.init !== null &&\n\t\t\tdefinition.node.parent.type === 'VariableDeclaration' &&\n\t\t\tdefinition.node.parent.kind === 'const'\n\t\t) {\n\t\t\treturn isKnownArrayExpression(sourceCode, definition.node.init, visited);\n\t\t}\n\t}\n\treturn false;\n}\n","import { 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\treturn node.type === 'TSAsExpression' || node.type === 'TSTypeAssertion';\n}\n\nfunction unwrapParenthesizedExpression(expression: ESTree.Expression): ESTree.Expression {\n\tlet current = expression;\n\twhile (current.type === 'ParenthesizedExpression') {\n\t\tcurrent = current.expression;\n\t}\n\treturn current;\n}\n\nfunction isConstAssertion(node: TypeAssertionExpression): boolean {\n\tconst { typeAnnotation } = node;\n\treturn (\n\t\ttypeAnnotation.type === 'TSTypeReference' &&\n\t\ttypeAnnotation.typeName.type === 'Identifier' &&\n\t\ttypeAnnotation.typeName.name === 'const'\n\t);\n}\n\nfunction isOutermostAssertionInChain(node: TypeAssertionExpression): boolean {\n\tlet current: ESTree.Expression = node;\n\tlet parent = node.parent;\n\n\twhile (parent.type === 'ParenthesizedExpression' && parent.expression === current) {\n\t\tcurrent = parent;\n\t\tparent = parent.parent;\n\t}\n\n\treturn !isTypeAssertionExpression(parent) || parent.expression !== current;\n}\n\nfunction isForbiddenAssertionChain(node: TypeAssertionExpression): boolean {\n\tlet assertionCount = 0;\n\tlet hasNonConstAssertion = false;\n\tlet current: ESTree.Expression = node;\n\n\twhile (isTypeAssertionExpression(current)) {\n\t\tassertionCount += 1;\n\t\thasNonConstAssertion ||= !isConstAssertion(current);\n\t\tcurrent = unwrapParenthesizedExpression(current.expression);\n\t}\n\n\treturn assertionCount > 1 && hasNonConstAssertion;\n}\n\n/** Disallow nested TypeScript type assertions, while permitting chains made only of const assertions. */\nexport const noChainedTypeAssertionsRule = defineRule({\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow chained TypeScript as and angle-bracket assertions, including parenthesized chains.',\n\t\t},\n\t\tmessages: {\n\t\t\tchained:\n\t\t\t\t'This assertion chain discards type evidence. Keep the original precise type, or parse untrusted input at its boundary before narrowing it.',\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tconst checkTypeAssertion = (node: TypeAssertionExpression) => {\n\t\t\tif (!isOutermostAssertionInChain(node) || !isForbiddenAssertionChain(node)) return;\n\t\t\tcontext.report({ node, messageId: 'chained' });\n\t\t};\n\n\t\treturn {\n\t\t\tTSAsExpression: checkTypeAssertion,\n\t\t\tTSTypeAssertion: checkTypeAssertion,\n\t\t};\n\t},\n});\n","import { defineRule } from '@oxlint/plugins';\nimport type { ESTree } from '@oxlint/plugins';\n\nfunction unwrapParentheses(node: ESTree.Expression): ESTree.Expression {\n\tlet current = node;\n\twhile (current.type === 'ParenthesizedExpression') {\n\t\tcurrent = current.expression;\n\t}\n\treturn current;\n}\n\nfunction isEmptyObjectExpression(node: ESTree.Expression): boolean {\n\treturn node.type === 'ObjectExpression' && node.properties.length === 0;\n}\n\nfunction isConditionalEmptyObjectSpread(node: ESTree.Expression): boolean {\n\tconst conditional = unwrapParentheses(node);\n\treturn (\n\t\tconditional.type === 'ConditionalExpression' &&\n\t\t(isEmptyObjectExpression(conditional.consequent) || isEmptyObjectExpression(conditional.alternate))\n\t);\n}\n\n/** Ban conditional empty-object spreads without changing their omission semantics. */\nexport const noConditionalEmptyObjectSpreadRule = defineRule({\n\tmeta: {\n\t\ttype: 'suggestion',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow object spreads that conditionally spread an empty object to omit fields.',\n\t\t},\n\t\tmessages: {\n\t\t\tavoid:\n\t\t\t\t'This conditional spread hides property omission behind an empty object. Build the object in separate statements and add the property only when present.',\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\treturn {\n\t\t\tSpreadElement(node) {\n\t\t\t\tif (node.parent.type !== 'ObjectExpression') return;\n\n\t\t\t\tif (isConditionalEmptyObjectSpread(node.argument)) {\n\t\t\t\t\tcontext.report({ node, messageId: 'avoid' });\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n});\n","import { defineRule } from '@oxlint/plugins';\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';\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' ? definition.node : 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 (declarator === null || declarator.init === null || !isStableConstVariable(variable, declarator)) {\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(sourceCode: SourceCode, callee: ESTree.Expression): 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(sourceCode: SourceCode, variable: Variable): 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) => functionParameterBindingName(candidate, sourceCode) === variable.name,\n\t);\n\treturn parameter === undefined ? null : (functionParameterTypeAnnotation(parameter) ?? null);\n}\n\nfunction hasInformativeType(type: ESTree.TSType, environment: TypeEnvironment): 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(sourceCode, expression.expression, environment, visitedVariables);\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(sourceCode, expression.expression, environment, visitedVariables);\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 (declarator === null || declarator.init === null || !isStableConstVariable(variable, declarator)) {\n\t\treturn false;\n\t}\n\tvisitedVariables.add(variable);\n\treturn hasKnownCallArgumentEvidence(sourceCode, declarator.init, environment, visitedVariables);\n}\n\nfunction typePredicateSubjectIndex(sourceCode: SourceCode, owner: FunctionExpression): 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) => functionParameterBindingName(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') return 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 = (expression: ESTree.Expression, destination: WideningTarget | null, subject: string) => {\n\t\t\tif (destination === null) return;\n\t\t\tif (isDictionaryAccumulatorTarget(destination) && isEmptyObjectExpression(expression)) {\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(node, context.sourceCode.visitorKeys);\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(node.init, targetFromAnnotation(node.id.typeAnnotation), `binding \\`${node.id.name}\\``);\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(node.right, targetFromAnnotation(declarator.id.typeAnnotation), `binding \\`${declarator.id.name}\\``);\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 (!hasKnownCallArgumentEvidence(context.sourceCode, argument, environment)) {\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(node.expression, classifyWideningTarget(node.typeAnnotation, environment), 'assertion');\n\t\t\t},\n\t\t\tTSTypeAssertion(node) {\n\t\t\t\tif (environment === null || hasParentAssertion(node)) return;\n\t\t\t\treportFlow(node.expression, classifyWideningTarget(node.typeAnnotation, environment), 'assertion');\n\t\t\t},\n\t\t};\n\t},\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 typeof value === 'object' && value !== null && 'type' in value && typeof value.type === 'string';\n}\n\nfunction collectInferTypeParameterNames(node: ESTree.Node, visitorKeys: VisitorKeys, names: Set<string>): 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(node: ESTree.Node, visitorKeys: VisitorKeys): 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 (current.type === 'TSMappedType' && (descendant === current.nameType || descendant === current.typeAnnotation)) {\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 { lexicalTypeParameterNames } from './lexical-type-parameters.ts';\nimport type { ESTree } from '@oxlint/plugins';\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 = (type: ESTree.TSType, matches: (child: ESTree.TSType) => boolean) => boolean;\n\nconst environmentsByProgram = new WeakMap<ESTree.Program, TypeAliasEnvironment>();\n\nfunction isNode(value: unknown): value is ESTree.Node {\n\treturn typeof value === 'object' && value !== null && 'type' in value && typeof value.type === 'string';\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(program: ESTree.Program, visitorKeys: VisitorKeys): 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(name: string, use: ESTree.Node, environment: TypeAliasEnvironment): 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(substitution.type, substitution.substitutions, resolvingAliases);\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) => evaluate(child, substitutions, resolvingAliases));\n\t};\n\n\treturn evaluate(type, new Map(), new Set());\n}\n","import {\n\tcreateTypeAliasEnvironment,\n\thasVisibleTypeBinding,\n\tvisibleTypeAlias,\n\ttype TypeAliasEnvironment as LexicalTypeAliasEnvironment,\n} from './type-alias-resolution.ts';\nimport type { ESTree } from '@oxlint/plugins';\n\nconst BUILT_INS = new Set(['Record', 'Readonly', 'Partial', 'Required', 'Pick', 'Omit', 'PropertyKey', 'NonNullable']);\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 = 'anonymous object' | 'generic container' | 'object' | 'open dictionary' | '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' || statement.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(name: string, use: ESTree.Node, environment: TypeEnvironment): boolean {\n\treturn BUILT_INS.has(name) && !hasVisibleTypeBinding(name, use, environment.typeAliases);\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(declarations: readonly ESTree.TSInterfaceDeclaration[]): 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)) return '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) ? unsafeMembers[0] : 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 ? null : 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 ? [] : [{ 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 ? [] : 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 ((name === 'Pick' || name === 'Omit') && isBuiltIn(name, unwrapped, environment)) {\n\t\tconst source = unwrapped.typeArguments?.params[0];\n\t\treturn source === undefined ? [] : 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(type: ESTree.TSType, environment: TypeEnvironment): UnsafeDictionary | null {\n\tfor (const valueType of dictionaryValueTypes(type, environment, new Map(), new Set())) {\n\t\tconst unsafeValue = unsafeDirectValue(valueType.type, environment, valueType.substitutions, new Set());\n\t\tif (unsafeValue !== null) return { kind: 'unsafe-dictionary', unsafeValue };\n\t}\n\treturn null;\n}\n\nexport function classifyWideningTarget(type: ESTree.TSType, environment: TypeEnvironment): 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()) ? { kind: 'open dictionary' } : 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(alias.typeAnnotation, environment, substitutions, new Set([name]));\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(alias.typeAnnotation, environment, substitutions, new Set([name]));\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) => isBroadMappedKey(member, environment, substitutions, visitedAliases));\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 (alias === null || (alias.typeParameters?.params.length ?? 0) > 0 || visitedAliases.has(name)) {\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') ? { kind: 'open dictionary' } : null;\n\t}\n\tif (unwrapped.type === 'TSMappedType') {\n\t\treturn isBroadMappedKey(unwrapped.constraint, environment, substitutions) ? { kind: 'open dictionary' } : 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(substitution, environment, substitutions, resolvingAliases);\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) ? { kind: 'open dictionary' } : 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(alias.typeAnnotation, environment, nextSubstitutions, nextResolving);\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(parameter: FunctionParameter, sourceCode: SourceCode): 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 ? sourceText : 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(sourceCode: SourceCode, identifier: ESTree.IdentifierReference): 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","import { defineRule } from '@oxlint/plugins';\nimport { resolveVariable } from '../shared/scope.ts';\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\tif (node.type !== 'ImportSpecifier') return null;\n\treturn node.imported.type === 'Identifier' ? node.imported.name : node.imported.value;\n}\n\nfunction isTestFrameworkObject(\n\tsourceCode: SourceCode,\n\texpression: ESTree.Expression,\n): expression is ESTree.IdentifierReference {\n\tif (expression.type !== 'Identifier') return false;\n\tif ((expression.name === 'vi' || expression.name === 'jest') && sourceCode.isGlobalReference(expression)) {\n\t\treturn true;\n\t}\n\n\tconst variable = resolveVariable(sourceCode, expression);\n\tif (variable === null || variable.defs.length === 0) {\n\t\treturn expression.name === 'vi' || expression.name === 'jest';\n\t}\n\treturn variable.defs.some((definition) => {\n\t\tif (definition.type !== 'ImportBinding' || definition.parent?.type !== 'ImportDeclaration') {\n\t\t\treturn false;\n\t\t}\n\t\tconst source = definition.parent.source.value;\n\t\tconst name = importedName(definition.node);\n\t\treturn (source === 'vitest' && name === 'vi') || (source === '@jest/globals' && name === 'jest');\n\t});\n}\n\nfunction moduleMockCall(sourceCode: SourceCode, callee: ESTree.Expression): boolean {\n\tif (!('property' in callee) || !('object' in callee) || !('computed' in callee)) return false;\n\tif (!isTestFrameworkObject(sourceCode, callee.object)) return false;\n\tconst property = callee.property;\n\tconst method = callee.computed\n\t\t? property.type === 'Literal' &&\n\t\t\t(property.value === 'doMock' || property.value === 'mock' || property.value === 'unstable_mockModule')\n\t\t\t? property.value\n\t\t\t: null\n\t\t: property.type === 'Identifier'\n\t\t\t? property.name\n\t\t\t: null;\n\treturn method !== null && moduleMockMethods.has(method);\n}\n\n/** Ban test framework module mocking in favor of real dependency seams. */\nexport const noModuleMockingRule = defineRule({\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow Vitest and Jest module mocking; tests must replace dependencies through real interfaces.',\n\t\t},\n\t\tmessages: {\n\t\t\tmoduleMock:\n\t\t\t\t'Replace module mocking with dependency injection through a real interface, service layer, or faithful test implementation.',\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\treturn {\n\t\t\tCallExpression(node) {\n\t\t\t\tif (node.callee.type === 'Super' || node.callee.type === 'V8IntrinsicExpression') return;\n\t\t\t\tif (moduleMockCall(context.sourceCode, node.callee)) {\n\t\t\t\t\tcontext.report({ node, messageId: 'moduleMock' });\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n});\n","import { defineRule } from '@oxlint/plugins';\nimport { functionParameterBindingName, functionParameterTypeAnnotation } from '../shared/function-parameters.ts';\nimport {\n\tcreateTypeAliasEnvironment,\n\tresolvedTypeMatches,\n\ttype TypeAliasEnvironment,\n} from '../shared/type-alias-resolution.ts';\nimport type { ESTree } from '@oxlint/plugins';\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 resolved.type === 'TSUnionType' && resolved.types.some(matches);\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(node, context.sourceCode.visitorKeys);\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","import { defineRule } from '@oxlint/plugins';\nimport {\n\tarrayMethodTarget,\n\tisKnownArrayExpression,\n\tresolveArrayBinding,\n\tunwrapArrayExpression,\n} from '../shared/array-method.ts';\nimport type { ESTree, SourceCode, Variable } from '@oxlint/plugins';\n\nfunction enclosingReducer(node: ESTree.Node) {\n\tlet parent = node.parent;\n\twhile (parent !== null) {\n\t\tif (parent.type === 'FunctionDeclaration') return null;\n\t\tif (parent.type === 'ArrowFunctionExpression' || parent.type === 'FunctionExpression') {\n\t\t\tconst callback = parent;\n\t\t\tlet owner: ESTree.Node | null = callback.parent;\n\t\t\twhile (owner !== null && unwrapArrayExpression(owner) === callback) owner = owner.parent;\n\t\t\tif (owner?.type !== 'CallExpression') return null;\n\t\t\tconst method = arrayMethodTarget(owner.callee);\n\t\t\tconst firstArgument = owner.arguments[0];\n\t\t\tif (\n\t\t\t\tmethod === null ||\n\t\t\t\t(method.name !== 'reduce' && method.name !== 'reduceRight') ||\n\t\t\t\towner.arguments.length > 2 ||\n\t\t\t\tfirstArgument === undefined ||\n\t\t\t\tunwrapArrayExpression(firstArgument) !== callback\n\t\t\t)\n\t\t\t\treturn null;\n\t\t\tconst firstParameter = callback.params[0];\n\t\t\tconst accumulator = firstParameter?.type === 'AssignmentPattern' ? firstParameter.left : firstParameter;\n\t\t\tif (accumulator?.type !== 'Identifier') return null;\n\t\t\treturn { callback, accumulator, initialValue: owner.arguments[1] };\n\t\t}\n\t\tparent = parent.parent;\n\t}\n\treturn null;\n}\n\nfunction referencesAccumulator(\n\tsourceCode: SourceCode,\n\tnode: ESTree.Node,\n\taccumulator: Variable,\n\tvisited = new Set<Variable>(),\n): boolean {\n\tconst variable = resolveArrayBinding(sourceCode, node);\n\tif (variable === null || visited.has(variable)) return false;\n\tif (variable === accumulator) return true;\n\tvisited.add(variable);\n\tif (variable.references.some((reference) => reference.isWrite() && !reference.init)) return false;\n\tfor (const definition of variable.defs) {\n\t\tif (\n\t\t\tdefinition.type === 'Variable' &&\n\t\t\tdefinition.node.type === 'VariableDeclarator' &&\n\t\t\tdefinition.node.id.type === 'Identifier' &&\n\t\t\tdefinition.node.init !== null &&\n\t\t\tdefinition.node.parent.type === 'VariableDeclaration' &&\n\t\t\tdefinition.node.parent.kind === 'const'\n\t\t) {\n\t\t\treturn referencesAccumulator(sourceCode, definition.node.init, accumulator, visited);\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction isGlobalCopyOwner(sourceCode: SourceCode, node: ESTree.Node, name: string): boolean {\n\tnode = unwrapArrayExpression(node);\n\tif (node.type !== 'Identifier' || node.name !== name) return false;\n\tconst variable = resolveArrayBinding(sourceCode, node);\n\treturn 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\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t'Disallow copying growing reducer accumulators with Object.assign, Array.from, or array copy methods.',\n\t\t},\n\t\tmessages: {\n\t\t\taccumulatorCopy:\n\t\t\t\t'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\t\t},\n\t},\n\tcreateOnce(context) {\n\t\treturn {\n\t\t\tCallExpression(node) {\n\t\t\t\tconst method = arrayMethodTarget(node.callee);\n\t\t\t\tif (method === null) return;\n\t\t\t\tconst reducer = enclosingReducer(node);\n\t\t\t\tif (reducer === null) return;\n\t\t\t\tconst accumulator = context.sourceCode\n\t\t\t\t\t.getDeclaredVariables(reducer.callback)\n\t\t\t\t\t.find((variable) =>\n\t\t\t\t\t\tvariable.identifiers.some((identifier) => identifier.start === reducer.accumulator.start),\n\t\t\t\t\t);\n\t\t\t\tif (accumulator === undefined) return;\n\t\t\t\tconst isAccumulator = (expression: ESTree.Node) =>\n\t\t\t\t\treferencesAccumulator(context.sourceCode, expression, accumulator);\n\t\t\t\tlet copiesAccumulator = false;\n\t\t\t\tif (method.name === 'assign' && isGlobalCopyOwner(context.sourceCode, method.object, 'Object')) {\n\t\t\t\t\tconst target = node.arguments[0];\n\t\t\t\t\tcopiesAccumulator =\n\t\t\t\t\t\ttarget !== undefined &&\n\t\t\t\t\t\tunwrapArrayExpression(target).type === 'ObjectExpression' &&\n\t\t\t\t\t\tnode.arguments.slice(1).some(isAccumulator);\n\t\t\t\t} else if (method.name === 'from' && isGlobalCopyOwner(context.sourceCode, method.object, 'Array')) {\n\t\t\t\t\tconst source = node.arguments[0];\n\t\t\t\t\tcopiesAccumulator = source !== undefined && isAccumulator(source);\n\t\t\t\t} else if (['concat', 'slice', 'toSpliced', 'toSorted', 'toReversed', 'with'].includes(method.name)) {\n\t\t\t\t\tconst initialValue = reducer.initialValue;\n\t\t\t\t\tconst arrayAccumulator =\n\t\t\t\t\t\tinitialValue !== undefined && isKnownArrayExpression(context.sourceCode, initialValue);\n\t\t\t\t\tcopiesAccumulator = arrayAccumulator && isAccumulator(method.object);\n\t\t\t\t}\n\t\t\t\tif (copiesAccumulator) context.report({ node, messageId: 'accumulatorCopy' });\n\t\t\t},\n\t\t};\n\t},\n});\n","import { defineRule } from '@oxlint/plugins';\nimport { isGlobalReflectMethodCall } from '../shared/reflect-method.ts';\n\n/** Ban Reflect.apply, which bypasses ordinary typed function calls. */\nexport const noReflectApplyRule = defineRule({\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t'Disallow Reflect.apply; call typed functions directly or model dynamic dispatch behind an interface.',\n\t\t},\n\t\tmessages: {\n\t\t\treflectApply:\n\t\t\t\t'Replace `Reflect.apply` with a typed function call. Model dynamic dispatch behind a named interface.',\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\treturn {\n\t\t\tCallExpression(node) {\n\t\t\t\tif (node.callee.type === 'Super' || node.callee.type === 'V8IntrinsicExpression') return;\n\t\t\t\tif (isGlobalReflectMethodCall(context.sourceCode, node.callee, 'apply')) {\n\t\t\t\t\tcontext.report({ node, messageId: 'reflectApply' });\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n});\n","import { resolveVariable } from './scope.ts';\nimport type { ESTree, SourceCode } from '@oxlint/plugins';\n\nfunction isGlobalReflect(sourceCode: SourceCode, expression: ESTree.Expression): boolean {\n\tif (expression.type !== 'Identifier' || expression.name !== 'Reflect') return false;\n\tif (sourceCode.isGlobalReference(expression)) return true;\n\tconst variable = resolveVariable(sourceCode, expression);\n\treturn 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\tsourceCode: SourceCode,\n\tcallee: ESTree.Expression,\n\tmethodName: string,\n): boolean {\n\tif (!('property' in callee) || !('object' in callee) || !('computed' in callee)) return false;\n\tif (!isGlobalReflect(sourceCode, callee.object)) return false;\n\tconst property = callee.property;\n\treturn callee.computed\n\t\t? property.type === 'Literal' && property.value === methodName\n\t\t: property.type === 'Identifier' && property.name === methodName;\n}\n","import { defineRule } from '@oxlint/plugins';\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\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow Reflect.get; use typed property access or parse dynamic input into a domain type.',\n\t\t},\n\t\tmessages: {\n\t\t\treflectGet:\n\t\t\t\t'Replace `Reflect.get` with typed property access. Parse dynamic input into a named domain type before reading it.',\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\treturn {\n\t\t\tCallExpression(node) {\n\t\t\t\tif (node.callee.type === 'Super' || node.callee.type === 'V8IntrinsicExpression') return;\n\t\t\t\tif (isGlobalReflectMethodCall(context.sourceCode, node.callee, 'get')) {\n\t\t\t\t\tcontext.report({ node, messageId: 'reflectGet' });\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n});\n","import { defineRule } from '@oxlint/plugins';\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' || node.type === 'FunctionDeclaration' || node.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' && option !== null && !Array.isArray(option) && option.allowInTypeGuards === true;\n\t\t\t\tif (node.operator === 'typeof' && !isExistenceProbe(node) && (!allowInTypeGuards || !isInsideTypeGuard(node))) {\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","import { defineRule } from '@oxlint/plugins';\nimport type { ESTree } from '@oxlint/plugins';\n\nconst FORBIDDEN_SYMBOL_NAME = 'shape';\n\nfunction containsForbiddenSymbolName(name: string): boolean {\n\treturn name.toLowerCase().includes(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\tconst parent = node.parent;\n\tif (parent === null || parent.type !== 'MemberExpression') return false;\n\treturn parent.property === node && parent.computed === false;\n}\n\n/** Ban the case-insensitive substring \"shape\" in every JavaScript and TypeScript symbol name. */\nexport const noForbiddenTermInSymbolNamesRule = defineRule({\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t'Disallow the case-insensitive substring \"shape\" in JavaScript, TypeScript, private, and JSX symbol names.',\n\t\t},\n\t\tmessages: {\n\t\t\tforbiddenSymbolName:\n\t\t\t\t'Rename symbol \"{{name}}\" for its domain role; \"shape\" describes structure rather than ownership.',\n\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tconst reportForbiddenSymbolName = (node: ESTree.Node & { name: string }) => {\n\t\t\tif (!containsForbiddenSymbolName(node.name) || isBorrowedMemberName(node)) return;\n\t\t\tcontext.report({\n\t\t\t\tnode,\n\t\t\t\tmessageId: 'forbiddenSymbolName',\n\t\t\t\tdata: { name: node.name },\n\t\t\t});\n\t\t};\n\n\t\treturn {\n\t\t\tIdentifier: reportForbiddenSymbolName,\n\t\t\tPrivateIdentifier: reportForbiddenSymbolName,\n\t\t\tJSXIdentifier: reportForbiddenSymbolName,\n\t\t};\n\t},\n});\n","import { defineRule } from '@oxlint/plugins';\nimport {\n\tcontainsUnknownType,\n\tfunctionParameterBindingName,\n\tfunctionParameterTypeAnnotation,\n} from '../shared/function-parameters.ts';\nimport type { ESTree } from '@oxlint/plugins';\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\nfunction isTypePredicateSubject(owner: ParameterOwner, parameterName: string): boolean {\n\tconst predicate = owner.returnType?.typeAnnotation;\n\treturn (\n\t\tpredicate?.type === 'TSTypePredicate' &&\n\t\tpredicate.parameterName.type === 'Identifier' &&\n\t\tpredicate.parameterName.name === parameterName\n\t);\n}\n\n/** Disallow unknown inputs except explicitly named error-cause enrichment. */\nexport const noUnknownParametersRule = defineRule({\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t'Disallow explicitly unknown function parameters except `cause` and type-predicate subjects; decode unknown input at its I/O boundary instead.',\n\t\t},\n\t\tmessages: {\n\t\t\tunknownParameter:\n\t\t\t\t'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\t\t},\n\t},\n\tcreateOnce(context) {\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 (!containsUnknownType(annotation.typeAnnotation)) continue;\n\t\t\t\tconst name = functionParameterBindingName(parameter, context.sourceCode);\n\t\t\t\tif (name === 'cause' || isTypePredicateSubject(node, name)) continue;\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: annotation.typeAnnotation,\n\t\t\t\t\tmessageId: 'unknownParameter',\n\t\t\t\t\tdata: { parameter: name },\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\treturn {\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","import { defineRule } from '@oxlint/plugins';\nimport {\n\tcreateTypeAliasEnvironment,\n\tresolvedTypeMatches,\n\ttype TypeAliasEnvironment,\n} from '../shared/type-alias-resolution.ts';\nimport type { ESTree } from '@oxlint/plugins';\n\ntype FunctionWithReturnType =\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 function contracts that return unknown instead of a parsed domain type. */\nexport const noUnknownReturnsRule = defineRule({\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Disallow functions whose explicit return contract is unknown or Promise<unknown>.',\n\t\t},\n\t\tmessages: {\n\t\t\tunknownReturn:\n\t\t\t\t'This function exposes `unknown` to its caller. Parse the value at its boundary and return a named domain 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\tif (resolved.type === 'TSUnionType') return resolved.types.some(matches);\n\t\t\t\tif (\n\t\t\t\t\tresolved.type !== 'TSTypeReference' ||\n\t\t\t\t\tresolved.typeName.type !== 'Identifier' ||\n\t\t\t\t\t(resolved.typeName.name !== 'Promise' && resolved.typeName.name !== 'PromiseLike')\n\t\t\t\t) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst value = resolved.typeArguments?.params[0];\n\t\t\t\treturn value !== undefined && matches(value);\n\t\t\t});\n\n\t\tconst checkReturnType = (node: FunctionWithReturnType) => {\n\t\t\tconst annotation = node.returnType;\n\t\t\tif (annotation === null || annotation === undefined) return;\n\t\t\tif (!resolvesToUnknown(annotation.typeAnnotation)) return;\n\t\t\tcontext.report({ node: annotation.typeAnnotation, messageId: 'unknownReturn' });\n\t\t};\n\n\t\treturn {\n\t\t\tProgram(node) {\n\t\t\t\tenvironment = createTypeAliasEnvironment(node, context.sourceCode.visitorKeys);\n\t\t\t},\n\t\t\tArrowFunctionExpression: checkReturnType,\n\t\t\tFunctionDeclaration: checkReturnType,\n\t\t\tFunctionExpression: checkReturnType,\n\t\t\tTSCallSignatureDeclaration: checkReturnType,\n\t\t\tTSConstructSignatureDeclaration: checkReturnType,\n\t\t\tTSConstructorType: checkReturnType,\n\t\t\tTSDeclareFunction: checkReturnType,\n\t\t\tTSEmptyBodyFunctionExpression: checkReturnType,\n\t\t\tTSFunctionType: checkReturnType,\n\t\t\tTSMethodSignature: checkReturnType,\n\t\t};\n\t},\n});\n","import { defineRule } from '@oxlint/plugins';\nimport {\n\tcreateTypeAliasEnvironment,\n\tresolvedTypeMatches,\n\ttype TypeAliasEnvironment,\n} from '../shared/type-alias-resolution.ts';\nimport type { ESTree } from '@oxlint/plugins';\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(node, context.sourceCode.visitorKeys);\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","import { defineRule } from '@oxlint/plugins';\nimport {\n\tclassifyUnsafeDictionary,\n\tclassifyUnsafeDictionaryValue,\n\tcreateTypeEnvironment,\n\ttype TypeEnvironment,\n} from '../shared/dictionary-types.ts';\nimport { visibleTypeAlias } from '../shared/type-alias-resolution.ts';\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) return 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(node, context.sourceCode.visitorKeys);\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 (environment === null || node.typeAnnotation === null || node.parent.type === 'TSTypeLiteral') return;\n\t\t\t\tconst unsafe = classifyUnsafeDictionaryValue(node.typeAnnotation.typeAnnotation, environment);\n\t\t\t\tif (unsafe !== null) report(node, unsafe.unsafeValue);\n\t\t\t},\n\t\t};\n\t},\n});\n","import { defineRule } from '@oxlint/plugins';\nimport type { ESTree, Variable } from '@oxlint/plugins';\n\ntype BroadTypeKind = 'top' | 'object' | 'record';\n\ntype KnownValueEvidence = {\n\treadonly type: ESTree.TSType | null;\n};\n\nconst functionBoundaryTypes = new Set([\n\t'ArrowFunctionExpression',\n\t'FunctionDeclaration',\n\t'FunctionExpression',\n\t'TSDeclareFunction',\n\t'TSEmptyBodyFunctionExpression',\n]);\n\nfunction unwrapExpressionParentheses(expression: ESTree.Expression): ESTree.Expression {\n\tlet current = expression;\n\twhile (current.type === 'ParenthesizedExpression') current = current.expression;\n\treturn current;\n}\n\nfunction unwrapTypeParentheses(type: ESTree.TSType): ESTree.TSType {\n\tlet current = type;\n\twhile (current.type === 'TSParenthesizedType') current = current.typeAnnotation;\n\treturn current;\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n\treturn type.typeName.type === 'Identifier' ? type.typeName.name : null;\n}\n\nfunction isUnknownOrAnyType(type: ESTree.TSType): boolean {\n\tconst unwrapped = unwrapTypeParentheses(type);\n\treturn unwrapped.type === 'TSUnknownKeyword' || unwrapped.type === 'TSAnyKeyword';\n}\n\nfunction isBroadRecordKeyType(type: ESTree.TSType): boolean {\n\tconst unwrapped = unwrapTypeParentheses(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') return unwrapped.types.every(isBroadRecordKeyType);\n\treturn unwrapped.type === 'TSTypeReference' && typeReferenceName(unwrapped) === 'PropertyKey';\n}\n\nfunction isBroadRecordType(type: ESTree.TSType): boolean {\n\tconst unwrapped = unwrapTypeParentheses(type);\n\n\tif (unwrapped.type === 'TSTypeReference') {\n\t\tif (typeReferenceName(unwrapped) === 'Readonly') {\n\t\t\tconst [inner] = unwrapped.typeArguments?.params ?? [];\n\t\t\treturn inner !== undefined && isBroadRecordType(inner);\n\t\t}\n\n\t\tif (typeReferenceName(unwrapped) !== 'Record') return false;\n\t\tconst parameters = unwrapped.typeArguments?.params ?? [];\n\t\treturn (\n\t\t\tparameters.length === 2 &&\n\t\t\tparameters[0] !== undefined &&\n\t\t\tparameters[1] !== undefined &&\n\t\t\tisBroadRecordKeyType(parameters[0]) &&\n\t\t\tisUnknownOrAnyType(parameters[1])\n\t\t);\n\t}\n\n\tif (unwrapped.type !== 'TSTypeLiteral' || unwrapped.members.length !== 1) return false;\n\tconst [member] = unwrapped.members;\n\tconst [parameter] = member?.type === 'TSIndexSignature' ? member.parameters : [];\n\treturn (\n\t\tmember?.type === 'TSIndexSignature' &&\n\t\tmember.parameters.length === 1 &&\n\t\tparameter !== undefined &&\n\t\tisBroadRecordKeyType(parameter.typeAnnotation.typeAnnotation) &&\n\t\tisUnknownOrAnyType(member.typeAnnotation.typeAnnotation)\n\t);\n}\n\nfunction broadTypeKind(type: ESTree.TSType): BroadTypeKind | null {\n\tconst unwrapped = unwrapTypeParentheses(type);\n\tif (unwrapped.type === 'TSUnknownKeyword' || unwrapped.type === 'TSAnyKeyword') return 'top';\n\tif (unwrapped.type === 'TSObjectKeyword') return 'object';\n\treturn isBroadRecordType(unwrapped) ? 'record' : null;\n}\n\nfunction assertedExpression(node: ESTree.TSAsExpression | ESTree.TSTypeAssertion): ESTree.Expression {\n\treturn unwrapExpressionParentheses(node.expression);\n}\n\nfunction assertionFromExpression(expression: ESTree.Expression): ESTree.TSAsExpression | ESTree.TSTypeAssertion | null {\n\tconst unwrapped = unwrapExpressionParentheses(expression);\n\treturn unwrapped.type === 'TSAsExpression' || unwrapped.type === 'TSTypeAssertion' ? unwrapped : null;\n}\n\nfunction normalizedTypeText(sourceText: string, type: ESTree.TSType): string {\n\treturn sourceText.slice(type.start, type.end).replaceAll(/\\s+/gu, '');\n}\n\nfunction typesHaveSameSyntax(sourceText: string, left: ESTree.TSType | null, right: ESTree.TSType): boolean {\n\treturn (\n\t\tleft !== null &&\n\t\tnormalizedTypeText(sourceText, unwrapTypeParentheses(left)) ===\n\t\t\tnormalizedTypeText(sourceText, unwrapTypeParentheses(right))\n\t);\n}\n\nfunction isDefinitelyObjectType(type: ESTree.TSType): boolean {\n\tconst unwrapped = unwrapTypeParentheses(type);\n\tswitch (unwrapped.type) {\n\t\tcase 'TSArrayType':\n\t\tcase 'TSConstructorType':\n\t\tcase 'TSFunctionType':\n\t\tcase 'TSMappedType':\n\t\tcase 'TSObjectKeyword':\n\t\tcase 'TSTupleType':\n\t\t\treturn true;\n\t\tcase 'TSTypeLiteral':\n\t\t\treturn unwrapped.members.length > 0;\n\t\tcase 'TSIntersectionType':\n\t\t\treturn unwrapped.types.every(isDefinitelyObjectType);\n\t\tcase 'TSTypeOperator':\n\t\t\treturn unwrapped.operator === 'readonly' && isDefinitelyObjectType(unwrapped.typeAnnotation);\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nfunction isDefinitelyNarrowerRecordType(type: ESTree.TSType): boolean {\n\tconst unwrapped = unwrapTypeParentheses(type);\n\tif (unwrapped.type === 'TSTypeLiteral') {\n\t\treturn unwrapped.members.some((member) => member.type !== 'TSIndexSignature');\n\t}\n\n\tif (unwrapped.type !== 'TSTypeReference') return false;\n\tif (typeReferenceName(unwrapped) === 'Readonly') {\n\t\tconst [inner] = unwrapped.typeArguments?.params ?? [];\n\t\treturn inner !== undefined && isDefinitelyNarrowerRecordType(inner);\n\t}\n\tif (typeReferenceName(unwrapped) !== 'Record') return false;\n\n\tconst parameters = unwrapped.typeArguments?.params ?? [];\n\treturn parameters.length === 2 && parameters[1] !== undefined && !isUnknownOrAnyType(parameters[1]);\n}\n\nfunction functionBoundary(node: ESTree.Node): ESTree.Node | null {\n\tlet current = node.parent;\n\twhile (current !== null && current.type !== 'Program') {\n\t\tif (functionBoundaryTypes.has(current.type)) return current;\n\t\tcurrent = current.parent;\n\t}\n\treturn null;\n}\n\nfunction resolvedVariableForIdentifier(\n\tscopes: readonly {\n\t\treadonly references: readonly {\n\t\t\treadonly identifier: ESTree.Node;\n\t\t\treadonly resolved: Variable | null;\n\t\t}[];\n\t}[],\n\tidentifier: ESTree.IdentifierReference,\n): Variable | null {\n\tfor (const scope of scopes) {\n\t\tconst reference = scope.references.find(\n\t\t\t(candidate) => candidate.identifier.start === identifier.start && candidate.identifier.end === identifier.end,\n\t\t);\n\t\tif (reference !== undefined) return reference.resolved;\n\t}\n\treturn null;\n}\n\nfunction variableDeclarator(variable: Variable): ESTree.VariableDeclarator | null {\n\tfor (const definition of variable.defs) {\n\t\tif (definition.type === 'Variable' && definition.node.type === 'VariableDeclarator') {\n\t\t\treturn definition.node;\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction knownValueEvidence(\n\texpression: ESTree.Expression,\n\tscopes: Parameters<typeof resolvedVariableForIdentifier>[0],\n\tboundary: ESTree.Node | null,\n\tvisitedVariables: ReadonlySet<Variable>,\n): KnownValueEvidence | null {\n\tconst unwrapped = unwrapExpressionParentheses(expression);\n\n\tif (unwrapped.type === 'TSAsExpression' || unwrapped.type === 'TSTypeAssertion') {\n\t\tif (broadTypeKind(unwrapped.typeAnnotation) !== null) return null;\n\t\treturn { type: unwrapped.typeAnnotation };\n\t}\n\n\tif (unwrapped.type === 'Literal' || unwrapped.type === 'TemplateLiteral') {\n\t\treturn { type: null };\n\t}\n\n\tif (\n\t\tunwrapped.type === 'ArrayExpression' ||\n\t\tunwrapped.type === 'ArrowFunctionExpression' ||\n\t\tunwrapped.type === 'ClassExpression' ||\n\t\tunwrapped.type === 'FunctionExpression' ||\n\t\tunwrapped.type === 'NewExpression' ||\n\t\tunwrapped.type === 'ObjectExpression'\n\t) {\n\t\treturn { type: null };\n\t}\n\n\tif (unwrapped.type !== 'Identifier') return null;\n\tconst variable = resolvedVariableForIdentifier(scopes, unwrapped);\n\tif (variable === null || visitedVariables.has(variable)) return null;\n\n\tconst annotatedIdentifier = variable.identifiers.find(\n\t\t(identifier) => identifier.typeAnnotation !== null && identifier.typeAnnotation !== undefined,\n\t);\n\tconst annotation = annotatedIdentifier?.typeAnnotation?.typeAnnotation;\n\tif (annotation !== undefined && annotatedIdentifier !== undefined) {\n\t\tif (functionBoundary(annotatedIdentifier) !== boundary || broadTypeKind(annotation) !== null) {\n\t\t\treturn null;\n\t\t}\n\t\treturn { type: annotation };\n\t}\n\n\tconst declarator = variableDeclarator(variable);\n\tif (\n\t\tdeclarator === null ||\n\t\tdeclarator.parent.type !== 'VariableDeclaration' ||\n\t\tdeclarator.parent.kind !== 'const' ||\n\t\tdeclarator.init === null ||\n\t\tvariable.references.some((reference) => reference.isWrite() && !reference.init) ||\n\t\tfunctionBoundary(declarator) !== boundary\n\t) {\n\t\treturn null;\n\t}\n\n\treturn knownValueEvidence(declarator.init, scopes, boundary, new Set([...visitedVariables, variable]));\n}\n\nfunction widenedBinding(\n\tvariable: Variable,\n\tscopes: Parameters<typeof resolvedVariableForIdentifier>[0],\n): {\n\treadonly broadKind: BroadTypeKind;\n\treadonly evidence: KnownValueEvidence;\n\treadonly declaredAt: number;\n\treadonly boundary: ESTree.Node | null;\n} | null {\n\tconst declarator = variableDeclarator(variable);\n\tif (\n\t\tdeclarator === null ||\n\t\tdeclarator.parent.type !== 'VariableDeclaration' ||\n\t\tdeclarator.parent.kind !== 'const' ||\n\t\tdeclarator.id.type !== 'Identifier' ||\n\t\tdeclarator.init === null ||\n\t\tvariable.references.some((reference) => reference.isWrite() && !reference.init)\n\t) {\n\t\treturn null;\n\t}\n\n\tconst boundary = functionBoundary(declarator);\n\tconst declaredType = declarator.id.typeAnnotation?.typeAnnotation;\n\tconst initializerAssertion = assertionFromExpression(declarator.init);\n\tconst initializerBroadKind =\n\t\tinitializerAssertion === null ? null : broadTypeKind(initializerAssertion.typeAnnotation);\n\tconst declaredBroadKind = declaredType === undefined ? null : broadTypeKind(declaredType);\n\tconst broadKind = declaredBroadKind ?? initializerBroadKind;\n\tif (broadKind === null) return null;\n\n\tconst originalExpression =\n\t\tinitializerAssertion !== null && initializerBroadKind !== null\n\t\t\t? assertedExpression(initializerAssertion)\n\t\t\t: declarator.init;\n\tconst evidence = knownValueEvidence(originalExpression, scopes, boundary, new Set([variable]));\n\treturn evidence === null ? null : { broadKind, evidence, declaredAt: declarator.end, boundary };\n}\n\nfunction assertionIsNarrower(\n\tsourceText: string,\n\tbroadKind: BroadTypeKind,\n\tevidence: KnownValueEvidence,\n\tassertedType: ESTree.TSType,\n): boolean {\n\tif (broadTypeKind(assertedType) !== null) return false;\n\tif (broadKind === 'top') return true;\n\tif (typesHaveSameSyntax(sourceText, evidence.type, assertedType)) return true;\n\tif (broadKind === 'object') return isDefinitelyObjectType(assertedType);\n\treturn 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\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t'Disallow local const flows that explicitly widen a known value before asserting the widened binding to a narrower type.',\n\t\t},\n\t\tmessages: {\n\t\t\twidenThenAssert:\n\t\t\t\t'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\t\t},\n\t},\n\tcreateOnce(context) {\n\t\tlet scopes: Parameters<typeof resolvedVariableForIdentifier>[0] = [];\n\n\t\tconst checkAssertion = (node: ESTree.TSAsExpression | ESTree.TSTypeAssertion) => {\n\t\t\tconst expression = assertedExpression(node);\n\t\t\tif (expression.type !== 'Identifier') return;\n\n\t\t\tconst variable = resolvedVariableForIdentifier(scopes, expression);\n\t\t\tif (variable === null) return;\n\t\t\tconst widened = widenedBinding(variable, scopes);\n\t\t\tif (\n\t\t\t\twidened === null ||\n\t\t\t\tnode.start <= widened.declaredAt ||\n\t\t\t\tfunctionBoundary(node) !== widened.boundary ||\n\t\t\t\t!assertionIsNarrower(context.sourceCode.text, widened.broadKind, widened.evidence, node.typeAnnotation)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontext.report({\n\t\t\t\tnode,\n\t\t\t\tmessageId: 'widenThenAssert',\n\t\t\t\tdata: { name: expression.name },\n\t\t\t});\n\t\t};\n\n\t\treturn {\n\t\t\tProgram() {\n\t\t\t\tscopes = context.sourceCode.scopeManager.scopes;\n\t\t\t},\n\t\t\tTSAsExpression: checkAssertion,\n\t\t\tTSTypeAssertion: checkAssertion,\n\t\t};\n\t},\n});\n","// Local replacements for the upstream helper imports. See UPSTREAM.md.\nimport type { ESTree, SourceCode, Token as SyntaxToken, Comment, Location } from '@oxlint/plugins';\n\ntype Token = SyntaxToken | Comment;\n\n/** Line terminators recognized by the upstream padding matcher. */\nexport const LINEBREAKS = new Set(['\\r\\n', '\\r', '\\n', '\\u2028', '\\u2029']);\n\n/** Test a closing brace without treating comment text as punctuation. */\nexport const isClosingBraceToken = (token: Token): boolean => token.type === 'Punctuator' && token.value === '}';\n\n/** Test a semicolon without treating comment text as punctuation. */\nexport const isSemicolonToken = (token: Token): boolean => token.type === 'Punctuator' && token.value === ';';\n\n/** Filter the optional final semicolon when identifying block-like statements. */\nexport const isNotSemicolonToken = (token: Token): boolean => !isSemicolonToken(token);\n\n/** Compare token/node boundaries, including attached comments. */\nexport const isTokenOnSameLine = (left: { loc: Location }, right: { loc: Location }): boolean =>\n\tleft.loc.end.line === right.loc.start.line;\n\n/** Recognize declarations and expressions used by the upstream IIFE matcher. */\nexport const isFunction = (node: ESTree.Node): boolean =>\n\tnode.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression';\n\n/** Preserve the upstream multiline statement heuristic. */\nexport const isSingleLine = (node: ESTree.Node): boolean => node.loc.start.line === node.loc.end.line;\n\n/** Unwrap optional chaining before checking IIFE syntax. */\nexport const skipChainExpression = (node: ESTree.Node): ESTree.Node =>\n\tnode.type === 'ChainExpression' ? node.expression : node;\n\n/** Only a program or function-body expression can begin a directive prologue. */\nexport const isTopLevelExpressionStatement = (node: ESTree.Node): node is ESTree.ExpressionStatement =>\n\tnode.type === 'ExpressionStatement' &&\n\t(node.parent.type === 'Program' || (node.parent.type === 'BlockStatement' && isFunction(node.parent.parent)));\n\n/** A single wrapping pair suffices to exclude a string from directive syntax. */\nexport function isParenthesized(node: ESTree.Node, sourceCode: SourceCode): boolean {\n\tconst before = sourceCode.getTokenBefore(node);\n\tconst after = sourceCode.getTokenAfter(node);\n\treturn before?.value === '(' && after?.value === ')';\n}\n","// Vendored from ESLint Stylistic; see UPSTREAM.md and LICENSE in this directory.\nimport type {\n\tESTree,\n\tContext as RuleContext,\n\tSourceCode,\n\tToken as SyntaxToken,\n\tComment,\n\tCreateRule,\n\tLocation,\n} from '@oxlint/plugins';\ntype ASTNode = ESTree.Node;\ntype Token = SyntaxToken | Comment;\nimport {\n\tisClosingBraceToken,\n\tisFunction,\n\tisNotSemicolonToken,\n\tisParenthesized,\n\tisSemicolonToken,\n\tisSingleLine,\n\tisTokenOnSameLine,\n\tisTopLevelExpressionStatement,\n\tLINEBREAKS,\n\tskipChainExpression,\n} from './padding-line-ast.ts';\nimport type { PaddingType, SelectorOption, StatementMatcher } from './padding-line-options.d.ts';\n\nconst CJS_EXPORT = /^(?:module\\s*\\.\\s*)?exports(?:\\s*\\.|\\s*\\[|$)/u;\nconst CJS_IMPORT = /^require\\(/u;\n\n/**\n * This rule is a replica of padding-line-between-statements.\n *\n * Ideally we would want to extend the rule support typescript specific support.\n * But since not all the state is exposed by the eslint and eslint has frozen stylistic rules,\n * (see - https://eslint.org/blog/2020/05/changes-to-rules-policies for details.)\n * we are forced to re-implement the rule here.\n *\n * We have tried to keep the implementation as close as possible to the eslint implementation, to make\n * patching easier for future contributors.\n *\n * Reference rule - https://github.com/eslint/eslint/blob/main/lib/rules/padding-line-between-statements.js\n */\n\ntype NodeTest = (node: ASTNode, sourceCode: SourceCode) => boolean;\n\nexport interface NodeTestObject {\n\ttest: NodeTest;\n}\n\n/**\n * A policy entry may name a caller-defined statement type (registered through\n * `createPaddingLineRule`) anywhere the upstream statement types are accepted.\n */\nexport type PolicyStatementOption<Extra extends string = never> =\n\t| StatementMatcher\n\t| Extra\n\t| [StatementMatcher | Extra, ...(StatementMatcher | Extra)[]];\n\nexport type PolicyOptions<Extra extends string = never> = {\n\tblankLine: PaddingType;\n\tprev: PolicyStatementOption<Extra>;\n\tnext: PolicyStatementOption<Extra>;\n}[];\n\nconst LT = `[${Array.from(LINEBREAKS).join('')}]`;\nconst PADDING_LINE_SEQUENCE = new RegExp(String.raw`^(\\s*?${LT})\\s*${LT}(\\s*;?)$`, 'u');\n\nfunction isSelectorOption(option: PolicyStatementOption<string>): option is SelectorOption {\n\treturn typeof option === 'object' && !Array.isArray(option);\n}\n\n/**\n * Creates tester which check if a node starts with specific keyword with the\n * appropriate AST_NODE_TYPES.\n * @param keyword The keyword to test.\n * @returns the created tester.\n * @private\n */\nfunction newKeywordTester(type: string | string[], keyword: string): NodeTestObject {\n\treturn {\n\t\ttest(node, sourceCode): boolean {\n\t\t\tconst isSameKeyword = sourceCode.getFirstToken(node)?.value === keyword;\n\t\t\tconst isSameType = Array.isArray(type) ? type.includes(node.type) : type === node.type;\n\n\t\t\treturn isSameKeyword && isSameType;\n\t\t},\n\t};\n}\n\n/**\n * Creates tester which check if a node is specific type.\n * @param type The node type to test.\n * @returns the created tester.\n * @private\n */\nfunction newNodeTypeTester(type: string): NodeTestObject {\n\treturn {\n\t\ttest: (node): boolean => node.type === type,\n\t};\n}\n\n/**\n * Checks the given node is an expression statement of IIFE.\n * @param node The node to check.\n * @returns `true` if the node is an expression statement of IIFE.\n * @private\n */\nfunction isIIFEStatement(node: ASTNode): boolean {\n\tif (node.type === 'ExpressionStatement') {\n\t\tlet expression = skipChainExpression(node.expression);\n\t\tif (expression.type === 'UnaryExpression') expression = skipChainExpression(expression.argument);\n\n\t\tif (expression.type === 'CallExpression') {\n\t\t\tlet node: ASTNode = expression.callee;\n\t\t\twhile (node.type === 'SequenceExpression') {\n\t\t\t\tconst lastExpression = node.expressions.at(-1);\n\t\t\t\tif (lastExpression === undefined) throw new Error('Padding rule invariant: sequence expression is empty');\n\t\t\t\tnode = lastExpression;\n\t\t\t}\n\n\t\t\treturn isFunction(node);\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Checks the given node is a CommonJS require statement\n * @param node The node to check.\n * @returns `true` if the node is a CommonJS require statement.\n * @private\n */\nfunction isCJSRequire(node: ASTNode): boolean {\n\tif (node.type === 'VariableDeclaration') {\n\t\tconst declaration = node.declarations[0];\n\t\tif (declaration?.init) {\n\t\t\tlet call = declaration?.init;\n\t\t\twhile (call.type === 'MemberExpression') call = call.object;\n\n\t\t\tif (call.type === 'CallExpression' && call.callee.type === 'Identifier') {\n\t\t\t\treturn call.callee.name === 'require';\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Checks whether the given node is a block-like statement.\n * This checks the last token of the node is the closing brace of a block.\n * @param sourceCode The source code to get tokens.\n * @param node The node to check.\n * @returns `true` if the node is a block-like statement.\n * @private\n */\nfunction isBlockLikeStatement(node: ASTNode, sourceCode: SourceCode): boolean {\n\t// do-while with a block is a block-like statement.\n\tif (node.type === 'DoWhileStatement' && node.body.type === 'BlockStatement') {\n\t\treturn true;\n\t}\n\n\t/**\n\t * IIFE is a block-like statement specially from\n\t * JSCS#disallowPaddingNewLinesAfterBlocks.\n\t */\n\tif (isIIFEStatement(node)) return true;\n\n\t// Checks the last token is a closing brace of blocks.\n\tconst lastToken = sourceCode.getLastToken(node, isNotSemicolonToken);\n\tconst belongingNode =\n\t\tlastToken && isClosingBraceToken(lastToken) ? sourceCode.getNodeByRangeIndex(lastToken.range[0]) : null;\n\n\treturn !!belongingNode && (belongingNode.type === 'BlockStatement' || belongingNode.type === 'SwitchStatement');\n}\n\n/**\n * Check whether the given node is a directive or not.\n * @param node The node to check.\n * @param sourceCode The source code object to get tokens.\n * @returns `true` if the node is a directive.\n */\nfunction isDirective(node: ASTNode, sourceCode: SourceCode): boolean {\n\treturn (\n\t\tisTopLevelExpressionStatement(node) &&\n\t\tnode.expression.type === 'Literal' &&\n\t\ttypeof node.expression.value === 'string' &&\n\t\t!isParenthesized(node.expression, sourceCode)\n\t);\n}\n\n/**\n * Check whether the given node is a part of directive prologue or not.\n * @param node The node to check.\n * @param sourceCode The source code object to get tokens.\n * @returns `true` if the node is a part of directive prologue.\n */\nfunction isDirectivePrologue(node: ASTNode, sourceCode: SourceCode): boolean {\n\tif (isDirective(node, sourceCode) && node.parent && 'body' in node.parent && Array.isArray(node.parent.body)) {\n\t\tfor (const sibling of node.parent.body) {\n\t\t\tif (sibling === node) break;\n\n\t\t\tif (!isDirective(sibling, sourceCode)) return false;\n\t\t}\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n/**\n * Checks the given node is a CommonJS export statement\n * @param node The node to check.\n * @returns `true` if the node is a CommonJS export statement.\n * @private\n */\nfunction isCJSExport(node: ASTNode): boolean {\n\tif (node.type === 'ExpressionStatement') {\n\t\tconst expression = node.expression;\n\t\tif (expression.type === 'AssignmentExpression') {\n\t\t\tlet left = expression.left;\n\t\t\tif (left.type === 'MemberExpression') {\n\t\t\t\twhile (left.object.type === 'MemberExpression') left = left.object;\n\n\t\t\t\treturn (\n\t\t\t\t\tleft.object.type === 'Identifier' &&\n\t\t\t\t\t(left.object.name === 'exports' ||\n\t\t\t\t\t\t(left.object.name === 'module' && left.property.type === 'Identifier' && left.property.name === 'exports'))\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\n/**\n * Check whether the given node is an expression\n * @param node The node to check.\n * @param sourceCode The source code object to get tokens.\n * @returns `true` if the node is an expression\n */\nfunction isExpression(node: ASTNode, sourceCode: SourceCode): boolean {\n\treturn node.type === 'ExpressionStatement' && !isDirectivePrologue(node, sourceCode);\n}\n\n/**\n * Gets the actual last token.\n *\n * If a semicolon is semicolon-less style's semicolon, this ignores it.\n * For example:\n *\n * foo()\n * ;[1, 2, 3].forEach(bar)\n * @param sourceCode The source code to get tokens.\n * @param node The node to get.\n * @returns The actual last token.\n * @private\n */\nfunction getActualLastToken(node: ASTNode, sourceCode: SourceCode): Token | null {\n\tconst semiToken = sourceCode.getLastToken(node)!;\n\tconst prevToken = sourceCode.getTokenBefore(semiToken);\n\tconst nextToken = sourceCode.getTokenAfter(semiToken);\n\tconst isSemicolonLessStyle =\n\t\tprevToken &&\n\t\tnextToken &&\n\t\tprevToken.range[0] >= node.range[0] &&\n\t\tisSemicolonToken(semiToken) &&\n\t\t!isTokenOnSameLine(prevToken, semiToken) &&\n\t\tisTokenOnSameLine(semiToken, nextToken);\n\n\treturn isSemicolonLessStyle ? prevToken : semiToken;\n}\n\n/**\n * This returns the concatenation of the first 2 captured strings.\n * @param _ Unused. Whole matched string.\n * @param trailingSpaces The trailing spaces of the first line.\n * @param indentSpaces The indentation spaces of the last line.\n * @returns The concatenation of trailingSpaces and indentSpaces.\n * @private\n */\nfunction replacerToRemovePaddingLines(_: string, trailingSpaces: string, indentSpaces: string): string {\n\treturn trailingSpaces + indentSpaces;\n}\n\nfunction getReportLoc(node: ASTNode, sourceCode: SourceCode): Location {\n\tif (isSingleLine(node)) return node.loc;\n\n\tconst line = node.loc.start.line;\n\tconst sourceLine = sourceCode.lines[line - 1];\n\tif (sourceLine === undefined) throw new Error('Padding rule invariant: statement source line is missing');\n\n\treturn {\n\t\tstart: node.loc.start,\n\t\tend: {\n\t\t\tline,\n\t\t\tcolumn: sourceLine.length,\n\t\t},\n\t};\n}\n\n/**\n * Check and report statements for `any` configuration.\n * It does nothing.\n *\n * @private\n */\nfunction verifyForAny(): void {\n\t// Empty\n}\n\n/**\n * Check and report statements for `never` configuration.\n * This autofix removes blank lines between the given 2 statements.\n * However, if comments exist between 2 blank lines, it does not remove those\n * blank lines automatically.\n * @param context The rule context to report.\n * @param _ Unused. The previous node to check.\n * @param nextNode The next node to check.\n * @param paddingLines The array of token pairs that blank\n * lines exist between the pair.\n *\n * @private\n */\nfunction verifyForNever(context: RuleContext, _: ASTNode, nextNode: ASTNode, paddingLines: [Token, Token][]): void {\n\tif (paddingLines.length === 0) return;\n\n\tcontext.report({\n\t\tnode: nextNode,\n\t\tmessageId: 'unexpectedBlankLine',\n\t\tloc: getReportLoc(nextNode, context.sourceCode),\n\t\tfix(fixer) {\n\t\t\tif (paddingLines.length >= 2) return null;\n\n\t\t\tconst paddingPair = paddingLines[0];\n\t\t\tif (paddingPair === undefined) throw new Error('Padding rule invariant: reported padding pair is missing');\n\t\t\tconst [prevToken, nextToken] = paddingPair;\n\t\t\tconst start = prevToken.range[1];\n\t\t\tconst end = nextToken.range[0];\n\t\t\tconst text = context.sourceCode.text\n\t\t\t\t.slice(start, end)\n\t\t\t\t.replace(PADDING_LINE_SEQUENCE, replacerToRemovePaddingLines);\n\n\t\t\treturn fixer.replaceTextRange([start, end], text);\n\t\t},\n\t});\n}\n\n/**\n * Check and report statements for `always` configuration.\n * This autofix inserts a blank line between the given 2 statements.\n * If the `prevNode` has trailing comments, it inserts a blank line after the\n * trailing comments.\n * @param context The rule context to report.\n * @param prevNode The previous node to check.\n * @param nextNode The next node to check.\n * @param paddingLines The array of token pairs that blank\n * lines exist between the pair.\n *\n * @private\n */\nfunction verifyForAlways(\n\tcontext: RuleContext,\n\tprevNode: ASTNode,\n\tnextNode: ASTNode,\n\tpaddingLines: [Token, Token][],\n): void {\n\tif (paddingLines.length > 0) return;\n\n\tcontext.report({\n\t\tnode: nextNode,\n\t\tmessageId: 'expectedBlankLine',\n\t\tloc: getReportLoc(nextNode, context.sourceCode),\n\t\tfix(fixer) {\n\t\t\tconst sourceCode = context.sourceCode;\n\t\t\tlet prevToken = getActualLastToken(prevNode, sourceCode)!;\n\t\t\tconst nextToken =\n\t\t\t\tsourceCode.getFirstTokenBetween(prevToken, nextNode, {\n\t\t\t\t\tincludeComments: true,\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Skip the trailing comments of the previous node.\n\t\t\t\t\t * This inserts a blank line after the last trailing comment.\n\t\t\t\t\t *\n\t\t\t\t\t * For example:\n\t\t\t\t\t *\n\t\t\t\t\t * foo(); // trailing comment.\n\t\t\t\t\t * // comment.\n\t\t\t\t\t * bar();\n\t\t\t\t\t *\n\t\t\t\t\t * Get fixed to:\n\t\t\t\t\t *\n\t\t\t\t\t * foo(); // trailing comment.\n\t\t\t\t\t *\n\t\t\t\t\t * // comment.\n\t\t\t\t\t * bar();\n\t\t\t\t\t * @param token The token to check.\n\t\t\t\t\t * @returns `true` if the token is not a trailing comment.\n\t\t\t\t\t * @private\n\t\t\t\t\t */\n\t\t\t\t\tfilter(token) {\n\t\t\t\t\t\tif (isTokenOnSameLine(prevToken, token)) {\n\t\t\t\t\t\t\tprevToken = token;\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t},\n\t\t\t\t})! || nextNode;\n\t\t\tconst insertText = isTokenOnSameLine(prevToken, nextToken) ? '\\n\\n' : '\\n';\n\n\t\t\treturn fixer.insertTextAfter(prevToken, insertText);\n\t\t},\n\t});\n}\n\n/**\n * Types of blank lines.\n * `any`, `never`, and `always` are defined.\n * Those have `verify` method to check and report statements.\n * @private\n */\nconst PaddingTypes = {\n\tany: { verify: verifyForAny },\n\tnever: { verify: verifyForNever },\n\talways: { verify: verifyForAlways },\n};\n\nconst MaybeMultilineStatementType: Record<string, NodeTestObject> = {\n\t'block-like': { test: isBlockLikeStatement },\n\t'expression': { test: isExpression },\n\t'return': newKeywordTester('ReturnStatement', 'return'),\n\t'export': newKeywordTester(['ExportAllDeclaration', 'ExportDefaultDeclaration', 'ExportNamedDeclaration'], 'export'),\n\t'var': newKeywordTester('VariableDeclaration', 'var'),\n\t'let': newKeywordTester('VariableDeclaration', 'let'),\n\t'const': newKeywordTester('VariableDeclaration', 'const'),\n\t'using': {\n\t\ttest: (node) => node.type === 'VariableDeclaration' && (node.kind === 'using' || node.kind === 'await using'),\n\t},\n\t'type': newKeywordTester('TSTypeAliasDeclaration', 'type'),\n};\n\n/**\n * Types of statements.\n * Those have `test` method to check it matches to the given statement.\n * @private\n */\nconst StatementTypes: Record<string, NodeTestObject> = {\n\t'*': { test: (): boolean => true },\n\t'exports': { test: isCJSExport },\n\t'require': { test: isCJSRequire },\n\t'directive': { test: isDirectivePrologue },\n\t'iife': { test: isIIFEStatement },\n\n\t'block': newNodeTypeTester('BlockStatement'),\n\t'empty': newNodeTypeTester('EmptyStatement'),\n\t'function': newNodeTypeTester('FunctionDeclaration'),\n\t'ts-method': newNodeTypeTester('TSMethodSignature'),\n\n\t'break': newKeywordTester('BreakStatement', 'break'),\n\t'case': newKeywordTester('SwitchCase', 'case'),\n\t'class': newKeywordTester('ClassDeclaration', 'class'),\n\t'continue': newKeywordTester('ContinueStatement', 'continue'),\n\t'debugger': newKeywordTester('DebuggerStatement', 'debugger'),\n\t'default': newKeywordTester(['SwitchCase', 'ExportDefaultDeclaration'], 'default'),\n\t'do': newKeywordTester('DoWhileStatement', 'do'),\n\t'for': newKeywordTester(['ForStatement', 'ForInStatement', 'ForOfStatement'], 'for'),\n\t'if': newKeywordTester('IfStatement', 'if'),\n\t'import': newKeywordTester('ImportDeclaration', 'import'),\n\t'switch': newKeywordTester('SwitchStatement', 'switch'),\n\t'throw': newKeywordTester('ThrowStatement', 'throw'),\n\t'try': newKeywordTester('TryStatement', 'try'),\n\t'while': newKeywordTester(['WhileStatement', 'DoWhileStatement'], 'while'),\n\t'with': newKeywordTester('WithStatement', 'with'),\n\n\t'cjs-export': {\n\t\ttest: (node, sourceCode) =>\n\t\t\tnode.type === 'ExpressionStatement' &&\n\t\t\tnode.expression.type === 'AssignmentExpression' &&\n\t\t\tCJS_EXPORT.test(sourceCode.getText(node.expression.left)),\n\t},\n\t'cjs-import': {\n\t\ttest: (node, sourceCode) =>\n\t\t\tnode.type === 'VariableDeclaration' &&\n\t\t\tnode.declarations.length > 0 &&\n\t\t\tnode.declarations[0]?.init != null &&\n\t\t\tCJS_IMPORT.test(sourceCode.getText(node.declarations[0].init)),\n\t},\n\n\t'enum': newKeywordTester('TSEnumDeclaration', 'enum'),\n\t'interface': newKeywordTester('TSInterfaceDeclaration', 'interface'),\n\t'function-overload': newNodeTypeTester('TSDeclareFunction'),\n\t...Object.fromEntries(\n\t\tObject.entries(MaybeMultilineStatementType).flatMap(([key, value]) => [\n\t\t\t[key, value],\n\t\t\t[\n\t\t\t\t`singleline-${key}`,\n\t\t\t\t{\n\t\t\t\t\t...value,\n\t\t\t\t\ttest: (node, sourceCode) => value.test(node, sourceCode) && isSingleLine(node),\n\t\t\t\t},\n\t\t\t],\n\t\t\t[\n\t\t\t\t`multiline-${key}`,\n\t\t\t\t{\n\t\t\t\t\t...value,\n\t\t\t\t\ttest: (node, sourceCode) => value.test(node, sourceCode) && !isSingleLine(node),\n\t\t\t\t},\n\t\t\t],\n\t\t]),\n\t),\n};\n\n/**\n * Build the vendored padding rule with caller-owned, typed policy options.\n * `statementTypes` registers caller-defined statement types, looked up before\n * the upstream table, for syntax the upstream matchers do not distinguish.\n */\nexport default function createPaddingLineRule<Extra extends string = never>(\n\toptions: PolicyOptions<NoInfer<Extra>>,\n\tstatementTypes?: Record<Extra, NodeTestObject>,\n): CreateRule {\n\tconst customStatementTypes: Partial<Record<string, NodeTestObject>> = statementTypes ?? {};\n\treturn {\n\t\tmeta: {\n\t\t\ttype: 'layout',\n\t\t\tdocs: {\n\t\t\t\tdescription: 'Require or disallow padding lines between statements',\n\t\t\t},\n\t\t\tfixable: 'whitespace',\n\t\t\thasSuggestions: false,\n\t\t\t// This is intentionally an array schema as you can pass 0..n config objects\n\t\t\tschema: {\n\t\t\t\t$defs: {\n\t\t\t\t\tpaddingType: {\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tenum: Object.keys(PaddingTypes),\n\t\t\t\t\t},\n\t\t\t\t\tstatementType: {\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tenum: Object.keys(StatementTypes),\n\t\t\t\t\t},\n\t\t\t\t\tselectorOption: {\n\t\t\t\t\t\ttype: 'object',\n\t\t\t\t\t\tproperties: {\n\t\t\t\t\t\t\tselector: {\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tlineMode: {\n\t\t\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\t\t\tenum: ['any', 'singleline', 'multiline'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\trequired: ['selector'],\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t},\n\t\t\t\t\tstatementMatcher: {\n\t\t\t\t\t\tanyOf: [{ $ref: '#/$defs/statementType' }, { $ref: '#/$defs/selectorOption' }],\n\t\t\t\t\t},\n\t\t\t\t\tstatementOption: {\n\t\t\t\t\t\tanyOf: [\n\t\t\t\t\t\t\t{ $ref: '#/$defs/statementMatcher' },\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\t\t\titems: { $ref: '#/$defs/statementMatcher' },\n\t\t\t\t\t\t\t\tminItems: 1,\n\t\t\t\t\t\t\t\tuniqueItems: true,\n\t\t\t\t\t\t\t\tadditionalItems: false,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\ttype: 'array',\n\t\t\t\tadditionalItems: false,\n\t\t\t\titems: {\n\t\t\t\t\ttype: 'object',\n\t\t\t\t\tproperties: {\n\t\t\t\t\t\tblankLine: { $ref: '#/$defs/paddingType' },\n\t\t\t\t\t\tprev: { $ref: '#/$defs/statementOption' },\n\t\t\t\t\t\tnext: { $ref: '#/$defs/statementOption' },\n\t\t\t\t\t},\n\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\trequired: ['blankLine', 'prev', 'next'],\n\t\t\t\t},\n\t\t\t},\n\t\t\tmessages: {\n\t\t\t\tunexpectedBlankLine: 'Unexpected blank line before this statement.',\n\t\t\t\texpectedBlankLine: 'Expected blank line before this statement.',\n\t\t\t},\n\t\t},\n\t\tcreate(context) {\n\t\t\tconst sourceCode = context.sourceCode;\n\n\t\t\tconst selectorMatchedNodes = new Map<string, Set<ASTNode>>();\n\t\t\tconst pendingPairs: { prevNode: ASTNode; nextNode: ASTNode }[] = [];\n\n\t\t\tfunction collectSelectorOption(option: PolicyStatementOption<Extra>): void {\n\t\t\t\tif (Array.isArray(option)) {\n\t\t\t\t\tfor (const item of option) collectSelectorOption(item);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!isSelectorOption(option)) return;\n\n\t\t\t\tselectorMatchedNodes.set(option.selector, new Set());\n\t\t\t}\n\n\t\t\tfor (const configure of options) {\n\t\t\t\tcollectSelectorOption(configure.prev);\n\t\t\t\tcollectSelectorOption(configure.next);\n\t\t\t}\n\n\t\t\ttype Scope = {\n\t\t\t\tupper: Scope;\n\t\t\t\tprevNode: ASTNode | null;\n\t\t\t} | null;\n\n\t\t\tlet scopeInfo: Scope = null;\n\n\t\t\t/**\n\t\t\t * Processes to enter to new scope.\n\t\t\t * This manages the current previous statement.\n\t\t\t *\n\t\t\t * @private\n\t\t\t */\n\t\t\tfunction enterScope(): void {\n\t\t\t\tscopeInfo = {\n\t\t\t\t\tupper: scopeInfo,\n\t\t\t\t\tprevNode: null,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Processes to exit from the current scope.\n\t\t\t *\n\t\t\t * @private\n\t\t\t */\n\t\t\tfunction exitScope(): void {\n\t\t\t\tif (scopeInfo) scopeInfo = scopeInfo.upper;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Checks whether the given node matches the given type.\n\t\t\t * @param node The statement node to check.\n\t\t\t * @param type The statement type to check.\n\t\t\t * @returns `true` if the statement node matched the type.\n\t\t\t * @private\n\t\t\t */\n\t\t\tfunction match(node: ASTNode, type: PolicyStatementOption<Extra>): boolean {\n\t\t\t\tlet innerStatementNode = node;\n\n\t\t\t\twhile (innerStatementNode.type === 'LabeledStatement') innerStatementNode = innerStatementNode.body;\n\n\t\t\t\tif (Array.isArray(type)) return type.some(match.bind(null, innerStatementNode));\n\n\t\t\t\tif (isSelectorOption(type)) {\n\t\t\t\t\tconst matchedNodes = selectorMatchedNodes.get(type.selector);\n\t\t\t\t\tif (!matchedNodes?.has(innerStatementNode)) return false;\n\n\t\t\t\t\tconst lineMode = type.lineMode;\n\n\t\t\t\t\tif (lineMode === 'singleline') return isSingleLine(innerStatementNode);\n\t\t\t\t\telse if (lineMode === 'multiline') return !isSingleLine(innerStatementNode);\n\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tconst statementType = customStatementTypes[type] ?? StatementTypes[type];\n\t\t\t\t\tif (statementType === undefined)\n\t\t\t\t\t\tthrow new Error(`Padding rule invariant: unsupported statement type ${type}`);\n\t\t\t\t\treturn statementType.test(innerStatementNode, sourceCode);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Finds the last matched configure from options.\n\t\t\t * @param prevNode The previous statement to match.\n\t\t\t * @param nextNode The current statement to match.\n\t\t\t * @returns The tester of the last matched configure.\n\t\t\t * @private\n\t\t\t */\n\t\t\tfunction getPaddingType(prevNode: ASTNode, nextNode: ASTNode): (typeof PaddingTypes)[keyof typeof PaddingTypes] {\n\t\t\t\tfor (let i = options.length - 1; i >= 0; --i) {\n\t\t\t\t\tconst configure = options[i];\n\t\t\t\t\tif (configure === undefined) throw new Error('Padding rule invariant: configuration entry is missing');\n\t\t\t\t\tif (match(prevNode, configure.prev) && match(nextNode, configure.next)) {\n\t\t\t\t\t\treturn PaddingTypes[configure.blankLine];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn PaddingTypes.any;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Gets padding line sequences between the given 2 statements.\n\t\t\t * Comments are separators of the padding line sequences.\n\t\t\t * @param prevNode The previous statement to count.\n\t\t\t * @param nextNode The current statement to count.\n\t\t\t * @returns The array of token pairs.\n\t\t\t * @private\n\t\t\t */\n\t\t\tfunction getPaddingLineSequences(prevNode: ASTNode, nextNode: ASTNode): [Token, Token][] {\n\t\t\t\tconst pairs: [Token, Token][] = [];\n\t\t\t\tlet prevToken: Token = getActualLastToken(prevNode, sourceCode)!;\n\n\t\t\t\tif (nextNode.loc.start.line - prevToken.loc.end.line >= 2) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tconst token: Token = sourceCode.getTokenAfter(prevToken, {\n\t\t\t\t\t\t\tincludeComments: true,\n\t\t\t\t\t\t})!;\n\n\t\t\t\t\t\tif (token.loc.start.line - prevToken.loc.end.line >= 2) pairs.push([prevToken, token]);\n\n\t\t\t\t\t\tprevToken = token;\n\t\t\t\t\t} while (prevToken.range[0] < nextNode.range[0]);\n\t\t\t\t}\n\n\t\t\t\treturn pairs;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Verify padding lines between the given node and the previous node.\n\t\t\t * @param node The node to verify.\n\t\t\t *\n\t\t\t * @private\n\t\t\t */\n\t\t\tfunction verify(node: ASTNode): void {\n\t\t\t\tif (\n\t\t\t\t\t!node.parent ||\n\t\t\t\t\t![\n\t\t\t\t\t\t'BlockStatement',\n\t\t\t\t\t\t'Program',\n\t\t\t\t\t\t'StaticBlock',\n\t\t\t\t\t\t'SwitchCase',\n\t\t\t\t\t\t'SwitchStatement',\n\t\t\t\t\t\t'TSInterfaceBody',\n\t\t\t\t\t\t'TSModuleBlock',\n\t\t\t\t\t\t'TSTypeLiteral',\n\t\t\t\t\t].includes(node.parent.type)\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Save this node as the current previous statement.\n\t\t\t\tconst prevNode = scopeInfo!.prevNode;\n\n\t\t\t\t// Verify.\n\t\t\t\tif (prevNode) pendingPairs.push({ prevNode, nextNode: node });\n\n\t\t\t\tscopeInfo!.prevNode = node;\n\t\t\t}\n\n\t\t\tfunction verifyPendingPairs(): void {\n\t\t\t\tfor (const { prevNode, nextNode } of pendingPairs) {\n\t\t\t\t\tconst type = getPaddingType(prevNode, nextNode);\n\t\t\t\t\tconst paddingLines = getPaddingLineSequences(prevNode, nextNode);\n\n\t\t\t\t\ttype.verify(context, prevNode, nextNode, paddingLines);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Verify padding lines between the given node and the previous node.\n\t\t\t * Then process to enter to new scope.\n\t\t\t * @param node The node to verify.\n\t\t\t *\n\t\t\t * @private\n\t\t\t */\n\t\t\tfunction verifyThenEnterScope(node: ASTNode): void {\n\t\t\t\tverify(node);\n\t\t\t\tenterScope();\n\t\t\t}\n\n\t\t\tconst selectorMatchListeners = Object.fromEntries(\n\t\t\t\tArray.from(selectorMatchedNodes.keys(), (selector) => [\n\t\t\t\t\tselector,\n\t\t\t\t\t(node: ASTNode): void => {\n\t\t\t\t\t\tselectorMatchedNodes.get(selector)?.add(node);\n\t\t\t\t\t},\n\t\t\t\t]),\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t'Program': enterScope,\n\t\t\t\t'Program:exit': () => {\n\t\t\t\t\tverifyPendingPairs();\n\t\t\t\t\texitScope();\n\t\t\t\t},\n\t\t\t\t'BlockStatement': enterScope,\n\t\t\t\t'BlockStatement:exit': exitScope,\n\t\t\t\t'SwitchStatement': enterScope,\n\t\t\t\t'SwitchStatement:exit': exitScope,\n\t\t\t\t'SwitchCase': verifyThenEnterScope,\n\t\t\t\t'SwitchCase:exit': exitScope,\n\t\t\t\t'StaticBlock': enterScope,\n\t\t\t\t'StaticBlock:exit': exitScope,\n\n\t\t\t\t'TSInterfaceBody': enterScope,\n\t\t\t\t'TSInterfaceBody:exit': exitScope,\n\t\t\t\t'TSModuleBlock': enterScope,\n\t\t\t\t'TSModuleBlock:exit': exitScope,\n\t\t\t\t'TSTypeLiteral': enterScope,\n\t\t\t\t'TSTypeLiteral:exit': exitScope,\n\t\t\t\t'TSDeclareFunction': verifyThenEnterScope,\n\t\t\t\t'TSDeclareFunction:exit': exitScope,\n\t\t\t\t'TSMethodSignature': verifyThenEnterScope,\n\t\t\t\t'TSMethodSignature:exit': exitScope,\n\n\t\t\t\t':statement': verify,\n\t\t\t\t...selectorMatchListeners,\n\t\t\t};\n\t\t},\n\t};\n}\n","import createPaddingLineRule from '../vendor/eslint-stylistic/padding-line-between-statements.ts';\nimport type { NodeTestObject } from '../vendor/eslint-stylistic/padding-line-between-statements.ts';\nimport type { CreateRule, ESTree, SourceCode } from '@oxlint/plugins';\n\n/** A `const`/`let`/`var`/`using` declaration, optionally exported, written on one line. */\nfunction isSinglelineBinding(node: ESTree.Node): boolean {\n\tconst declaration = node.type === 'ExportNamedDeclaration' ? node.declaration : node;\n\treturn declaration?.type === 'VariableDeclaration' && node.loc.start.line === node.loc.end.line;\n}\n\n/** Comments above a statement belong to it; a comment trailing the previous line does not. */\nfunction hasLeadingComment(node: ESTree.Node, sourceCode: SourceCode): boolean {\n\tconst previousLine = sourceCode.getTokenBefore(node)?.loc.end.line;\n\treturn sourceCode.getCommentsBefore(node).some((comment) => comment.loc.start.line !== previousLine);\n}\n\nconst singlelineBinding: NodeTestObject = {\n\ttest: (node) => isSinglelineBinding(node),\n};\n\nconst undocumentedSinglelineBinding: NodeTestObject = {\n\ttest: (node, sourceCode) => isSinglelineBinding(node) && !hasLeadingComment(node, sourceCode),\n};\n\nconst paddingRule = createPaddingLineRule(\n\t[\n\t\t{ blankLine: 'always', prev: 'import', next: '*' },\n\t\t{ blankLine: 'always', prev: '*', next: { selector: 'Program > :not(ImportDeclaration)' } },\n\t\t{ blankLine: 'always', prev: { selector: 'Program > :not(ImportDeclaration)' }, next: '*' },\n\t\t{ blankLine: 'always', prev: '*', next: ['function', 'class', 'interface', 'type'] },\n\t\t{ blankLine: 'always', prev: ['function', 'class', 'interface', 'type'], next: '*' },\n\t\t{\n\t\t\tblankLine: 'always',\n\t\t\tprev: '*',\n\t\t\tnext: ['multiline-const', 'multiline-let', 'multiline-var', 'multiline-using'],\n\t\t},\n\t\t{\n\t\t\tblankLine: 'always',\n\t\t\tprev: ['multiline-const', 'multiline-let', 'multiline-var', 'multiline-using'],\n\t\t\tnext: '*',\n\t\t},\n\t\t{ blankLine: 'always', prev: '*', next: ['return', 'if', 'switch', 'try', 'for', 'while', 'do'] },\n\t\t{ blankLine: 'always', prev: 'block-like', next: '*' },\n\t\t{ blankLine: 'any', prev: 'import', next: 'import' },\n\t\t// Consecutive single-line bindings form one group at any scope, including\n\t\t// module scope. A binding with its own leading comment starts a new group.\n\t\t{ blankLine: 'any', prev: 'singleline-binding', next: 'undocumented-singleline-binding' },\n\t\t{\n\t\t\tblankLine: 'any',\n\t\t\tprev: {\n\t\t\t\tselector: ':matches(TSDeclareFunction, ExportNamedDeclaration[declaration.type=\"TSDeclareFunction\"])',\n\t\t\t},\n\t\t\tnext: {\n\t\t\t\tselector:\n\t\t\t\t\t':matches(TSDeclareFunction, FunctionDeclaration, ExportNamedDeclaration[declaration.type=\"TSDeclareFunction\"], ExportNamedDeclaration[declaration.type=\"FunctionDeclaration\"])',\n\t\t\t},\n\t\t},\n\t],\n\t{\n\t\t'singleline-binding': singlelineBinding,\n\t\t'undocumented-singleline-binding': undocumentedSinglelineBinding,\n\t},\n);\n\n/** Restore structural blank lines with whitespace-only fixes; keep single-line binding groups and overloads grouped. */\nexport const requireReadableSpacingRule: CreateRule = {\n\t...paddingRule,\n\tmeta: {\n\t\t...paddingRule.meta,\n\t\tdocs: {\n\t\t\tdescription: 'Require readable spacing between declarations and logical statement groups.',\n\t\t},\n\t\tschema: [],\n\t},\n};\n","import { defineRule } from '@oxlint/plugins';\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\t'ExpressionStatement',\n\t'PropertyDefinition',\n\t'ReturnStatement',\n\t'ThrowStatement',\n\t'VariableDeclaration',\n]);\n\nfunction isConstAssertion(node: TypeAssertion): boolean {\n\treturn (\n\t\tnode.typeAnnotation.type === 'TSTypeReference' &&\n\t\tnode.typeAnnotation.typeName.type === 'Identifier' &&\n\t\tnode.typeAnnotation.typeName.name === 'const'\n\t);\n}\n\nfunction configuredSafetyMarkers(option: unknown): readonly string[] {\n\tif (typeof option !== 'object' || option === null || !('markers' in option)) {\n\t\treturn DEFAULT_SAFETY_MARKERS;\n\t}\n\tconst configured = option.markers;\n\tif (!Array.isArray(configured)) return DEFAULT_SAFETY_MARKERS;\n\tconst markers = configured.flatMap((marker) =>\n\t\ttypeof marker === 'string' && marker.trim().length > 0 ? [marker.trim()] : [],\n\t);\n\treturn markers.length > 0 ? markers : DEFAULT_SAFETY_MARKERS;\n}\n\nfunction markerPattern(markers: readonly string[]): RegExp {\n\tconst alternation = markers.map((marker) => marker.replaceAll(/[.*+?^${}()|[\\]\\\\]/gu, String.raw`\\$&`)).join('|');\n\treturn new RegExp(String.raw`(?:^|[^\\p{L}\\p{N}_])(?:${alternation})\\s*:\\s*\\S`, 'u');\n}\n\nfunction hasSafetyJustificationBefore(\n\tsourceCode: SourceCode,\n\towner: ESTree.Node,\n\tassertion: TypeAssertion,\n\tpattern: RegExp,\n): boolean {\n\treturn sourceCode\n\t\t.getCommentsBefore(owner)\n\t\t.some((comment) => comment.end <= assertion.start && pattern.test(comment.value));\n}\n\nfunction hasSafetyComment(sourceCode: SourceCode, node: TypeAssertion, pattern: RegExp): boolean {\n\tlet current: ESTree.Node = node;\n\twhile (true) {\n\t\tif (hasSafetyJustificationBefore(sourceCode, current, node, pattern)) return true;\n\t\tif (commentOwnerKinds.has(current.type)) {\n\t\t\tconst exportDeclaration = current.parent;\n\t\t\treturn (\n\t\t\t\texportDeclaration.type === 'ExportNamedDeclaration' &&\n\t\t\t\texportDeclaration.declaration === current &&\n\t\t\t\thasSafetyJustificationBefore(sourceCode, exportDeclaration, node, pattern)\n\t\t\t);\n\t\t}\n\t\tif (current.parent.type === 'Program') return false;\n\t\tcurrent = current.parent;\n\t}\n}\n\n/** Require every non-const type assertion to state the invariant TypeScript cannot express. */\nexport const requireSafetyCommentForTypeAssertionRule = defineRule({\n\tmeta: {\n\t\ttype: 'problem',\n\t\tdocs: {\n\t\t\tdescription: 'Require a nearby SAFETY comment for every TypeScript type assertion except const assertions.',\n\t\t},\n\t\tmessages: {\n\t\t\tmissingSafetyComment:\n\t\t\t\t'This type assertion has no `{{marker}}:` justification. State the checked invariant immediately before the assertion or its containing statement.',\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\tmarkers: {\n\t\t\t\t\t\ttype: 'array',\n\t\t\t\t\t\titems: { type: 'string', minLength: 1 },\n\t\t\t\t\t\tminItems: 1,\n\t\t\t\t\t\tuniqueItems: true,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tadditionalProperties: false,\n\t\t\t},\n\t\t],\n\t\tdefaultOptions: [{ markers: ['SAFETY'] }],\n\t},\n\tcreateOnce(context) {\n\t\tconst patterns = new Map<string, RegExp>();\n\n\t\tconst checkAssertion = (node: TypeAssertion) => {\n\t\t\tif (isConstAssertion(node)) return;\n\t\t\tconst markers = configuredSafetyMarkers(context.options?.[0]);\n\t\t\tconst patternKey = markers.join('\\u0000');\n\t\t\tconst pattern = patterns.get(patternKey) ?? markerPattern(markers);\n\t\t\tpatterns.set(patternKey, pattern);\n\t\t\tif (hasSafetyComment(context.sourceCode, node, pattern)) return;\n\t\t\tcontext.report({\n\t\t\t\tnode,\n\t\t\t\tmessageId: 'missingSafetyComment',\n\t\t\t\tdata: { marker: markers[0] ?? DEFAULT_SAFETY_MARKERS[0] },\n\t\t\t});\n\t\t};\n\n\t\treturn {\n\t\t\tTSAsExpression: checkAssertion,\n\t\t\tTSTypeAssertion: checkAssertion,\n\t\t};\n\t},\n});\n"],"mappings":";AAAA,SAAS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AW,SAAS;AACnB,UAAM,WAAW,oBAAI,IAAoB;AAEzC,UAAM,iBAAiB,CAAC,SAAwB;AAC/C,UAAIC,kBAAiB,IAAI,EAAG;AAC5B,YAAM,UAAU,wBAAwB,QAAQ,UAAU,CAAC,CAAC;AAC5D,YAAM,aAAa,QAAQ,KAAK,IAAQ;AACxC,YAAM,UAAU,SAAS,IAAI,UAAU,KAAK,cAAc,OAAO;AACjE,eAAS,IAAI,YAAY,OAAO;AAChC,UAAI,iBAAiB,QAAQ,YAAY,MAAM,OAAO,EAAG;AACzD,cAAQ,OAAO;AAAA,QACd;AAAA,QACA,WAAW;AAAA,QACX,MAAM,EAAE,QAAQ,QAAQ,CAAC,KAAK,uBAAuB,CAAC,EAAE;AAAA,MACzD,CAAC;AAAA,IACF;AAEA,WAAO;AAAA,MACN,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,IAClB;AAAA,EACD;AACD,CAAC;;;A3BhGD,IAAM,iBAAiB,mBAAmB;AAAA,EACzC,MAAM,EAAE,MAAM,YAAY;AAAA,EAC1B,OAAO;AAAA,IACN,uBAAuB;AAAA,IACvB,8BAA8B;AAAA,IAC9B,8BAA8B;AAAA,IAC9B,sCAAsC;AAAA,IACtC,2BAA2B;AAAA,IAC3B,qBAAqB;AAAA,IACrB,wBAAwB;AAAA,IACxB,oBAAoB;AAAA,IACpB,kBAAkB;AAAA,IAClB,qBAAqB;AAAA,IACrB,6BAA6B;AAAA,IAC7B,4BAA4B;AAAA,IAC5B,yBAAyB;AAAA,IACzB,sBAAsB;AAAA,IACtB,2BAA2B;AAAA,IAC3B,wBAAwB;AAAA,IACxB,4BAA4B;AAAA,IAC5B,6CAA6C;AAAA,EAC9C;AACD,CAAC;AAED,IAAO,oBAAQ;","names":["defineRule","defineRule","defineRule","isNode","typeReferenceName","substitutions","resolved","isEmptyObjectExpression","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","defineRule","typeReferenceName","defineRule","defineRule","typeReferenceName","variableDeclarator","node","defineRule","isConstAssertion"]}
@@ -0,0 +1,19 @@
1
+ // src/shared.ts
2
+ var IGNORE_PATTERNS = [
3
+ "**/.adonisjs/**",
4
+ "**/build/**",
5
+ "**/dist/**",
6
+ "**/node_modules/**",
7
+ "**/public/assets/**",
8
+ "**/storybook-static/**",
9
+ "**/tmp/**",
10
+ ".agent/**",
11
+ ".agents/**",
12
+ ".claude/**",
13
+ ".codex/**"
14
+ ];
15
+
16
+ export {
17
+ IGNORE_PATTERNS
18
+ };
19
+ //# sourceMappingURL=chunk-ICJABKYN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shared.ts"],"sourcesContent":["export const IGNORE_PATTERNS = [\n\t'**/.adonisjs/**',\n\t'**/build/**',\n\t'**/dist/**',\n\t'**/node_modules/**',\n\t'**/public/assets/**',\n\t'**/storybook-static/**',\n\t'**/tmp/**',\n\t'.agent/**',\n\t'.agents/**',\n\t'.claude/**',\n\t'.codex/**',\n];\n"],"mappings":";AAAO,IAAM,kBAAkB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;","names":[]}
@@ -0,0 +1,6 @@
1
+ import { defineConfig } from 'oxfmt';
2
+
3
+ type OxfmtOptions = Partial<Parameters<typeof defineConfig>[0]>;
4
+ declare function boringnodePreset(options?: OxfmtOptions): ReturnType<typeof defineConfig>;
5
+
6
+ export { boringnodePreset };
package/build/oxfmt.js ADDED
@@ -0,0 +1,33 @@
1
+ import {
2
+ IGNORE_PATTERNS
3
+ } from "./chunk-ICJABKYN.js";
4
+
5
+ // src/oxfmt.ts
6
+ import { defineConfig } from "oxfmt";
7
+ function boringnodePreset(options = {}) {
8
+ return defineConfig({
9
+ arrowParens: "always",
10
+ bracketSpacing: true,
11
+ ignorePatterns: [...IGNORE_PATTERNS, "**/package.json"],
12
+ printWidth: 120,
13
+ quoteProps: "consistent",
14
+ semi: true,
15
+ singleQuote: true,
16
+ sortImports: {
17
+ groups: ["side_effect", "builtin", "external", "internal", "parent", "sibling", "index", "type", "unknown"],
18
+ internalPattern: ["#", "~/"],
19
+ newlinesBetween: false,
20
+ order: "asc"
21
+ },
22
+ sortTailwindcss: {
23
+ functions: ["tv"]
24
+ },
25
+ trailingComma: "all",
26
+ useTabs: true,
27
+ ...options
28
+ });
29
+ }
30
+ export {
31
+ boringnodePreset
32
+ };
33
+ //# sourceMappingURL=oxfmt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/oxfmt.ts"],"sourcesContent":["import { defineConfig } from 'oxfmt';\nimport { IGNORE_PATTERNS } from './shared.ts';\n\ntype OxfmtOptions = Partial<Parameters<typeof defineConfig>[0]>;\n\nexport function boringnodePreset(options: OxfmtOptions = {}): ReturnType<typeof defineConfig> {\n\treturn defineConfig({\n\t\tarrowParens: 'always',\n\t\tbracketSpacing: true,\n\t\tignorePatterns: [...IGNORE_PATTERNS, '**/package.json'],\n\t\tprintWidth: 120,\n\t\tquoteProps: 'consistent',\n\t\tsemi: true,\n\t\tsingleQuote: true,\n\t\tsortImports: {\n\t\t\tgroups: ['side_effect', 'builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'type', 'unknown'],\n\t\t\tinternalPattern: ['#', '~/'],\n\t\t\tnewlinesBetween: false,\n\t\t\torder: 'asc',\n\t\t},\n\t\tsortTailwindcss: {\n\t\t\tfunctions: ['tv'],\n\t\t},\n\t\ttrailingComma: 'all',\n\t\tuseTabs: true,\n\t\t...options,\n\t});\n}\n"],"mappings":";;;;;AAAA,SAAS,oBAAoB;AAKtB,SAAS,iBAAiB,UAAwB,CAAC,GAAoC;AAC7F,SAAO,aAAa;AAAA,IACnB,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,gBAAgB,CAAC,GAAG,iBAAiB,iBAAiB;AAAA,IACtD,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,MACZ,QAAQ,CAAC,eAAe,WAAW,YAAY,YAAY,UAAU,WAAW,SAAS,QAAQ,SAAS;AAAA,MAC1G,iBAAiB,CAAC,KAAK,IAAI;AAAA,MAC3B,iBAAiB;AAAA,MACjB,OAAO;AAAA,IACR;AAAA,IACA,iBAAiB;AAAA,MAChB,WAAW,CAAC,IAAI;AAAA,IACjB;AAAA,IACA,eAAe;AAAA,IACf,SAAS;AAAA,IACT,GAAG;AAAA,EACJ,CAAC;AACF;","names":[]}
@@ -0,0 +1,9 @@
1
+ import { OxlintConfig } from 'oxlint';
2
+
3
+ type BoringnodeOxlintOptions = OxlintConfig & {
4
+ react?: boolean;
5
+ vue?: boolean;
6
+ };
7
+ declare function boringnodePreset(options?: BoringnodeOxlintOptions): OxlintConfig;
8
+
9
+ export { boringnodePreset };