@adamaho/nopeus-oxlint-plugin 0.7.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.
- package/LICENSE +21 -0
- package/README.md +822 -0
- package/dist/base.d.mts +31 -0
- package/dist/base.d.mts.map +1 -0
- package/dist/base.mjs +31 -0
- package/dist/base.mjs.map +1 -0
- package/dist/effect.d.mts +67 -0
- package/dist/effect.d.mts.map +1 -0
- package/dist/effect.mjs +64 -0
- package/dist/effect.mjs.map +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2693 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["importedName","resolveVariable","unwrapExpression","unwrap","unwrap","importedName","resolveVariable","propertyName","propertyName","staticString","isEmptyObjectExpression","typeReferenceName","resolveVariable","resolveVariable","referencedAliasName"],"sources":["../src/effect/rules/effect-call.ts","../src/effect/rules/no-effect-runners-in-library.ts","../src/effect/rules/no-fallible-effect-promise.ts","../src/effect/rules/no-inline-live-layer.ts","../src/effect/rules/no-module-level-mutable-state.ts","../src/effect/rules/no-unscoped-fork.ts","../src/effect/rules/no-untyped-effect-errors.ts","../src/effect/rules/prefer-effect-platform-services.ts","../src/effect/rules/prefer-effect-void.ts","../src/effect/rules/require-effect-fn-name.ts","../src/effect/rules/require-effect-namespace.ts","../src/effect/rules/require-fetch-abort-signal.ts","../src/effect/rules/require-service-constructor-names.ts","../src/effect/rules/require-service-key-prefix.ts","../src/rules/no-conditional-empty-object-spread.ts","../src/shared/package-layout.ts","../src/shared/import-resolution.ts","../src/shared/import-sources.ts","../src/rules/no-cross-package-internals.ts","../src/rules/no-export-assignment.ts","../src/shared/dictionary-types.ts","../src/rules/no-known-value-widening.ts","../src/rules/no-module-mocking.ts","../src/shared/lexical-type-parameters.ts","../src/rules/no-object-parameters.ts","../src/shared/reflect-method.ts","../src/rules/no-reflect-apply.ts","../src/rules/no-reflect-get.ts","../src/rules/no-runtime-typeof.ts","../src/rules/no-test-imports.ts","../src/rules/no-type-assertions.ts","../src/rules/no-unknown-returns.ts","../src/rules/no-unknown-type-aliases.ts","../src/rules/no-unsafe-dictionary-type.ts","../src/rules/require-public-jsdoc.ts","../src/rules/require-test-location.ts","../src/index.ts"],"sourcesContent":["import type { ESTree, Scope, SourceCode, Variable } from \"@oxlint/plugins\";\n\nexport interface ModuleBindings {\n readonly barrelName: string;\n readonly moduleName: string;\n}\n\n/** Describe the barrel and direct module imports for one Effect module. */\nexport function moduleBindings(moduleName: string, barrelName: string): ModuleBindings {\n return { barrelName, moduleName };\n}\n\nfunction importedName(specifier: ESTree.ImportSpecifier): string {\n return specifier.imported.type === \"Identifier\"\n ? specifier.imported.name\n : specifier.imported.value;\n}\n\nfunction resolveVariable(\n sourceCode: SourceCode,\n identifier: ESTree.IdentifierReference,\n): Variable | null {\n let scope: Scope | null = sourceCode.getScope(identifier);\n while (scope !== null) {\n const variable = scope.set.get(identifier.name);\n if (variable !== undefined) return variable;\n scope = scope.upper;\n }\n return null;\n}\n\n/** Test whether an identifier resolves to one global binding. */\nexport function isGlobalIdentifier(\n sourceCode: SourceCode,\n identifier: ESTree.IdentifierReference,\n name: string,\n): boolean {\n if (identifier.name !== name) return false;\n if (sourceCode.isGlobalReference(identifier)) return true;\n const variable = resolveVariable(sourceCode, identifier);\n return variable === null || variable.defs.length === 0;\n}\n\nfunction isNamedModuleImport(\n sourceCode: SourceCode,\n identifier: ESTree.IdentifierReference,\n bindings: ModuleBindings,\n name: string,\n): boolean {\n const variable = resolveVariable(sourceCode, identifier);\n return (\n variable?.defs.some(\n (definition) =>\n definition.type === \"ImportBinding\" &&\n definition.parent?.type === \"ImportDeclaration\" &&\n definition.parent.source.value === bindings.moduleName &&\n definition.node.type === \"ImportSpecifier\" &&\n importedName(definition.node) === name,\n ) === true\n );\n}\n\nfunction isModuleNamespace(\n sourceCode: SourceCode,\n identifier: ESTree.IdentifierReference,\n bindings: ModuleBindings,\n): boolean {\n const variable = resolveVariable(sourceCode, identifier);\n return (\n variable?.defs.some((definition) => {\n if (definition.type !== \"ImportBinding\" || definition.parent?.type !== \"ImportDeclaration\") {\n return false;\n }\n if (definition.parent.source.value === bindings.moduleName) {\n return definition.node.type === \"ImportNamespaceSpecifier\";\n }\n return (\n definition.parent.source.value === \"effect\" &&\n definition.node.type === \"ImportSpecifier\" &&\n importedName(definition.node) === bindings.barrelName\n );\n }) === true\n );\n}\n\nfunction isBarrelModule(\n sourceCode: SourceCode,\n expression: ESTree.MemberExpression,\n bindings: ModuleBindings,\n): boolean {\n if (\n expression.object.type !== \"Identifier\" ||\n expression.computed ||\n expression.property.type !== \"Identifier\" ||\n expression.property.name !== bindings.barrelName\n )\n return false;\n const variable = resolveVariable(sourceCode, expression.object);\n return (\n variable?.defs.some(\n (definition) =>\n definition.type === \"ImportBinding\" &&\n definition.parent?.type === \"ImportDeclaration\" &&\n definition.parent.source.value === \"effect\" &&\n definition.node.type === \"ImportNamespaceSpecifier\",\n ) === true\n );\n}\n\n/** Test whether a type name resolves to an imported Effect module type. */\nexport function isModuleType(\n sourceCode: SourceCode,\n typeName: ESTree.TSTypeName,\n bindings: ModuleBindings,\n name: string,\n): boolean {\n if (typeName.type === \"Identifier\") {\n return isNamedModuleImport(sourceCode, typeName, bindings, name);\n }\n return (\n typeName.type === \"TSQualifiedName\" &&\n typeName.left.type === \"Identifier\" &&\n isModuleNamespace(sourceCode, typeName.left, bindings) &&\n typeName.right.name === name\n );\n}\n\n/** Test whether a callee resolves to an imported Effect module function. */\nexport function isModuleCall(\n sourceCode: SourceCode,\n callee: ESTree.CallExpression[\"callee\"],\n bindings: ModuleBindings,\n name: string,\n): boolean {\n if (callee.type === \"Identifier\") {\n return isNamedModuleImport(sourceCode, callee, bindings, name);\n }\n return (\n callee.type === \"MemberExpression\" &&\n !callee.computed &&\n ((callee.object.type === \"Identifier\" &&\n isModuleNamespace(sourceCode, callee.object, bindings)) ||\n (callee.object.type === \"MemberExpression\" &&\n isBarrelModule(sourceCode, callee.object, bindings))) &&\n callee.property.type === \"Identifier\" &&\n callee.property.name === name\n );\n}\n","import { defineRule } from \"@oxlint/plugins\";\n\nimport { isModuleCall, moduleBindings } from \"./effect-call.ts\";\n\nconst runners = [\n \"runCallback\",\n \"runCallbackWith\",\n \"runFork\",\n \"runForkWith\",\n \"runPromise\",\n \"runPromiseExit\",\n \"runPromiseExitWith\",\n \"runPromiseWith\",\n \"runSync\",\n \"runSyncExit\",\n \"runSyncExitWith\",\n \"runSyncWith\",\n] as const;\n\nfunction normalizedPath(path: string): string {\n return path.replaceAll(\"\\\\\", \"/\");\n}\n\nfunction repositoryRelativePath(filename: string, cwd: string): string {\n const normalizedFilename = normalizedPath(filename);\n const normalizedCwd = normalizedPath(cwd).replace(/\\/$/u, \"\");\n return normalizedFilename.startsWith(normalizedCwd + \"/\")\n ? normalizedFilename.slice(normalizedCwd.length + 1)\n : normalizedFilename;\n}\n\nfunction isAllowed(filename: string, cwd: string, allowFiles: readonly string[]): boolean {\n const relativeFilename = repositoryRelativePath(filename, cwd);\n return allowFiles.some((path) => relativeFilename === normalizedPath(path).replace(/^\\.\\//u, \"\"));\n}\n\n/** Keep Effect runtime execution in explicitly configured entrypoints. */\nexport const noEffectRunnersInLibraryRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Disallow Effect runtime runners outside configured entrypoint files.\" },\n schema: [\n {\n type: \"object\",\n properties: {\n allowFiles: { type: \"array\", items: { type: \"string\", minLength: 1 }, uniqueItems: true },\n },\n required: [\"allowFiles\"],\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ allowFiles: [] }],\n messages: {\n libraryRunner:\n \"Run Effects only in a configured application entrypoint; return or compose this Effect instead.\",\n },\n },\n createOnce(context) {\n const effect = moduleBindings(\"effect/Effect\", \"Effect\");\n return {\n CallExpression(node) {\n const option = context.options?.[0];\n const allowFiles =\n typeof option === \"object\" &&\n option !== null &&\n !Array.isArray(option) &&\n Array.isArray(option.allowFiles)\n ? option.allowFiles.filter((value): value is string => typeof value === \"string\")\n : [];\n if (isAllowed(context.filename, context.cwd, allowFiles)) return;\n if (runners.some((name) => isModuleCall(context.sourceCode, node.callee, effect, name))) {\n context.report({ node: node.callee, messageId: \"libraryRunner\" });\n }\n },\n };\n },\n});\n","import { defineRule } from \"@oxlint/plugins\";\n\nimport { isModuleCall, moduleBindings } from \"./effect-call.ts\";\n\n/** Keep rejected promises in Effect's typed error channel. */\nexport const noFallibleEffectPromiseRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Require Effect.tryPromise for promise-producing operations.\" },\n messages: {\n useTryPromise:\n \"Use Effect.tryPromise and map rejection into a domain error; Effect.promise turns rejection into a defect.\",\n },\n },\n createOnce(context) {\n const effect = moduleBindings(\"effect/Effect\", \"Effect\");\n return {\n CallExpression(node) {\n if (isModuleCall(context.sourceCode, node.callee, effect, \"promise\")) {\n context.report({ node: node.callee, messageId: \"useTryPromise\" });\n }\n },\n };\n },\n});\n","import { defineRule, type ESTree, type SourceCode } from \"@oxlint/plugins\";\n\nimport { isModuleCall, moduleBindings } from \"./effect-call.ts\";\n\nconst liveConstructors = [\n \"effect\",\n \"effectContext\",\n \"effectDiscard\",\n \"sync\",\n \"syncContext\",\n \"unwrap\",\n] as const;\n\nfunction unwrapExpression(expression: ESTree.Expression): ESTree.Expression {\n let current = expression;\n while (\n current.type === \"ParenthesizedExpression\" ||\n current.type === \"TSAsExpression\" ||\n current.type === \"TSSatisfiesExpression\" ||\n current.type === \"TSTypeAssertion\" ||\n current.type === \"TSNonNullExpression\"\n ) {\n current = current.expression;\n }\n return current;\n}\n\nfunction isInlineLayer(\n sourceCode: SourceCode,\n argument: ESTree.CallExpression[\"arguments\"][number] | undefined,\n layer: ReturnType<typeof moduleBindings>,\n): boolean {\n if (argument === undefined || argument.type === \"SpreadElement\") return false;\n const current = unwrapExpression(argument);\n if (current.type !== \"CallExpression\") return false;\n if (liveConstructors.some((name) => isModuleCall(sourceCode, current.callee, layer, name))) {\n return true;\n }\n if (current.arguments.some((child) => isInlineLayer(sourceCode, child, layer))) {\n return true;\n }\n const callee = current.callee;\n return (\n callee.type === \"MemberExpression\" &&\n callee.object.type !== \"Super\" &&\n isInlineLayer(sourceCode, callee.object, layer)\n );\n}\n\n/** Keep live Layer construction at stable module composition boundaries. */\nexport const noInlineLiveLayerRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Disallow constructing live Layers inside Effect.provide calls.\" },\n messages: {\n extractLayer:\n \"Extract this live Layer to a module-level binding and provide it at the application boundary.\",\n },\n },\n createOnce(context) {\n const effect = moduleBindings(\"effect/Effect\", \"Effect\");\n const layer = moduleBindings(\"effect/Layer\", \"Layer\");\n return {\n CallExpression(node) {\n if (!isModuleCall(context.sourceCode, node.callee, effect, \"provide\")) return;\n if (node.arguments.some((argument) => isInlineLayer(context.sourceCode, argument, layer))) {\n context.report({ node, messageId: \"extractLayer\" });\n }\n },\n };\n },\n});\n","import { defineRule, type ESTree, type SourceCode } from \"@oxlint/plugins\";\n\nimport { isGlobalIdentifier } from \"./effect-call.ts\";\n\nconst collections = new Set([\"Map\", \"Set\", \"WeakMap\", \"WeakSet\"]);\n\nfunction isModuleDeclaration(node: ESTree.VariableDeclaration): boolean {\n return (\n node.parent.type === \"Program\" ||\n (node.parent.type === \"ExportNamedDeclaration\" && node.parent.parent.type === \"Program\")\n );\n}\n\nfunction hasReadonlyContract(declarator: ESTree.VariableDeclarator, collection: string): boolean {\n const annotation = declarator.id.typeAnnotation?.typeAnnotation;\n return (\n (collection === \"Map\" || collection === \"Set\") &&\n annotation?.type === \"TSTypeReference\" &&\n annotation.typeName.type === \"Identifier\" &&\n annotation.typeName.name === \"Readonly\" + collection\n );\n}\n\nfunction globalCollection(sourceCode: SourceCode, node: ESTree.NewExpression): string | null {\n const callee = node.callee;\n if (callee.type === \"Identifier\") {\n return collections.has(callee.name) && isGlobalIdentifier(sourceCode, callee, callee.name)\n ? callee.name\n : null;\n }\n if (\n callee.type !== \"MemberExpression\" ||\n callee.object.type !== \"Identifier\" ||\n !isGlobalIdentifier(sourceCode, callee.object, \"globalThis\")\n )\n return null;\n const property = callee.property;\n const name =\n !callee.computed && property.type === \"Identifier\"\n ? property.name\n : property.type === \"Literal\" && typeof property.value === \"string\"\n ? property.value\n : null;\n return name !== null && collections.has(name) ? name : null;\n}\n\nfunction unwrap(node: ESTree.Expression): ESTree.Expression {\n let current = node;\n while (\n current.type === \"ParenthesizedExpression\" ||\n current.type === \"TSSatisfiesExpression\" ||\n current.type === \"TSAsExpression\" ||\n current.type === \"TSTypeAssertion\"\n )\n current = current.expression;\n return current;\n}\n\n/** Allocate service state during construction, allowing explicitly readonly lookup collections. */\nexport const noModuleLevelMutableStateRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow module-level mutable bindings and writable collection construction.\",\n },\n messages: {\n mutableBinding:\n \"Allocate mutable state inside make so its lifetime belongs to the constructed service.\",\n mutableCollection:\n \"Allocate this collection inside make. For an immutable lookup table, expose a ReadonlyMap or ReadonlySet contract.\",\n },\n },\n createOnce(context) {\n return {\n VariableDeclaration(node) {\n if (!isModuleDeclaration(node) || node.declare) return;\n if (node.kind === \"let\" || node.kind === \"var\") {\n context.report({ node, messageId: \"mutableBinding\" });\n return;\n }\n for (const declarator of node.declarations) {\n if (declarator.init === null) continue;\n const value = unwrap(declarator.init);\n if (value.type !== \"NewExpression\") continue;\n const collection = globalCollection(context.sourceCode, value);\n if (collection === null || hasReadonlyContract(declarator, collection)) continue;\n context.report({ node: value, messageId: \"mutableCollection\" });\n }\n },\n };\n },\n});\n","import { defineRule } from \"@oxlint/plugins\";\n\nimport { isModuleCall, moduleBindings } from \"./effect-call.ts\";\n\n/** Keep background fibers attached to an explicit lifetime. */\nexport const noUnscopedForkRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Require forkScoped or forkIn for background Effect fibers.\" },\n messages: {\n scopedFork:\n \"Use Effect.forkScoped or Effect.forkIn so the background fiber has an explicit lifetime.\",\n },\n },\n createOnce(context) {\n const effect = moduleBindings(\"effect/Effect\", \"Effect\");\n return {\n CallExpression(node) {\n if (isModuleCall(context.sourceCode, node.callee, effect, \"forkDetach\")) {\n context.report({ node: node.callee, messageId: \"scopedFork\" });\n }\n },\n };\n },\n});\n","import { defineRule, type ESTree, type SourceCode } from \"@oxlint/plugins\";\n\nimport { isGlobalIdentifier, isModuleCall, moduleBindings } from \"./effect-call.ts\";\n\nconst builtInErrors = new Set([\n \"AggregateError\",\n \"Error\",\n \"EvalError\",\n \"RangeError\",\n \"ReferenceError\",\n \"SyntaxError\",\n \"TypeError\",\n \"URIError\",\n]);\n\nfunction unwrap(\n node: ESTree.CallExpression[\"arguments\"][number] | undefined,\n): Exclude<ESTree.CallExpression[\"arguments\"][number], ESTree.SpreadElement> | undefined {\n if (node === undefined || node.type === \"SpreadElement\") return undefined;\n let current = node;\n while (\n current.type === \"ParenthesizedExpression\" ||\n current.type === \"TSAsExpression\" ||\n current.type === \"TSSatisfiesExpression\" ||\n current.type === \"TSTypeAssertion\" ||\n current.type === \"TSNonNullExpression\"\n ) {\n current = current.expression;\n }\n return current;\n}\n\nfunction memberName(node: ESTree.MemberExpression): string | null {\n if (!node.computed && node.property.type === \"Identifier\") return node.property.name;\n return node.computed &&\n node.property.type === \"Literal\" &&\n typeof node.property.value === \"string\"\n ? node.property.value\n : null;\n}\n\nfunction isGlobalBuiltInError(sourceCode: SourceCode, callee: ESTree.Expression): boolean {\n if (callee.type === \"Identifier\") {\n return builtInErrors.has(callee.name) && isGlobalIdentifier(sourceCode, callee, callee.name);\n }\n if (\n callee.type !== \"MemberExpression\" ||\n callee.object.type !== \"Identifier\" ||\n !isGlobalIdentifier(sourceCode, callee.object, \"globalThis\")\n ) {\n return false;\n }\n const name = memberName(callee);\n return name !== null && builtInErrors.has(name);\n}\n\nfunction isUntypedError(\n sourceCode: SourceCode,\n node: ESTree.CallExpression[\"arguments\"][number] | undefined,\n): boolean {\n const argument = unwrap(node);\n if (argument === undefined) return false;\n if (\n argument.type === \"Literal\" ||\n argument.type === \"TemplateLiteral\" ||\n argument.type === \"ObjectExpression\" ||\n (argument.type === \"Identifier\" && isGlobalIdentifier(sourceCode, argument, \"undefined\")) ||\n (argument.type === \"UnaryExpression\" && argument.operator === \"void\")\n ) {\n return true;\n }\n if (argument.type !== \"NewExpression\" && argument.type !== \"CallExpression\") return false;\n const callee = argument.callee;\n return (\n callee.type !== \"Super\" &&\n callee.type !== \"V8IntrinsicExpression\" &&\n isGlobalBuiltInError(sourceCode, callee)\n );\n}\n\n/** Keep expected failures in explicit domain error types. */\nexport const noUntypedEffectErrorsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Reject untyped values and built-in errors in Effect.fail.\" },\n messages: {\n domainError:\n \"Fail with a tagged domain error (for example Schema.TaggedError), not a primitive or built-in Error.\",\n },\n },\n createOnce(context) {\n const effect = moduleBindings(\"effect/Effect\", \"Effect\");\n return {\n CallExpression(node) {\n if (\n isModuleCall(context.sourceCode, node.callee, effect, \"fail\") &&\n isUntypedError(context.sourceCode, node.arguments[0])\n ) {\n context.report({ node, messageId: \"domainError\" });\n }\n },\n };\n },\n});\n","import {\n defineRule,\n type ESTree,\n type Scope,\n type SourceCode,\n type Variable,\n} from \"@oxlint/plugins\";\n\ninterface Replacement {\n readonly effect: string;\n readonly provider: string;\n}\n\nconst moduleReplacements = new Map<string, Replacement>([\n [\n \"fs\",\n {\n effect: \"FileSystem.FileSystem\",\n provider: \"NodeFileSystem.layer (or NodeServices.layer)\",\n },\n ],\n [\n \"fs/promises\",\n {\n effect: \"FileSystem.FileSystem\",\n provider: \"NodeFileSystem.layer (or NodeServices.layer)\",\n },\n ],\n [\"path\", { effect: \"Path.Path\", provider: \"NodePath.layer (or NodeServices.layer)\" }],\n [\n \"child_process\",\n {\n effect: \"ChildProcess commands and ChildProcessSpawner.ChildProcessSpawner\",\n provider: \"NodeChildProcessSpawner.layer (or NodeServices.layer)\",\n },\n ],\n]);\n\nconst cryptoReplacements = new Map<string, Replacement>([\n [\n \"randomUUID\",\n { effect: \"Crypto.Crypto.randomUUIDv4\", provider: \"NodeCrypto.layer (or NodeServices.layer)\" },\n ],\n [\n \"randomUUIDv7\",\n { effect: \"Crypto.Crypto.randomUUIDv7\", provider: \"NodeCrypto.layer (or NodeServices.layer)\" },\n ],\n [\n \"randomBytes\",\n { effect: \"Crypto.Crypto.randomBytes\", provider: \"NodeCrypto.layer (or NodeServices.layer)\" },\n ],\n [\n \"randomInt\",\n {\n effect: \"Crypto.Crypto.randomIntBetween\",\n provider: \"NodeCrypto.layer (or NodeServices.layer)\",\n },\n ],\n [\n \"createHash\",\n { effect: \"Crypto.Crypto.digest\", provider: \"NodeCrypto.layer (or NodeServices.layer)\" },\n ],\n [\n \"hash\",\n { effect: \"Crypto.Crypto.digest\", provider: \"NodeCrypto.layer (or NodeServices.layer)\" },\n ],\n [\n \"subtle.digest\",\n { effect: \"Crypto.Crypto.digest\", provider: \"NodeCrypto.layer (or NodeServices.layer)\" },\n ],\n [\n \"webcrypto.subtle.digest\",\n { effect: \"Crypto.Crypto.digest\", provider: \"NodeCrypto.layer (or NodeServices.layer)\" },\n ],\n]);\n\nconst urlReplacements = new Map<string, Replacement>([\n [\n \"fileURLToPath\",\n { effect: \"Path.Path.fromFileUrl\", provider: \"NodePath.layer (or NodeServices.layer)\" },\n ],\n [\n \"pathToFileURL\",\n { effect: \"Path.Path.toFileUrl\", provider: \"NodePath.layer (or NodeServices.layer)\" },\n ],\n]);\n\nconst consoleMethods = [\n \"assert\",\n \"clear\",\n \"count\",\n \"countReset\",\n \"debug\",\n \"dir\",\n \"dirxml\",\n \"error\",\n \"group\",\n \"groupCollapsed\",\n \"groupEnd\",\n \"info\",\n \"log\",\n \"table\",\n \"time\",\n \"timeEnd\",\n \"timeLog\",\n \"trace\",\n \"warn\",\n] as const;\nconst consoleReplacements = new Map<string, Replacement>(\n consoleMethods.map((method) => [\n method,\n {\n effect: `Console.Console.${method}`,\n provider: \"the runtime-provided Console.Console service\",\n },\n ]),\n);\n\nconst processReplacements = new Map<string, Replacement>([\n [\"argv\", { effect: \"Stdio.Stdio.args\", provider: \"NodeStdio.layer (or NodeServices.layer)\" }],\n [\"stdin\", { effect: \"Stdio.Stdio.stdin\", provider: \"NodeStdio.layer (or NodeServices.layer)\" }],\n [\"stdout\", { effect: \"Stdio.Stdio.stdout\", provider: \"NodeStdio.layer (or NodeServices.layer)\" }],\n [\"stderr\", { effect: \"Stdio.Stdio.stderr\", provider: \"NodeStdio.layer (or NodeServices.layer)\" }],\n [\n \"hrtime\",\n {\n effect: \"Clock.Clock.monotonicTimeNanos\",\n provider: \"the runtime-provided Clock.Clock service\",\n },\n ],\n]);\n\nconst timerReplacements = new Map<string, Replacement>([\n [\"setTimeout\", { effect: \"Effect.sleep\", provider: \"the runtime-provided Clock.Clock service\" }],\n [\n \"setInterval\",\n {\n effect: \"Effect.repeat or Stream.fromEffectSchedule\",\n provider: \"the runtime-provided Clock.Clock service\",\n },\n ],\n]);\n\nconst httpReplacements = new Map<string, Replacement>([\n [\n \"get\",\n {\n effect: \"HttpClient.get through HttpClient.HttpClient\",\n provider: \"NodeHttpClient.layerUndici or NodeHttpClient.layerNodeHttp\",\n },\n ],\n [\n \"request\",\n {\n effect: \"HttpClient.execute through HttpClient.HttpClient\",\n provider: \"NodeHttpClient.layerUndici or NodeHttpClient.layerNodeHttp\",\n },\n ],\n [\n \"createServer\",\n {\n effect: \"HttpServer.HttpServer for server behavior\",\n provider: \"NodeHttpServer.layer or NodeHttpServer.layerConfig\",\n },\n ],\n]);\n\nconst netReplacements = new Map<string, Replacement>([\n [\"connect\", { effect: \"Socket.Socket\", provider: \"NodeSocket.makeNet or NodeSocket.layerNet\" }],\n [\n \"createConnection\",\n { effect: \"Socket.Socket\", provider: \"NodeSocket.makeNet or NodeSocket.layerNet\" },\n ],\n [\"createServer\", { effect: \"SocketServer.SocketServer\", provider: \"NodeSocketServer.layer\" }],\n]);\n\nconst performanceReplacements = new Map<string, Replacement>([\n [\n \"performance.now\",\n {\n effect: \"Clock.Clock.monotonicTimeNanos\",\n provider: \"the runtime-provided Clock.Clock service\",\n },\n ],\n]);\n\nconst symbolReplacements = new Map<string, ReadonlyMap<string, Replacement>>([\n [\"console\", consoleReplacements],\n [\"crypto\", cryptoReplacements],\n [\"http\", httpReplacements],\n [\"https\", httpReplacements],\n [\"net\", netReplacements],\n [\"perf_hooks\", performanceReplacements],\n [\"process\", processReplacements],\n [\"timers\", timerReplacements],\n [\"timers/promises\", timerReplacements],\n [\"url\", urlReplacements],\n]);\n\nfunction builtinName(source: string): string {\n return source.startsWith(\"node:\") ? source.slice(5) : source;\n}\n\nfunction importedName(specifier: ESTree.ImportSpecifier): string {\n return specifier.imported.type === \"Identifier\"\n ? specifier.imported.name\n : specifier.imported.value;\n}\n\nfunction isValueSpecifier(\n declaration: ESTree.ImportDeclaration,\n specifier: ESTree.ImportDeclaration[\"specifiers\"][number],\n): boolean {\n return (\n declaration.importKind !== \"type\" &&\n (specifier.type !== \"ImportSpecifier\" || specifier.importKind !== \"type\")\n );\n}\n\nfunction hasValueImport(node: ESTree.ImportDeclaration): boolean {\n return (\n node.importKind !== \"type\" &&\n (node.specifiers.length === 0 ||\n node.specifiers.some((specifier) => isValueSpecifier(node, specifier)))\n );\n}\n\nfunction resolveVariable(sourceCode: SourceCode, identifier: ESTree.Node): Variable | null {\n if (identifier.type !== \"Identifier\") return null;\n let scope: Scope | null = sourceCode.getScope(identifier);\n while (scope !== null) {\n const variable = scope.set.get(identifier.name);\n if (variable !== undefined) return variable;\n scope = scope.upper;\n }\n return null;\n}\n\ninterface ImportBinding {\n readonly imported: string | null;\n readonly source: string;\n}\n\nfunction importBinding(sourceCode: SourceCode, identifier: ESTree.Node): ImportBinding | null {\n const variable = resolveVariable(sourceCode, identifier);\n for (const definition of variable?.defs ?? []) {\n if (definition.type !== \"ImportBinding\" || definition.parent?.type !== \"ImportDeclaration\")\n continue;\n const specifier = definition.node;\n if (\n specifier.type !== \"ImportSpecifier\" &&\n specifier.type !== \"ImportDefaultSpecifier\" &&\n specifier.type !== \"ImportNamespaceSpecifier\"\n )\n continue;\n if (definition.parent.importKind === \"type\" || !isValueSpecifier(definition.parent, specifier))\n continue;\n if (specifier.type === \"ImportNamespaceSpecifier\") {\n return { imported: null, source: definition.parent.source.value };\n }\n if (specifier.type === \"ImportDefaultSpecifier\") {\n return { imported: \"default\", source: definition.parent.source.value };\n }\n return { imported: importedName(specifier), source: definition.parent.source.value };\n }\n return null;\n}\n\nfunction propertyName(node: ESTree.MemberExpression): string | null {\n if (!node.computed && node.property.type === \"Identifier\") return node.property.name;\n return node.property.type === \"Literal\" && typeof node.property.value === \"string\"\n ? node.property.value\n : null;\n}\n\ninterface ImportedMember {\n readonly source: string;\n readonly symbol: string;\n}\n\nfunction importedMember(\n sourceCode: SourceCode,\n node: ESTree.MemberExpression,\n): ImportedMember | null {\n const path: string[] = [];\n let current: ESTree.Expression = node;\n while (current.type === \"MemberExpression\") {\n const name = propertyName(current);\n if (name === null) return null;\n path.unshift(name);\n current = current.object;\n }\n if (current.type !== \"Identifier\") return null;\n const binding = importBinding(sourceCode, current);\n if (binding === null) return null;\n if (binding.imported !== null && binding.imported !== \"default\") {\n path.unshift(binding.imported);\n }\n return { source: binding.source, symbol: path.join(\".\") };\n}\n\nfunction isNodeHttpServerLayerCall(sourceCode: SourceCode, node: ESTree.CallExpression): boolean {\n const callee = node.callee;\n if (callee.type === \"Identifier\") {\n const binding = importBinding(sourceCode, callee);\n return (\n binding !== null &&\n binding.source === \"@effect/platform-node/NodeHttpServer\" &&\n (binding.imported === \"layer\" || binding.imported === \"layerConfig\")\n );\n }\n if (callee.type !== \"MemberExpression\" || callee.object.type !== \"Identifier\") return false;\n const name = propertyName(callee);\n if (name !== \"layer\" && name !== \"layerConfig\") return false;\n const binding = importBinding(sourceCode, callee.object);\n return (\n binding !== null &&\n ((binding.source === \"@effect/platform-node\" && binding.imported === \"NodeHttpServer\") ||\n (binding.source === \"@effect/platform-node/NodeHttpServer\" &&\n (binding.imported === null || binding.imported === \"default\")))\n );\n}\n\nfunction isNodeHttpServerAdapterArgument(sourceCode: SourceCode, node: ESTree.Node): boolean {\n let current = node;\n while (current.parent !== null && current.parent.type !== \"Program\") {\n const parent = current.parent;\n if (\n parent.type === \"CallExpression\" &&\n parent.arguments[0] === current &&\n isNodeHttpServerLayerCall(sourceCode, parent)\n )\n return true;\n current = parent;\n }\n return false;\n}\n\nfunction isHttpCreateServer(source: string, symbol: string): boolean {\n const module = builtinName(source);\n return (module === \"http\" || module === \"https\") && symbol === \"createServer\";\n}\n\n/** Keep platform I/O replaceable through Effect services. */\nexport const preferEffectPlatformServicesRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Prefer Effect platform services over direct Node platform APIs.\" },\n messages: {\n platformService:\n \"Use {{effect}} (provided by {{provider}}) instead of {{api}} so platform behavior remains typed and replaceable.\",\n },\n },\n createOnce(context) {\n const report = (\n node: ESTree.Node,\n source: string,\n symbol: string | null,\n replacement: Replacement,\n ) => {\n const api = symbol === null ? `the ${source} module` : `${source}.${symbol}`;\n context.report({\n node,\n messageId: \"platformService\",\n data: { api, effect: replacement.effect, provider: replacement.provider },\n });\n };\n\n return {\n ImportDeclaration(node) {\n const module = builtinName(node.source.value);\n const moduleReplacement = moduleReplacements.get(module);\n if (moduleReplacement !== undefined && hasValueImport(node)) {\n report(node.source, node.source.value, null, moduleReplacement);\n return;\n }\n\n const replacements = symbolReplacements.get(module);\n if (replacements === undefined || node.importKind === \"type\") return;\n for (const specifier of node.specifiers) {\n if (specifier.type !== \"ImportSpecifier\" || !isValueSpecifier(node, specifier)) continue;\n const symbol = importedName(specifier);\n const replacement = replacements.get(symbol);\n if (\n replacement === undefined ||\n symbol === \"default\" ||\n isHttpCreateServer(node.source.value, symbol)\n )\n continue;\n report(specifier, node.source.value, symbol, replacement);\n }\n },\n MemberExpression(node) {\n const member = importedMember(context.sourceCode, node);\n if (member === null) return;\n const replacement = symbolReplacements.get(builtinName(member.source))?.get(member.symbol);\n if (\n replacement === undefined ||\n (isHttpCreateServer(member.source, member.symbol) &&\n isNodeHttpServerAdapterArgument(context.sourceCode, node))\n )\n return;\n report(node, member.source, member.symbol, replacement);\n },\n Identifier(node) {\n if (\n node.parent.type === \"ImportSpecifier\" ||\n node.parent.type === \"ImportDefaultSpecifier\" ||\n node.parent.type === \"ImportNamespaceSpecifier\"\n )\n return;\n const binding = importBinding(context.sourceCode, node);\n if (\n binding === null ||\n binding.imported === null ||\n !isHttpCreateServer(binding.source, binding.imported) ||\n isNodeHttpServerAdapterArgument(context.sourceCode, node)\n )\n return;\n const replacement = symbolReplacements\n .get(builtinName(binding.source))\n ?.get(binding.imported);\n if (replacement !== undefined) report(node, binding.source, binding.imported, replacement);\n },\n };\n },\n});\n","import { defineRule, type ESTree, type SourceCode } from \"@oxlint/plugins\";\n\nimport { isGlobalIdentifier, isModuleCall, moduleBindings } from \"./effect-call.ts\";\n\nfunction isUndefined(\n sourceCode: SourceCode,\n node: ESTree.CallExpression[\"arguments\"][number] | undefined,\n): boolean {\n if (node === undefined || node.type === \"SpreadElement\") return false;\n if (node.type === \"Identifier\") return isGlobalIdentifier(sourceCode, node, \"undefined\");\n return (\n node.type === \"UnaryExpression\" &&\n node.operator === \"void\" &&\n node.argument.type === \"Literal\" &&\n node.argument.value === 0\n );\n}\n\n/** Use the canonical Effect value for successful void results. */\nexport const preferEffectVoidRule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: { description: \"Prefer Effect.void over Effect.succeed(undefined).\" },\n messages: { preferVoid: \"Use Effect.void for an Effect that succeeds with undefined.\" },\n },\n createOnce(context) {\n const effect = moduleBindings(\"effect/Effect\", \"Effect\");\n return {\n CallExpression(node) {\n if (\n isModuleCall(context.sourceCode, node.callee, effect, \"succeed\") &&\n isUndefined(context.sourceCode, node.arguments[0])\n ) {\n context.report({ node, messageId: \"preferVoid\" });\n }\n },\n };\n },\n});\n","import { defineRule, type ESTree } from \"@oxlint/plugins\";\n\nimport { isModuleCall, moduleBindings } from \"./effect-call.ts\";\n\nfunction staticName(\n argument: ESTree.CallExpression[\"arguments\"][number] | undefined,\n): string | null {\n if (argument === undefined || argument.type === \"SpreadElement\") return null;\n while (\n argument.type === \"ParenthesizedExpression\" ||\n argument.type === \"TSSatisfiesExpression\" ||\n argument.type === \"TSAsExpression\" ||\n argument.type === \"TSTypeAssertion\"\n )\n argument = argument.expression;\n if (argument.type === \"Literal\") {\n return typeof argument.value === \"string\" ? argument.value : null;\n }\n if (argument.type === \"TemplateLiteral\" && argument.expressions.length === 0) {\n return argument.quasis[0]?.value.cooked ?? argument.quasis[0]?.value.raw ?? \"\";\n }\n return null;\n}\n\nfunction propertyName(key: ESTree.PropertyKey): string | null {\n if (key.type === \"Identifier\" || key.type === \"PrivateIdentifier\") return key.name;\n return key.type === \"Literal\" && typeof key.value === \"string\" ? key.value : null;\n}\n\nfunction ownerName(node: ESTree.CallExpression): string | null {\n let current: ESTree.Node = node;\n while (current.parent.type === \"CallExpression\" && current.parent.callee === current) {\n current = current.parent;\n }\n\n const owner = current.parent;\n if (owner.type === \"VariableDeclarator\" && owner.id.type === \"Identifier\") {\n return owner.id.name;\n }\n if (\n (owner.type === \"Property\" ||\n owner.type === \"PropertyDefinition\" ||\n owner.type === \"AccessorProperty\") &&\n owner.value === current\n ) {\n return propertyName(owner.key);\n }\n return null;\n}\n\nfunction nameMatchesOwner(name: string, owner: string): boolean {\n return name === owner || name.endsWith(\".\" + owner) || name.endsWith(\"/\" + owner);\n}\n\n/** Require traced Effect functions to carry a stable operation name. */\nexport const requireEffectFnNameRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Require every Effect.fn call to provide a static operation name.\",\n },\n messages: {\n missingName:\n \"Give this Effect.fn a static operation name so traces and diagnostics identify the workflow.\",\n mismatchedName:\n 'Effect.fn name \"{{name}}\" must match its owning symbol \"{{owner}}\" or end with \".{{owner}}\" or \"/{{owner}}\".',\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n const callee = node.callee;\n if (\n !isModuleCall(context.sourceCode, callee, moduleBindings(\"effect/Effect\", \"Effect\"), \"fn\")\n )\n return;\n const name = staticName(node.arguments[0]);\n if (name === null) {\n context.report({ node: callee, messageId: \"missingName\" });\n return;\n }\n const owner = ownerName(node);\n if (owner !== null && !nameMatchesOwner(name, owner)) {\n context.report({\n node: node.arguments[0] ?? callee,\n messageId: \"mismatchedName\",\n data: { name, owner },\n });\n }\n },\n };\n },\n});\n","import { defineRule, type ESTree } from \"@oxlint/plugins\";\n\nimport { isModuleCall, moduleBindings } from \"./effect-call.ts\";\n\nfunction staticString(\n argument: ESTree.CallExpression[\"arguments\"][number] | undefined,\n): string | null {\n if (argument === undefined || argument.type === \"SpreadElement\") return null;\n let current = argument;\n while (\n current.type === \"ParenthesizedExpression\" ||\n current.type === \"TSSatisfiesExpression\" ||\n current.type === \"TSAsExpression\" ||\n current.type === \"TSTypeAssertion\"\n ) {\n current = current.expression;\n }\n if (current.type === \"Literal\") return typeof current.value === \"string\" ? current.value : null;\n if (current.type === \"TemplateLiteral\" && current.expressions.length === 0)\n return current.quasis[0]?.value.cooked ?? null;\n return null;\n}\n\n// Only APIs that name spans belong here. Data tags and metric names have separate contracts.\nconst directNames = [\n [\"Effect\", \"fn\"],\n [\"Effect\", \"makeSpan\"],\n [\"Effect\", \"makeSpanScoped\"],\n [\"Effect\", \"useSpan\"],\n [\"Layer\", \"span\"],\n] as const;\nconst dualNames = [\n [\"Effect\", \"withSpan\"],\n [\"Effect\", \"withSpanScoped\"],\n [\"Effect\", \"withLogSpan\"],\n [\"Channel\", \"withSpan\"],\n [\"RequestResolver\", \"withSpan\"],\n [\"Stream\", \"withSpan\"],\n [\"Layer\", \"withSpan\"],\n] as const;\n\n/** Require readable, repository-owned names for traced Effect operations. */\nexport const requireEffectNamespaceRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Require static Effect trace names in @project/Domain.operation form.\" },\n schema: [\n {\n type: \"object\",\n properties: { prefix: { type: \"string\", minLength: 1 } },\n required: [\"prefix\"],\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ prefix: \"@\" }],\n messages: {\n invalidFormat:\n '{{api}} trace name \"{{key}}\" must use \"{{prefix}}Domain.operation\" with PascalCase domain segments and a camelCase operation.',\n\n staticKey: \"Give {{api}} a static trace name inside the repository namespace.\",\n wrongPrefix:\n '{{api}} trace name \"{{key}}\" must begin with the owned prefix \"{{prefix}}\" and include a name.',\n },\n },\n createOnce(context) {\n const check = (node: ESTree.CallExpression, index: number, api: string) => {\n const argument = node.arguments[index];\n const key = staticString(argument);\n if (key === null) {\n context.report({ node: argument ?? node, messageId: \"staticKey\", data: { api } });\n return;\n }\n const option = context.options[0];\n const prefix =\n typeof option === \"object\" &&\n option !== null &&\n !Array.isArray(option) &&\n typeof option.prefix === \"string\"\n ? option.prefix\n : \"@\";\n if (key.startsWith(prefix) && key.length > prefix.length) {\n if (/^(?:[A-Z][A-Za-z0-9]*\\.)+[a-z][A-Za-z0-9]*$/u.test(key.slice(prefix.length))) return;\n context.report({\n node: argument ?? node,\n messageId: \"invalidFormat\",\n data: { api, key, prefix },\n });\n return;\n }\n context.report({\n node: argument ?? node,\n messageId: \"wrongPrefix\",\n data: { api, key, prefix },\n });\n };\n return {\n CallExpression(node) {\n const matches = (callee: ESTree.CallExpression[\"callee\"], module: string, name: string) =>\n isModuleCall(\n context.sourceCode,\n callee,\n moduleBindings(\"effect/\" + module, module),\n name,\n );\n for (const [module, name] of directNames) {\n if (matches(node.callee, module, name)) {\n check(node, 0, module + \".\" + name);\n return;\n }\n }\n for (const [module, name] of dualNames) {\n if (matches(node.callee, module, name)) {\n const index =\n staticString(node.arguments[0]) !== null\n ? 0\n : staticString(node.arguments[1]) !== null || node.arguments.length >= 3\n ? 1\n : 0;\n check(node, index, module + \".\" + name);\n return;\n }\n }\n },\n };\n },\n});\n","import { defineRule, type ESTree, type SourceCode } from \"@oxlint/plugins\";\n\nimport { isGlobalIdentifier, isModuleCall, moduleBindings } from \"./effect-call.ts\";\n\ntype Callback = ESTree.ArrowFunctionExpression | ESTree.Function;\ntype ObjectProperty = Extract<ESTree.ObjectExpression[\"properties\"][number], { type: \"Property\" }>;\n\nfunction propertyName(node: ObjectProperty | ESTree.MemberExpression): string | null {\n const key = node.type === \"Property\" ? node.key : node.property;\n if (!node.computed && key.type === \"Identifier\") return key.name;\n return key.type === \"Literal\" && typeof key.value === \"string\" ? key.value : null;\n}\n\nfunction isFetch(sourceCode: SourceCode, callee: ESTree.CallExpression[\"callee\"]): boolean {\n if (callee.type === \"Identifier\") return isGlobalIdentifier(sourceCode, callee, \"fetch\");\n return (\n callee.type === \"MemberExpression\" &&\n callee.object.type === \"Identifier\" &&\n isGlobalIdentifier(sourceCode, callee.object, \"globalThis\") &&\n propertyName(callee) === \"fetch\"\n );\n}\n\nfunction tryPromiseCallback(sourceCode: SourceCode, node: ESTree.Node): Callback | null {\n let current = node.parent;\n while (current !== null && current.type !== \"Program\") {\n if (current.type === \"FunctionDeclaration\") return null;\n if (current.type === \"ArrowFunctionExpression\" || current.type === \"FunctionExpression\") {\n let owner: ESTree.Node = current;\n if (\n owner.parent.type === \"Property\" &&\n owner.parent.value === owner &&\n propertyName(owner.parent) === \"try\" &&\n owner.parent.parent.type === \"ObjectExpression\"\n ) {\n owner = owner.parent.parent;\n }\n const parent = owner.parent;\n return parent.type === \"CallExpression\" &&\n parent.arguments[0] === owner &&\n isModuleCall(\n sourceCode,\n parent.callee,\n moduleBindings(\"effect/Effect\", \"Effect\"),\n \"tryPromise\",\n )\n ? current\n : null;\n }\n current = current.parent;\n }\n return null;\n}\n\nfunction isCallbackSignal(\n sourceCode: SourceCode,\n value: ESTree.Expression,\n callback: Callback,\n): boolean {\n const parameter = callback.params[0];\n if (parameter?.type !== \"Identifier\" || value.type !== \"Identifier\") return false;\n let scope = sourceCode.getScope(value);\n while (true) {\n const variable = scope.set.get(value.name);\n if (variable !== undefined) {\n return variable.defs.some(\n (definition) => definition.type === \"Parameter\" && definition.name === parameter,\n );\n }\n if (scope.upper === null) return false;\n scope = scope.upper;\n }\n}\n\nfunction forwardsSignal(\n sourceCode: SourceCode,\n options: ESTree.CallExpression[\"arguments\"][number] | undefined,\n callback: Callback,\n): boolean {\n if (options?.type !== \"ObjectExpression\") return false;\n // Later properties/spreads can overwrite a previously forwarded signal.\n for (let index = options.properties.length - 1; index >= 0; index--) {\n const property = options.properties[index];\n if (property === undefined || property.type === \"SpreadElement\") return false;\n const name = propertyName(property);\n if (name === null) return false;\n if (name === \"signal\") return isCallbackSignal(sourceCode, property.value, callback);\n }\n return false;\n}\n\n/** Forward Effect interruption to global fetch at a direct Promise adapter boundary. */\nexport const requireFetchAbortSignalRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Require global fetch in Effect.tryPromise callbacks to forward their AbortSignal.\",\n },\n messages: {\n missingSignal:\n \"Forward the Effect.tryPromise callback's signal with fetch(url, { ...options, signal }) so interruption cancels the request.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (!isFetch(context.sourceCode, node.callee)) return;\n const callback = tryPromiseCallback(context.sourceCode, node);\n if (callback === null || forwardsSignal(context.sourceCode, node.arguments[1], callback))\n return;\n context.report({ node, messageId: \"missingSignal\" });\n },\n };\n },\n});\n","import { defineRule, type ESTree, type Variable } from \"@oxlint/plugins\";\n\nimport { isModuleCall, isModuleType, moduleBindings } from \"./effect-call.ts\";\n\ntype Kind = \"layer\" | \"make\";\ntype Factory = ESTree.Function | ESTree.ArrowFunctionExpression;\ntype Identifier = Extract<ESTree.Node, { type: \"Identifier\" }>;\n\nconst layerMethods = [\n \"effect\",\n \"effectContext\",\n \"effectDiscard\",\n \"succeed\",\n \"succeedContext\",\n \"sync\",\n \"syncContext\",\n \"unwrap\",\n \"suspend\",\n \"merge\",\n \"mergeAll\",\n \"fresh\",\n \"orDie\",\n] as const;\n\nconst layerCombinators = [\"provide\", \"provideMerge\", \"catch\", \"catchCause\"] as const;\n\nfunction isFactory(node: ESTree.Node): node is Factory {\n return (\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\" ||\n node.type === \"ArrowFunctionExpression\"\n );\n}\n\nfunction unwrap(node: ESTree.Expression): ESTree.Expression {\n let current = node;\n while (\n current.type === \"ParenthesizedExpression\" ||\n current.type === \"TSSatisfiesExpression\" ||\n current.type === \"TSAsExpression\" ||\n current.type === \"TSNonNullExpression\" ||\n current.type === \"TSTypeAssertion\"\n ) {\n current = current.expression;\n }\n return current;\n}\n\nfunction exportName(node: ESTree.ModuleExportName): string {\n return node.type === \"Identifier\" ? node.name : node.value;\n}\n\n/** Name public service constructors consistently without requiring paired exports. */\nexport const requireServiceConstructorNamesRule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: { description: \"Name exported Layers layer/layerX and service constructors make/makeX.\" },\n messages: {\n layer: \"Name this exported Layer or Layer factory layer or layerX (for example layerConfig).\",\n make: \"Name this exported service constructor make or makeX (for example makeMemory).\",\n },\n },\n createOnce(context) {\n const layer = moduleBindings(\"effect/Layer\", \"Layer\");\n const effect = moduleBindings(\"effect/Effect\", \"Effect\");\n const service = moduleBindings(\"effect/Context\", \"Context\");\n const services = new Set<Variable>();\n const interfaces = new Set<Variable>();\n const constructors = new Set<Variable>();\n const returns = new Map<Factory, ESTree.Expression[]>();\n const exports: Array<{ name: string; node: ESTree.Node; value: ESTree.Node }> = [];\n\n function variable(node: Identifier): Variable | undefined {\n let scope = context.sourceCode.getScope(node);\n while (true) {\n const found = scope.set.get(node.name);\n if (found !== undefined) return found;\n if (scope.upper === null) return undefined;\n scope = scope.upper;\n }\n }\n\n function hasBinding(bindings: ReadonlySet<Variable>, node: Identifier): boolean {\n const binding = variable(node);\n return binding !== undefined && bindings.has(binding);\n }\n\n function serviceCall(expression: ESTree.Expression | null): ESTree.CallExpression | null {\n if (expression === null) return null;\n const node = unwrap(expression);\n if (node.type !== \"CallExpression\") return null;\n const call = node.callee.type === \"CallExpression\" ? node.callee : node;\n return isModuleCall(context.sourceCode, call.callee, service, \"Service\") ? call : null;\n }\n\n function registerService(id: ESTree.BindingIdentifier, call: ESTree.CallExpression) {\n const binding = variable(id);\n if (binding !== undefined) services.add(binding);\n if (id.parent.type === \"ClassDeclaration\") {\n for (const declared of context.sourceCode.getDeclaredVariables(id.parent))\n services.add(declared);\n }\n const shape = call.typeArguments?.params.at(-1);\n if (shape?.type === \"TSTypeReference\" && shape.typeName.type === \"Identifier\") {\n const shapeBinding = variable(shape.typeName);\n if (shapeBinding !== undefined) interfaces.add(shapeBinding);\n }\n }\n\n function typeKind(type: ESTree.TSType | undefined): Kind | null {\n if (type?.type !== \"TSTypeReference\") return null;\n if (isModuleType(context.sourceCode, type.typeName, layer, \"Layer\")) return \"layer\";\n if (isModuleType(context.sourceCode, type.typeName, effect, \"Effect\")) {\n return typeKind(type.typeArguments?.params[0]);\n }\n return type.typeName.type === \"Identifier\" && hasBinding(interfaces, type.typeName)\n ? \"make\"\n : null;\n }\n\n function kind(node: ESTree.Node, seen = new Set<ESTree.Node>()): Kind | null {\n if (seen.has(node)) return null;\n const visited = new Set(seen).add(node);\n if (node.type === \"VariableDeclarator\") {\n return (\n (node.id.type === \"Identifier\"\n ? (typeKind(node.id.typeAnnotation?.typeAnnotation) ??\n (hasBinding(constructors, node.id) ? \"make\" : null))\n : null) ?? (node.init === null ? null : kind(node.init, visited))\n );\n }\n if (isFactory(node)) {\n return (\n typeKind(node.returnType?.typeAnnotation) ??\n (node.type !== \"ArrowFunctionExpression\" &&\n node.id !== null &&\n hasBinding(constructors, node.id)\n ? \"make\"\n : null) ??\n (node.body !== null && node.body.type !== \"BlockStatement\"\n ? kind(node.body, visited)\n : ((returns.get(node) ?? [])\n .map((value) => kind(value, visited))\n .find((value) => value !== null) ?? null))\n );\n }\n if (node.type === \"Identifier\") {\n const binding = variable(node);\n if (binding === undefined || services.has(binding)) return null;\n if (constructors.has(binding)) return \"make\";\n for (const definition of binding.defs) {\n if (definition.type !== \"ImportBinding\") {\n const result = kind(definition.node, visited);\n if (result !== null) return result;\n }\n }\n return null;\n }\n if (\n node.type === \"ParenthesizedExpression\" ||\n node.type === \"TSSatisfiesExpression\" ||\n node.type === \"TSAsExpression\" ||\n node.type === \"TSTypeAssertion\" ||\n node.type === \"TSNonNullExpression\"\n ) {\n return kind(node.expression, visited);\n }\n if (node.type === \"AwaitExpression\") return kind(node.argument, visited);\n if (node.type === \"YieldExpression\")\n return node.argument === null ? null : kind(node.argument, visited);\n if (node.type === \"ConditionalExpression\")\n return kind(node.consequent, visited) ?? kind(node.alternate, visited);\n if (\n node.type === \"MemberExpression\" &&\n isModuleCall(context.sourceCode, node, layer, \"empty\")\n )\n return \"layer\";\n if (node.type !== \"CallExpression\") return null;\n const call = node.callee.type === \"CallExpression\" ? node.callee : node;\n if (layerMethods.some((name) => isModuleCall(context.sourceCode, call.callee, layer, name)))\n return \"layer\";\n if (\n (call !== node || node.arguments.length >= 2) &&\n layerCombinators.some((name) => isModuleCall(context.sourceCode, call.callee, layer, name))\n )\n return \"layer\";\n if (\n node.callee.type === \"MemberExpression\" &&\n !node.callee.computed &&\n node.callee.property.type === \"Identifier\"\n ) {\n const receiver = node.callee.object;\n if (\n node.callee.property.name === \"of\" &&\n receiver.type === \"Identifier\" &&\n hasBinding(services, receiver)\n )\n return \"make\";\n if (node.callee.property.name === \"pipe\" && receiver.type !== \"Super\") {\n const last = node.arguments.at(-1);\n if (\n last?.type === \"CallExpression\" &&\n [\"map\", \"flatMap\", \"as\", \"asVoid\"].some((name) =>\n isModuleCall(context.sourceCode, last.callee, effect, name),\n )\n )\n return kind(last, visited);\n return kind(receiver, visited);\n }\n }\n if (\n [\"gen\", \"fn\", \"fnUntraced\", \"sync\", \"succeed\", \"map\", \"flatMap\", \"suspend\"].some((name) =>\n isModuleCall(context.sourceCode, call.callee, effect, name),\n )\n ) {\n const args = node.arguments.filter((arg) => arg.type !== \"SpreadElement\");\n const result = args.at(-1);\n return result === undefined ? null : kind(result, visited);\n }\n return node.callee.type === \"Identifier\" ? kind(node.callee, visited) : null;\n }\n\n function registerConstructor(expression: ESTree.Expression) {\n const node = unwrap(expression);\n if (node.type === \"Identifier\") {\n const binding = variable(node);\n if (binding !== undefined && binding.defs.some((def) => def.type !== \"ImportBinding\"))\n constructors.add(binding);\n } else if (node.type === \"CallExpression\" && node.callee.type === \"Identifier\") {\n registerConstructor(node.callee);\n } else if (isFactory(node)) {\n if (node.body !== null && node.body.type !== \"BlockStatement\")\n registerConstructor(node.body);\n else for (const value of returns.get(node) ?? []) registerConstructor(value);\n }\n }\n\n return {\n Program() {\n services.clear();\n interfaces.clear();\n constructors.clear();\n returns.clear();\n exports.length = 0;\n },\n ClassDeclaration(node) {\n const call = serviceCall(node.superClass);\n if (node.id !== null && call !== null) registerService(node.id, call);\n },\n VariableDeclarator(node) {\n const call = serviceCall(node.init);\n if (node.id.type === \"Identifier\" && call !== null) registerService(node.id, call);\n },\n ReturnStatement(node) {\n if (node.argument === null) return;\n let parent: ESTree.Node | null = node.parent;\n while (parent !== null && !isFactory(parent)) parent = parent.parent;\n if (parent === null) return;\n const values = returns.get(parent) ?? [];\n values.push(node.argument);\n returns.set(parent, values);\n },\n \"CallExpression:exit\"(node) {\n const call = node.callee.type === \"CallExpression\" ? node.callee : node;\n if (\n ![\"effect\", \"succeed\", \"sync\"].some((name) =>\n isModuleCall(context.sourceCode, call.callee, layer, name),\n )\n )\n return;\n const construction = node.arguments[call === node ? 1 : 0];\n if (construction !== undefined && construction.type !== \"SpreadElement\")\n registerConstructor(construction);\n },\n ExportNamedDeclaration(node) {\n if (node.exportKind === \"type\" || node.source !== null) return;\n const declaration = node.declaration;\n if (declaration?.type === \"VariableDeclaration\") {\n for (const item of declaration.declarations) {\n if (item.id.type === \"Identifier\")\n exports.push({ name: item.id.name, node: item.id, value: item });\n }\n } else if (declaration?.type === \"FunctionDeclaration\" && declaration.id !== null) {\n exports.push({ name: declaration.id.name, node: declaration.id, value: declaration });\n }\n for (const specifier of node.specifiers) {\n if (specifier.type === \"ExportSpecifier\" && specifier.exportKind !== \"type\") {\n exports.push({\n name: exportName(specifier.exported),\n node: specifier.exported,\n value: specifier.local,\n });\n }\n }\n },\n ExportDefaultDeclaration(node) {\n exports.push({ name: \"default\", node, value: node.declaration });\n },\n \"Program:exit\"() {\n for (const entry of exports) {\n const result = kind(entry.value);\n if (result === null) continue;\n const pattern =\n result === \"layer\" ? /^layer(?:[A-Z][a-zA-Z0-9]*)?$/u : /^make(?:[A-Z][a-zA-Z0-9]*)?$/u;\n if (!pattern.test(entry.name)) context.report({ node: entry.node, messageId: result });\n }\n },\n };\n },\n});\n","import { defineRule, type ESTree } from \"@oxlint/plugins\";\n\nimport { isModuleCall, moduleBindings } from \"./effect-call.ts\";\n\nfunction staticString(\n argument: ESTree.CallExpression[\"arguments\"][number] | undefined,\n): string | null {\n if (argument === undefined || argument.type === \"SpreadElement\") return null;\n let current = argument;\n while (current.type === \"ParenthesizedExpression\" || current.type === \"TSSatisfiesExpression\") {\n current = current.expression;\n }\n if (current.type === \"Literal\") {\n return typeof current.value === \"string\" ? current.value : null;\n }\n if (current.type === \"TemplateLiteral\" && current.expressions.length === 0) {\n return current.quasis[0]?.value.cooked ?? current.quasis[0]?.value.raw ?? \"\";\n }\n return null;\n}\n\n/** Keep Effect service identifiers inside the repository's owned namespace. */\nexport const requireServiceKeyPrefixRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Require Context.Service and Context.Reference keys to use a configured static prefix.\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n prefix: { type: \"string\", minLength: 1 },\n },\n required: [\"prefix\"],\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ prefix: \"@\" }],\n messages: {\n staticKey:\n \"Give this Context service/reference a static string key inside the repository namespace.\",\n wrongPrefix:\n 'Service key \"{{key}}\" must begin with the owned prefix \"{{prefix}}\" and include a name.',\n },\n },\n createOnce(context) {\n const checkKey = (\n node: ESTree.CallExpression,\n keyArgument: ESTree.CallExpression[\"arguments\"][number] | undefined,\n ) => {\n const key = staticString(keyArgument);\n if (key === null) {\n context.report({ node, messageId: \"staticKey\" });\n return;\n }\n\n const option = context.options?.[0];\n const prefix =\n typeof option === \"object\" &&\n option !== null &&\n !Array.isArray(option) &&\n typeof option.prefix === \"string\"\n ? option.prefix\n : \"@\";\n\n if (key.startsWith(prefix) && key.length > prefix.length) return;\n context.report({\n node: keyArgument ?? node,\n messageId: \"wrongPrefix\",\n data: { key, prefix },\n });\n };\n\n return {\n CallExpression(node) {\n const matches = (callee: ESTree.CallExpression[\"callee\"], name: string) =>\n isModuleCall(\n context.sourceCode,\n callee,\n moduleBindings(\"effect/Context\", \"Context\"),\n name,\n );\n if (matches(node.callee, \"Reference\")) {\n checkKey(node, node.arguments[0]);\n return;\n }\n if (\n node.callee.type === \"CallExpression\" &&\n matches(node.callee.callee, \"Service\") &&\n node.callee.arguments.length === 0\n ) {\n checkKey(node, node.arguments[0]);\n return;\n }\n if (!matches(node.callee, \"Service\")) return;\n if (\n node.arguments.length === 0 &&\n node.parent.type === \"CallExpression\" &&\n node.parent.callee === node\n )\n return;\n checkKey(node, node.arguments[0]);\n },\n };\n },\n});\n","import { defineRule, type ESTree } from \"@oxlint/plugins\";\n\nfunction unwrapParentheses(node: ESTree.Expression): ESTree.Expression {\n let current = node;\n while (current.type === \"ParenthesizedExpression\") {\n current = current.expression;\n }\n return current;\n}\n\nfunction isEmptyObjectExpression(node: ESTree.Expression): boolean {\n return node.type === \"ObjectExpression\" && node.properties.length === 0;\n}\n\nfunction isConditionalEmptyObjectSpread(node: ESTree.Expression): boolean {\n const conditional = unwrapParentheses(node);\n return (\n conditional.type === \"ConditionalExpression\" &&\n (isEmptyObjectExpression(conditional.consequent) ||\n isEmptyObjectExpression(conditional.alternate))\n );\n}\n\n/** Ban conditional empty-object spreads without changing their omission semantics. */\nexport const noConditionalEmptyObjectSpreadRule = defineRule({\n meta: {\n type: \"suggestion\",\n docs: {\n description:\n \"Disallow object spreads that conditionally spread an empty object to omit fields.\",\n },\n messages: {\n avoid:\n \"This conditional spread hides property omission behind an empty object. Build the object in separate statements and add the property only when present.\",\n },\n },\n createOnce(context) {\n return {\n SpreadElement(node) {\n if (node.parent.type !== \"ObjectExpression\") return;\n\n if (isConditionalEmptyObjectSpread(node.argument)) {\n context.report({ node, messageId: \"avoid\" });\n }\n },\n };\n },\n});\n","import { existsSync, readFileSync, realpathSync } from \"node:fs\";\nimport { dirname, join, relative, resolve, sep } from \"node:path\";\n\n/** A package boundary ignores manifests that only select a module format. */\nexport interface PackageOwner {\n readonly root: string;\n readonly name: string | null;\n readonly hasExports: boolean;\n}\n\n/** Normalize existing symlinks without requiring editor buffers to exist on disk. */\nexport function physicalPath(filename: string): string {\n const absolute = resolve(filename);\n return existsSync(absolute) ? realpathSync(absolute) : absolute;\n}\n\n/** Find the package that owns a source file or an unsaved editor buffer. */\nexport function packageOwner(filename: string): PackageOwner | null {\n let directory = dirname(physicalPath(filename));\n while (true) {\n const manifest = join(directory, \"package.json\");\n if (existsSync(manifest)) {\n const value = JSON.parse(readFileSync(manifest, \"utf8\"));\n // Distribution folders often use { \"type\": \"module\" } (or commonjs)\n // without defining a new package or public API.\n if (\n !(\n (value?.type === \"module\" || value?.type === \"commonjs\") &&\n Object.keys(value).length === 1\n )\n ) {\n return {\n root: directory,\n name: typeof value?.name === \"string\" ? value.name : null,\n hasExports: value !== null && Object.hasOwn(value, \"exports\"),\n };\n }\n }\n const parent = dirname(directory);\n if (parent === directory) return null;\n directory = parent;\n }\n}\n\n/** Return a portable package-relative path, including for Windows hosts. */\nexport function packagePath(owner: PackageOwner, filename: string): string {\n return relative(owner.root, physicalPath(filename)).split(sep).join(\"/\");\n}\n\n/** Recognize test/spec suffixes on supported JavaScript and TypeScript files. */\nexport function isTestFile(filename: string): boolean {\n return /\\.(?:test|spec)\\.(?:[cm]?[jt]s|[jt]sx)$/u.test(filename);\n}\n\n/** Include test resources and legacy test locations in the production boundary. */\nexport function isTestPath(path: string): boolean {\n return (\n path.startsWith(\"test/\") ||\n path.startsWith(\"tests/\") ||\n path.split(\"/\").includes(\"__tests__\") ||\n isTestFile(path)\n );\n}\n","import { dirname, isAbsolute, resolve } from \"node:path\";\n\nimport { ResolverFactory } from \"oxc-resolver\";\n\nimport { physicalPath } from \"./package-layout.ts\";\n\n/** Resolve TS paths and Node package exports with the same conditions. */\nexport function importResolution() {\n const options = {\n extensions: [\".ts\", \".tsx\", \".mts\", \".cts\", \".js\", \".jsx\", \".mjs\", \".cjs\", \".json\"],\n extensionAlias: {\n \".js\": [\".ts\", \".tsx\", \".js\"],\n \".mjs\": [\".mts\", \".mjs\"],\n \".cjs\": [\".cts\", \".cjs\"],\n },\n conditionNames: [\"types\", \"import\", \"node\", \"default\"],\n builtinModules: true,\n };\n const resolver = new ResolverFactory({ ...options, tsconfig: \"auto\" });\n // The fallback locates blocked deep imports solely to report the boundary violation.\n const internals = resolver.cloneWithOptions({ ...options, tsconfig: \"auto\", exportsFields: [] });\n return {\n target(filename: string, specifier: string): string | null {\n const resolved = resolver.resolveFileSync(filename, specifier);\n if (resolved.builtin) return null;\n if (resolved.path) return physicalPath(resolved.path);\n const fallback = internals.resolveFileSync(filename, specifier);\n if (fallback.path) return physicalPath(fallback.path);\n // The resolver exposes export-map rejection as text. Locate its package even\n // when a null export masks a wildcard target with a different physical path.\n if (resolved.error?.includes(\"is not exported\")) {\n const name = specifier\n .split(\"/\")\n .slice(0, specifier.startsWith(\"@\") ? 2 : 1)\n .join(\"/\");\n const manifest = internals.sync(dirname(filename), name + \"/package.json\");\n if (manifest.path) return physicalPath(manifest.path);\n }\n // Relative paths still reveal ownership when a new target has not been saved yet.\n if (specifier.startsWith(\".\") || isAbsolute(specifier)) {\n return physicalPath(resolve(dirname(filename), specifier));\n }\n return null;\n },\n publicTarget(filename: string, specifier: string): string | null {\n // No tsconfig aliases: the spelling must work through the package's own API.\n const result = resolver.sync(dirname(filename), specifier);\n return result.path ? physicalPath(result.path) : null;\n },\n };\n}\n","import type { ESTree, SourceCode } from \"@oxlint/plugins\";\n\nfunction isUnshadowedRequire(sourceCode: SourceCode, node: ESTree.IdentifierReference): boolean {\n let scope = sourceCode.getScope(node);\n while (true) {\n const variable = scope.set.get(\"require\");\n if (variable) return variable.defs.length === 0;\n if (!scope.upper) return true;\n scope = scope.upper;\n }\n}\n\n/** Visit literal module references, including re-exports and type-only imports. */\nexport function importSources(\n sourceCode: () => SourceCode,\n check: (node: ESTree.Node, specifier: string) => void,\n) {\n return {\n TSImportType(node: ESTree.TSImportType) {\n check(node.source, node.source.value);\n },\n TSExternalModuleReference(node: ESTree.TSExternalModuleReference) {\n check(node.expression, node.expression.value);\n },\n ImportDeclaration(node: ESTree.ImportDeclaration) {\n check(node.source, node.source.value);\n },\n ExportNamedDeclaration(node: ESTree.ExportNamedDeclaration) {\n if (node.source) check(node.source, node.source.value);\n },\n ExportAllDeclaration(node: ESTree.ExportAllDeclaration) {\n check(node.source, node.source.value);\n },\n ImportExpression(node: ESTree.ImportExpression) {\n if (node.source.type === \"Literal\" && typeof node.source.value === \"string\") {\n check(node.source, node.source.value);\n }\n },\n CallExpression(node: ESTree.CallExpression) {\n const first = node.arguments[0];\n if (\n node.callee.type === \"Identifier\" &&\n node.callee.name === \"require\" &&\n isUnshadowedRequire(sourceCode(), node.callee) &&\n first?.type === \"Literal\" &&\n typeof first.value === \"string\"\n ) {\n check(first, first.value);\n }\n },\n };\n}\n","import { defineRule } from \"@oxlint/plugins\";\n\nimport { importResolution } from \"#src/shared/import-resolution.ts\";\nimport { importSources } from \"#src/shared/import-sources.ts\";\nimport { packageOwner, physicalPath } from \"#src/shared/package-layout.ts\";\n\n/** Require imports across package boundaries to use the target's public API. */\nexport const noCrossPackageInternalsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Disallow cross-package filesystem imports and private deep imports.\" },\n schema: [],\n messages: {\n boundary:\n \"Import {{package}} through its package name and public exports, not another package's files.\",\n },\n },\n create(context) {\n const filename = physicalPath(context.filename);\n const owner = packageOwner(filename);\n if (!owner) return {};\n const resolution = importResolution();\n return importSources(\n () => context.sourceCode,\n (node, specifier) => {\n const target = resolution.target(filename, specifier);\n if (!target) return;\n const destination = packageOwner(target);\n if (!destination || destination.root === owner.root) return;\n const name = destination.name;\n if (\n name &&\n (specifier === name || (destination.hasExports && specifier.startsWith(name + \"/\"))) &&\n resolution.publicTarget(filename, specifier) === target\n )\n return;\n context.report({\n node,\n messageId: \"boundary\",\n data: { package: name ?? destination.root },\n });\n },\n );\n },\n});\n","import { defineRule } from \"@oxlint/plugins\";\n\n/** Reject the TypeScript CommonJS export form not covered by import/no-commonjs. */\nexport const noExportAssignmentRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Require ESM exports instead of TypeScript export assignments.\" },\n schema: [],\n messages: { commonjs: \"Use ESM export syntax instead of CommonJS export =.\" },\n },\n createOnce(context) {\n return {\n TSExportAssignment(node) {\n context.report({ node, messageId: \"commonjs\" });\n },\n };\n },\n});\n","import type { ESTree } from \"@oxlint/plugins\";\n\nconst BUILT_INS = new Set([\n \"Record\",\n \"Readonly\",\n \"Partial\",\n \"Required\",\n \"Pick\",\n \"Omit\",\n \"PropertyKey\",\n \"NonNullable\",\n]);\nconst TRANSPARENT_WRAPPERS = new Set([\"Readonly\", \"Partial\", \"Required\", \"NonNullable\"]);\n\ntype TypeAliasEnvironment = ReadonlyMap<string, ESTree.TSType>;\n\ntype ResolvedType = {\n readonly type: ESTree.TSType;\n readonly substitutions: TypeAliasEnvironment;\n};\n\nexport type UnsafeDictionary = {\n readonly kind: \"unsafe-dictionary\";\n readonly unsafeValue: \"any\" | \"empty-object\" | \"object\" | \"union\" | \"unknown\";\n};\n\nexport type WideningTargetKind =\n | \"anonymous object\"\n | \"generic container\"\n | \"object\"\n | \"open dictionary\"\n | \"unknown\";\n\nexport type WideningTarget = {\n readonly kind: WideningTargetKind;\n};\n\nexport type TypeEnvironment = {\n readonly aliases: ReadonlyMap<string, ESTree.TSTypeAliasDeclaration>;\n readonly interfaces: ReadonlyMap<string, readonly ESTree.TSInterfaceDeclaration[]>;\n readonly shadowedBuiltIns: ReadonlySet<string>;\n};\n\nfunction declaredStatement(statement: ESTree.Statement): ESTree.Node | null {\n return statement.type === \"ExportNamedDeclaration\" ||\n statement.type === \"ExportDefaultDeclaration\"\n ? (statement.declaration ?? null)\n : statement;\n}\n\nexport function createTypeEnvironment(program: ESTree.Program): TypeEnvironment {\n const aliases = new Map<string, ESTree.TSTypeAliasDeclaration>();\n const interfaces = new Map<string, ESTree.TSInterfaceDeclaration[]>();\n const shadowedBuiltIns = new Set<string>();\n\n for (const statement of program.body) {\n const declaration = declaredStatement(statement);\n if (declaration?.type === \"ImportDeclaration\") {\n for (const specifier of declaration.specifiers) {\n if (BUILT_INS.has(specifier.local.name)) shadowedBuiltIns.add(specifier.local.name);\n }\n continue;\n }\n\n if (declaration?.type === \"TSTypeAliasDeclaration\") {\n const existing = aliases.get(declaration.id.name);\n if (existing === undefined) aliases.set(declaration.id.name, declaration);\n else shadowedBuiltIns.add(declaration.id.name);\n if (BUILT_INS.has(declaration.id.name)) shadowedBuiltIns.add(declaration.id.name);\n continue;\n }\n\n if (declaration?.type === \"TSInterfaceDeclaration\") {\n const declarations = interfaces.get(declaration.id.name) ?? [];\n declarations.push(declaration);\n interfaces.set(declaration.id.name, declarations);\n if (BUILT_INS.has(declaration.id.name)) shadowedBuiltIns.add(declaration.id.name);\n continue;\n }\n\n if (declaration?.type === \"TSEnumDeclaration\") {\n if (BUILT_INS.has(declaration.id.name)) shadowedBuiltIns.add(declaration.id.name);\n continue;\n }\n\n if (\n (declaration?.type === \"ClassDeclaration\" || declaration?.type === \"FunctionDeclaration\") &&\n declaration.id !== null\n ) {\n if (BUILT_INS.has(declaration.id.name)) shadowedBuiltIns.add(declaration.id.name);\n }\n }\n\n return { aliases, interfaces, shadowedBuiltIns };\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n return type.typeName.type === \"Identifier\" ? type.typeName.name : null;\n}\n\nfunction isBuiltIn(name: string, environment: TypeEnvironment): boolean {\n return BUILT_INS.has(name) && !environment.shadowedBuiltIns.has(name);\n}\n\nfunction isUnappliedReferenceTo(type: ESTree.TSType, name: string): boolean {\n const unwrapped = unwrapTransparentType(type);\n return (\n unwrapped.type === \"TSTypeReference\" &&\n typeReferenceName(unwrapped) === name &&\n (unwrapped.typeArguments === null ||\n unwrapped.typeArguments === undefined ||\n unwrapped.typeArguments.params.length === 0)\n );\n}\n\nfunction unwrapTransparentType(type: ESTree.TSType): ESTree.TSType {\n let current = type;\n while (\n current.type === \"TSParenthesizedType\" ||\n (current.type === \"TSTypeOperator\" && current.operator === \"readonly\")\n ) {\n current = current.typeAnnotation;\n }\n return current;\n}\n\nfunction isNeverType(type: ESTree.TSType): boolean {\n return unwrapTransparentType(type).type === \"TSNeverKeyword\";\n}\n\nfunction isEffectivelyEmptyMember(member: ESTree.TSSignature): boolean {\n return (\n member.type === \"TSPropertySignature\" &&\n member.optional === true &&\n member.typeAnnotation !== null &&\n member.typeAnnotation !== undefined &&\n isNeverType(member.typeAnnotation.typeAnnotation)\n );\n}\n\nfunction isEffectivelyEmptyTypeLiteral(type: ESTree.TSTypeLiteral): boolean {\n return type.members.length === 0 || type.members.every(isEffectivelyEmptyMember);\n}\n\nfunction isEffectivelyEmptyInterface(\n declarations: readonly ESTree.TSInterfaceDeclaration[],\n): boolean {\n if (declarations.length !== 1) return false;\n const [type] = declarations;\n return (\n type !== undefined &&\n type.extends.length === 0 &&\n (type.body.body.length === 0 || type.body.body.every(isEffectivelyEmptyMember))\n );\n}\n\nfunction resolvedSubstitutionArgument(\n type: ESTree.TSType,\n base: TypeAliasEnvironment,\n resolving: ReadonlySet<string> = new Set(),\n): ESTree.TSType {\n const unwrapped = unwrapTransparentType(type);\n if (unwrapped.type !== \"TSTypeReference\") return type;\n const name = typeReferenceName(unwrapped);\n if (name === null || resolving.has(name)) return type;\n const substitution = base.get(name);\n if (substitution === undefined) return type;\n const nextResolving = new Set(resolving);\n nextResolving.add(name);\n return resolvedSubstitutionArgument(substitution, base, nextResolving);\n}\n\nfunction aliasSubstitution(\n alias: ESTree.TSTypeAliasDeclaration,\n type: ESTree.TSTypeReference,\n base: TypeAliasEnvironment,\n): TypeAliasEnvironment | null {\n const parameters = alias.typeParameters?.params ?? [];\n const arguments_ = type.typeArguments?.params ?? [];\n const next = new Map(base);\n for (const [index, parameter] of parameters.entries()) {\n const argument = arguments_[index] ?? parameter.default;\n if (argument === null || argument === undefined) return null;\n next.set(parameter.name.name, resolvedSubstitutionArgument(argument, next));\n }\n return next;\n}\n\nfunction unsafeDirectValue(\n type: ESTree.TSType,\n environment: TypeEnvironment,\n substitutions: TypeAliasEnvironment,\n resolvingAliases: ReadonlySet<string>,\n): UnsafeDictionary[\"unsafeValue\"] | null {\n const unwrapped = unwrapTransparentType(type);\n if (unwrapped.type === \"TSUnknownKeyword\") return \"unknown\";\n if (unwrapped.type === \"TSAnyKeyword\") return \"any\";\n if (unwrapped.type === \"TSObjectKeyword\") return \"object\";\n if (unwrapped.type === \"TSTypeLiteral\" && isEffectivelyEmptyTypeLiteral(unwrapped))\n return \"empty-object\";\n if (unwrapped.type === \"TSUnionType\") {\n return unwrapped.types.some(\n (member) => unsafeDirectValue(member, environment, substitutions, resolvingAliases) !== null,\n )\n ? \"union\"\n : null;\n }\n if (unwrapped.type === \"TSIntersectionType\") {\n const unsafeMembers = unwrapped.types.map((member) =>\n unsafeDirectValue(member, environment, substitutions, resolvingAliases),\n );\n if (unsafeMembers.includes(\"any\")) return \"any\";\n const [firstUnsafeMember] = unsafeMembers;\n return firstUnsafeMember !== undefined && unsafeMembers.every((member) => member !== null)\n ? firstUnsafeMember\n : null;\n }\n if (unwrapped.type !== \"TSTypeReference\") return null;\n const name = typeReferenceName(unwrapped);\n if (name === null) return null;\n if (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, environment)) {\n const wrapped = unwrapped.typeArguments?.params[0];\n return wrapped === undefined\n ? null\n : unsafeDirectValue(wrapped, environment, substitutions, resolvingAliases);\n }\n const substitution = substitutions.get(name);\n if (substitution !== undefined) {\n return isUnappliedReferenceTo(substitution, name)\n ? null\n : unsafeDirectValue(substitution, environment, substitutions, resolvingAliases);\n }\n const interfaceDeclarations = environment.interfaces.get(name);\n if (interfaceDeclarations !== undefined) {\n return isEffectivelyEmptyInterface(interfaceDeclarations) ? \"empty-object\" : null;\n }\n const alias = environment.aliases.get(name);\n if (alias === undefined || resolvingAliases.has(name)) return null;\n const nextSubstitutions = aliasSubstitution(alias, unwrapped, substitutions);\n if (nextSubstitutions === null) return null;\n const nextResolving = new Set(resolvingAliases);\n nextResolving.add(name);\n return unsafeDirectValue(alias.typeAnnotation, environment, nextSubstitutions, nextResolving);\n}\n\nfunction dictionaryValueTypes(\n type: ESTree.TSType,\n environment: TypeEnvironment,\n substitutions: TypeAliasEnvironment,\n resolvingAliases: ReadonlySet<string>,\n): readonly ResolvedType[] {\n const unwrapped = unwrapTransparentType(type);\n\n if (unwrapped.type === \"TSTypeLiteral\") {\n return unwrapped.members.flatMap((member): readonly ResolvedType[] =>\n member.type === \"TSIndexSignature\" && member.typeAnnotation !== null\n ? [{ type: member.typeAnnotation.typeAnnotation, substitutions }]\n : [],\n );\n }\n\n if (unwrapped.type === \"TSMappedType\") {\n return unwrapped.typeAnnotation === null\n ? []\n : [{ type: unwrapped.typeAnnotation, substitutions }];\n }\n\n if (unwrapped.type !== \"TSTypeReference\") return [];\n const name = typeReferenceName(unwrapped);\n if (name === null) return [];\n\n const substitution = substitutions.get(name);\n if (substitution !== undefined) {\n return isUnappliedReferenceTo(substitution, name)\n ? []\n : dictionaryValueTypes(substitution, environment, substitutions, resolvingAliases);\n }\n\n if (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, environment)) {\n const wrapped = unwrapped.typeArguments?.params[0];\n return wrapped === undefined\n ? []\n : dictionaryValueTypes(wrapped, environment, substitutions, resolvingAliases);\n }\n\n if (name === \"Record\" && isBuiltIn(name, environment)) {\n const value = unwrapped.typeArguments?.params[1] ?? null;\n return value === null ? [] : [{ type: value, substitutions }];\n }\n\n if ((name === \"Pick\" || name === \"Omit\") && isBuiltIn(name, environment)) {\n const source = unwrapped.typeArguments?.params[0];\n return source === undefined\n ? []\n : dictionaryValueTypes(source, environment, substitutions, resolvingAliases);\n }\n\n const alias = environment.aliases.get(name);\n if (alias === undefined || resolvingAliases.has(name)) return [];\n const nextSubstitutions = aliasSubstitution(alias, unwrapped, substitutions);\n if (nextSubstitutions === null) return [];\n const nextResolving = new Set(resolvingAliases);\n nextResolving.add(name);\n return dictionaryValueTypes(alias.typeAnnotation, environment, nextSubstitutions, nextResolving);\n}\n\nexport function classifyUnsafeDictionaryValue(\n valueType: ESTree.TSType,\n environment: TypeEnvironment,\n): UnsafeDictionary | null {\n const unsafeValue = unsafeDirectValue(valueType, environment, new Map(), new Set());\n return unsafeValue === null ? null : { kind: \"unsafe-dictionary\", unsafeValue };\n}\n\nexport function classifyUnsafeDictionary(\n type: ESTree.TSType,\n environment: TypeEnvironment,\n): UnsafeDictionary | null {\n for (const valueType of dictionaryValueTypes(type, environment, new Map(), new Set())) {\n const unsafeValue = unsafeDirectValue(\n valueType.type,\n environment,\n valueType.substitutions,\n new Set(),\n );\n if (unsafeValue !== null) return { kind: \"unsafe-dictionary\", unsafeValue };\n }\n return null;\n}\n\nfunction resolvesToDictionary(\n type: ESTree.TSType,\n environment: TypeEnvironment,\n substitutions: TypeAliasEnvironment,\n resolvingAliases: ReadonlySet<string>,\n): boolean {\n return dictionaryValueTypes(type, environment, substitutions, resolvingAliases).length > 0;\n}\n\nexport function classifyWideningTarget(\n type: ESTree.TSType,\n environment: TypeEnvironment,\n): WideningTarget | null {\n const unwrapped = unwrapTransparentType(type);\n if (unwrapped.type === \"TSUnknownKeyword\") return { kind: \"unknown\" };\n if (unwrapped.type === \"TSObjectKeyword\") return { kind: \"object\" };\n if (unwrapped.type === \"TSTypeLiteral\") {\n return unwrapped.members.some((member) => member.type === \"TSIndexSignature\")\n ? { kind: \"open dictionary\" }\n : unwrapped.members.length > 0\n ? { kind: \"anonymous object\" }\n : null;\n }\n if (unwrapped.type === \"TSMappedType\") return { kind: \"open dictionary\" };\n if (unwrapped.type !== \"TSTypeReference\") return null;\n const name = typeReferenceName(unwrapped);\n if (name === null) return null;\n if (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, environment)) {\n const wrapped = unwrapped.typeArguments?.params[0];\n return wrapped === undefined ? null : classifyWideningTarget(wrapped, environment);\n }\n if (name === \"Record\" && isBuiltIn(name, environment)) return { kind: \"open dictionary\" };\n const alias = environment.aliases.get(name);\n if (alias === undefined) return null;\n if ((alias.typeParameters?.params.length ?? 0) > 0) {\n const substitutions = aliasSubstitution(alias, unwrapped, new Map());\n return substitutions !== null &&\n resolvesToDictionary(alias.typeAnnotation, environment, substitutions, new Set([name]))\n ? { kind: \"generic container\" }\n : null;\n }\n const substitutions = aliasSubstitution(alias, unwrapped, new Map());\n if (substitutions === null) return null;\n const resolved = classifyAliasBroadTarget(\n alias.typeAnnotation,\n environment,\n substitutions,\n new Set([name]),\n );\n return resolved;\n}\n\nfunction isBroadMappedKey(\n type: ESTree.TSType,\n environment: TypeEnvironment,\n substitutions: TypeAliasEnvironment,\n): boolean {\n const unwrapped = unwrapTransparentType(type);\n if (\n unwrapped.type === \"TSStringKeyword\" ||\n unwrapped.type === \"TSNumberKeyword\" ||\n unwrapped.type === \"TSSymbolKeyword\"\n ) {\n return true;\n }\n if (unwrapped.type === \"TSUnionType\") {\n return unwrapped.types.every((member) => isBroadMappedKey(member, environment, substitutions));\n }\n if (unwrapped.type !== \"TSTypeReference\") return false;\n const name = typeReferenceName(unwrapped);\n if (name === null) return false;\n const substitution = substitutions.get(name);\n if (substitution !== undefined && !isUnappliedReferenceTo(substitution, name)) {\n return isBroadMappedKey(substitution, environment, substitutions);\n }\n return name === \"PropertyKey\" && isBuiltIn(name, environment);\n}\n\nfunction classifyAliasBroadTarget(\n type: ESTree.TSType,\n environment: TypeEnvironment,\n substitutions: TypeAliasEnvironment,\n resolvingAliases: ReadonlySet<string>,\n): WideningTarget | null {\n const unwrapped = unwrapTransparentType(type);\n if (unwrapped.type === \"TSUnknownKeyword\") return { kind: \"unknown\" };\n if (unwrapped.type === \"TSObjectKeyword\") return { kind: \"object\" };\n if (unwrapped.type === \"TSTypeLiteral\") {\n return unwrapped.members.some((member) => member.type === \"TSIndexSignature\")\n ? { kind: \"open dictionary\" }\n : null;\n }\n if (unwrapped.type === \"TSMappedType\") {\n return isBroadMappedKey(unwrapped.constraint, environment, substitutions)\n ? { kind: \"open dictionary\" }\n : null;\n }\n if (unwrapped.type !== \"TSTypeReference\") return null;\n const name = typeReferenceName(unwrapped);\n if (name === null) return null;\n const substitution = substitutions.get(name);\n if (substitution !== undefined) {\n return isUnappliedReferenceTo(substitution, name)\n ? null\n : classifyAliasBroadTarget(substitution, environment, substitutions, resolvingAliases);\n }\n if (TRANSPARENT_WRAPPERS.has(name) && isBuiltIn(name, environment)) {\n const wrapped = unwrapped.typeArguments?.params[0];\n return wrapped === undefined\n ? null\n : classifyAliasBroadTarget(wrapped, environment, substitutions, resolvingAliases);\n }\n if (name === \"Record\" && isBuiltIn(name, environment)) {\n return { kind: \"open dictionary\" };\n }\n const alias = environment.aliases.get(name);\n if (alias === undefined || resolvingAliases.has(name)) return null;\n const nextSubstitutions = aliasSubstitution(alias, unwrapped, substitutions);\n if (nextSubstitutions === null) return null;\n const nextResolving = new Set(resolvingAliases);\n nextResolving.add(name);\n return classifyAliasBroadTarget(\n alias.typeAnnotation,\n environment,\n nextSubstitutions,\n nextResolving,\n );\n}\n\nexport function isPopulatedObjectExpression(expression: ESTree.Expression): boolean {\n let current = expression;\n while (\n current.type === \"ParenthesizedExpression\" ||\n current.type === \"TSAsExpression\" ||\n current.type === \"TSTypeAssertion\" ||\n current.type === \"TSNonNullExpression\"\n ) {\n current = current.expression;\n }\n return current.type === \"ObjectExpression\" && current.properties.length > 0;\n}\n\nexport function isKnownEvidenceExpression(expression: ESTree.Expression): boolean {\n let current = expression;\n while (\n current.type === \"ParenthesizedExpression\" ||\n current.type === \"TSAsExpression\" ||\n current.type === \"TSTypeAssertion\" ||\n current.type === \"TSNonNullExpression\" ||\n current.type === \"TSSatisfiesExpression\"\n ) {\n current = current.expression;\n }\n if (current.type === \"ObjectExpression\") return true;\n return (\n current.type === \"ArrayExpression\" ||\n current.type === \"ArrowFunctionExpression\" ||\n current.type === \"ClassExpression\" ||\n current.type === \"FunctionExpression\" ||\n current.type === \"NewExpression\" ||\n current.type === \"Literal\" ||\n current.type === \"TemplateLiteral\" ||\n current.type === \"UnaryExpression\"\n );\n}\n","import {\n defineRule,\n type ESTree,\n type Scope,\n type SourceCode,\n type Variable,\n} from \"@oxlint/plugins\";\n\nimport {\n classifyWideningTarget,\n createTypeEnvironment,\n isKnownEvidenceExpression,\n type TypeEnvironment,\n type WideningTarget,\n} from \"#src/shared/dictionary-types.ts\";\n\ntype FunctionExpression = ESTree.ArrowFunctionExpression | ESTree.Function;\n\nfunction unwrapExpression(expression: ESTree.Expression): ESTree.Expression {\n let current = expression;\n while (\n current.type === \"ParenthesizedExpression\" ||\n current.type === \"TSAsExpression\" ||\n current.type === \"TSSatisfiesExpression\" ||\n current.type === \"TSTypeAssertion\" ||\n current.type === \"TSNonNullExpression\"\n ) {\n current = current.expression;\n }\n return current;\n}\n\nfunction resolveVariable(\n sourceCode: SourceCode,\n identifier: ESTree.IdentifierReference,\n): Variable | null {\n let scope: Scope | null = sourceCode.getScope(identifier);\n while (scope !== null) {\n const variable = scope.set.get(identifier.name);\n if (variable !== undefined) return variable;\n scope = scope.upper;\n }\n return null;\n}\n\nfunction variableDeclarator(variable: Variable): ESTree.VariableDeclarator | null {\n if (variable.defs.length !== 1) return null;\n const [definition] = variable.defs;\n return definition?.type === \"Variable\" && definition.node.type === \"VariableDeclarator\"\n ? definition.node\n : null;\n}\n\nfunction isStableConstVariable(variable: Variable, declarator: ESTree.VariableDeclarator): boolean {\n return (\n declarator.parent.type === \"VariableDeclaration\" &&\n declarator.parent.kind === \"const\" &&\n variable.references.every((reference) => reference.init || !reference.isWrite())\n );\n}\n\nfunction hasKnownEvidence(\n sourceCode: SourceCode,\n expression: ESTree.Expression,\n visitedVariables = new Set<Variable>(),\n): boolean {\n if (isKnownEvidenceExpression(expression)) return true;\n const unwrapped = unwrapExpression(expression);\n if (unwrapped.type !== \"Identifier\") return false;\n const variable = resolveVariable(sourceCode, unwrapped);\n if (variable === null || visitedVariables.has(variable)) return false;\n const declarator = variableDeclarator(variable);\n if (\n declarator === null ||\n declarator.init === null ||\n !isStableConstVariable(variable, declarator)\n ) {\n return false;\n }\n visitedVariables.add(variable);\n return hasKnownEvidence(sourceCode, declarator.init, visitedVariables);\n}\n\nfunction annotationTarget(\n annotation: ESTree.TSTypeAnnotation | null | undefined,\n environment: TypeEnvironment,\n): WideningTarget | null {\n return annotation === null || annotation === undefined\n ? null\n : classifyWideningTarget(annotation.typeAnnotation, environment);\n}\n\nfunction enclosingFunction(node: ESTree.Node): FunctionExpression | null {\n let current: ESTree.Node | null = node.parent;\n while (current !== null && current.type !== \"Program\") {\n if (\n current.type === \"ArrowFunctionExpression\" ||\n current.type === \"FunctionDeclaration\" ||\n current.type === \"FunctionExpression\"\n ) {\n return current;\n }\n current = current.parent;\n }\n return null;\n}\n\nfunction sourceKeyName(sourceCode: SourceCode, key: ESTree.PropertyKey): string {\n if (key.type === \"Identifier\" || key.type === \"PrivateIdentifier\") return key.name;\n if (key.type === \"Literal\") return String(key.value);\n return sourceCode.getText(key);\n}\n\nfunction functionName(sourceCode: SourceCode, owner: FunctionExpression | null): string {\n if (owner === null) return \"anonymous function\";\n if (owner.id !== null) return owner.id.name;\n const parent = owner.parent;\n if (parent.type === \"VariableDeclarator\" && parent.id.type === \"Identifier\")\n return parent.id.name;\n if (parent.type === \"MethodDefinition\") return sourceKeyName(sourceCode, parent.key);\n return \"anonymous function\";\n}\n\nfunction isEmptyObjectExpression(expression: ESTree.Expression): boolean {\n const unwrapped = unwrapExpression(expression);\n return unwrapped.type === \"ObjectExpression\" && unwrapped.properties.length === 0;\n}\n\nfunction isDictionaryAccumulatorTarget(destination: WideningTarget): boolean {\n return destination.kind === \"open dictionary\" || destination.kind === \"generic container\";\n}\n\nfunction hasParentAssertion(node: ESTree.Node): boolean {\n return 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 meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow syntactically established values from flowing into explicitly broad or anonymous target types that discard useful evidence.\",\n },\n messages: {\n widening:\n \"The explicit {{target}} type on {{subject}} discards known type evidence. Keep inference, validate with `satisfies`, or use a named owner contract.\",\n },\n },\n createOnce(context) {\n let environment: TypeEnvironment | null = null;\n\n const reportFlow = (\n expression: ESTree.Expression,\n destination: WideningTarget | null,\n subject: string,\n ) => {\n if (destination === null) return;\n if (isDictionaryAccumulatorTarget(destination) && isEmptyObjectExpression(expression)) {\n return;\n }\n if (!hasKnownEvidence(context.sourceCode, expression)) return;\n context.report({\n node: expression,\n messageId: \"widening\",\n data: { subject, target: destination.kind },\n });\n };\n\n const targetFromAnnotation = (annotation: ESTree.TSTypeAnnotation | null | undefined) =>\n environment === null ? null : annotationTarget(annotation, environment);\n\n return {\n Program(node) {\n environment = createTypeEnvironment(node);\n },\n VariableDeclarator(node) {\n if (node.init === null || node.id.type !== \"Identifier\") return;\n reportFlow(\n node.init,\n targetFromAnnotation(node.id.typeAnnotation),\n `binding \\`${node.id.name}\\``,\n );\n },\n PropertyDefinition(node) {\n if (node.value === null) return;\n reportFlow(\n node.value,\n targetFromAnnotation(node.typeAnnotation),\n `property \\`${sourceKeyName(context.sourceCode, node.key)}\\``,\n );\n },\n AccessorProperty(node) {\n if (node.value === null) return;\n reportFlow(\n node.value,\n targetFromAnnotation(node.typeAnnotation),\n `property \\`${sourceKeyName(context.sourceCode, node.key)}\\``,\n );\n },\n AssignmentExpression(node) {\n if (node.operator !== \"=\" || node.left.type !== \"Identifier\") return;\n const variable = resolveVariable(context.sourceCode, node.left);\n if (variable === null) return;\n const declarator = variableDeclarator(variable);\n if (declarator === null || declarator.id.type !== \"Identifier\") return;\n reportFlow(\n node.right,\n targetFromAnnotation(declarator.id.typeAnnotation),\n `binding \\`${declarator.id.name}\\``,\n );\n },\n ReturnStatement(node) {\n if (node.argument === null) return;\n const owner = enclosingFunction(node);\n reportFlow(\n node.argument,\n targetFromAnnotation(owner?.returnType),\n `return value of \\`${functionName(context.sourceCode, owner)}\\``,\n );\n },\n ArrowFunctionExpression(node) {\n if (node.body.type === \"BlockStatement\") return;\n reportFlow(\n node.body,\n targetFromAnnotation(node.returnType),\n `return value of \\`${functionName(context.sourceCode, node)}\\``,\n );\n },\n TSAsExpression(node) {\n if (environment === null || hasParentAssertion(node)) return;\n reportFlow(\n node.expression,\n classifyWideningTarget(node.typeAnnotation, environment),\n \"assertion\",\n );\n },\n TSTypeAssertion(node) {\n if (environment === null || hasParentAssertion(node)) return;\n reportFlow(\n node.expression,\n classifyWideningTarget(node.typeAnnotation, environment),\n \"assertion\",\n );\n },\n };\n },\n});\n","import {\n defineRule,\n type ESTree,\n type Scope,\n type SourceCode,\n type Variable,\n} from \"@oxlint/plugins\";\n\nconst moduleMockMethods = new Set([\"doMock\", \"mock\", \"unstable_mockModule\"]);\n\nfunction resolveVariable(\n sourceCode: SourceCode,\n identifier: ESTree.IdentifierReference,\n): Variable | null {\n let scope: Scope | null = sourceCode.getScope(identifier);\n while (scope !== null) {\n const variable = scope.set.get(identifier.name);\n if (variable !== undefined) return variable;\n scope = scope.upper;\n }\n return null;\n}\n\nfunction importedName(node: ESTree.Node): string | null {\n if (node.type !== \"ImportSpecifier\") return null;\n return node.imported.type === \"Identifier\" ? node.imported.name : node.imported.value;\n}\n\nfunction isTestFrameworkObject(\n sourceCode: SourceCode,\n expression: ESTree.Expression,\n): expression is ESTree.IdentifierReference {\n if (expression.type !== \"Identifier\") return false;\n if (\n (expression.name === \"vi\" || expression.name === \"jest\") &&\n sourceCode.isGlobalReference(expression)\n ) {\n return true;\n }\n\n const variable = resolveVariable(sourceCode, expression);\n if (variable === null || variable.defs.length === 0) {\n return expression.name === \"vi\" || expression.name === \"jest\";\n }\n return variable.defs.some((definition) => {\n if (definition.type !== \"ImportBinding\" || definition.parent?.type !== \"ImportDeclaration\") {\n return false;\n }\n const source = definition.parent.source.value;\n const name = importedName(definition.node);\n return (\n (source === \"vitest\" && name === \"vi\") || (source === \"@jest/globals\" && name === \"jest\")\n );\n });\n}\n\nfunction moduleMockCall(sourceCode: SourceCode, callee: ESTree.Expression): boolean {\n if (!(\"property\" in callee) || !(\"object\" in callee) || !(\"computed\" in callee)) return false;\n if (!isTestFrameworkObject(sourceCode, callee.object)) return false;\n const property = callee.property;\n const method = callee.computed\n ? property.type === \"Literal\" &&\n (property.value === \"doMock\" ||\n property.value === \"mock\" ||\n property.value === \"unstable_mockModule\")\n ? property.value\n : null\n : property.type === \"Identifier\"\n ? property.name\n : null;\n return method !== null && moduleMockMethods.has(method);\n}\n\n/** Ban test framework module mocking in favor of real dependency seams. */\nexport const noModuleMockingRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Vitest and Jest module mocking; tests must replace dependencies through real interfaces.\",\n },\n messages: {\n moduleMock:\n \"Replace module mocking with dependency injection through a real interface, service layer, or faithful test implementation.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type === \"Super\" || node.callee.type === \"V8IntrinsicExpression\") return;\n if (moduleMockCall(context.sourceCode, node.callee)) {\n context.report({ node, messageId: \"moduleMock\" });\n }\n },\n };\n },\n});\n","import type { ESTree } from \"@oxlint/plugins\";\n\ntype VisitorKeys = Readonly<Record<string, readonly string[]>>;\n\nfunction isNode(value: unknown): value is ESTree.Node {\n return (\n typeof value === \"object\" && value !== null && \"type\" in value && typeof value.type === \"string\"\n );\n}\n\nfunction collectInferTypeParameterNames(\n node: ESTree.Node,\n visitorKeys: VisitorKeys,\n names: Set<string>,\n): void {\n if (node.type === \"TSInferType\") names.add(node.typeParameter.name.name);\n const record = node as unknown as Readonly<Record<string, unknown>>;\n for (const key of visitorKeys[node.type] ?? []) {\n const value = record[key];\n if (isNode(value)) {\n collectInferTypeParameterNames(value, visitorKeys, names);\n continue;\n }\n if (!Array.isArray(value)) continue;\n for (const child of value) {\n if (isNode(child)) collectInferTypeParameterNames(child, visitorKeys, names);\n }\n }\n}\n\n/** Collect type binders that are in scope at a node and can shadow module aliases. */\nexport function lexicalTypeParameterNames(\n node: ESTree.Node,\n visitorKeys: VisitorKeys,\n): ReadonlySet<string> {\n const names = new Set<string>();\n let descendant: ESTree.Node = node;\n let current: ESTree.Node | null = node;\n while (current !== null && current.type !== \"Program\") {\n if (\"typeParameters\" in current) {\n for (const parameter of current.typeParameters?.params ?? []) {\n names.add(parameter.name.name);\n }\n }\n if (\n current.type === \"TSMappedType\" &&\n (descendant === current.nameType || descendant === current.typeAnnotation)\n ) {\n names.add(current.key.name);\n }\n if (current.type === \"TSConditionalType\" && descendant === current.trueType) {\n collectInferTypeParameterNames(current.extendsType, visitorKeys, names);\n }\n descendant = current;\n current = current.parent;\n }\n return names;\n}\n","import { defineRule, type ESTree, type SourceCode } from \"@oxlint/plugins\";\n\nimport { lexicalTypeParameterNames } from \"#src/shared/lexical-type-parameters.ts\";\n\ntype Parameter = ESTree.ParamPattern;\ntype ParameterOwner =\n | ESTree.ArrowFunctionExpression\n | ESTree.Function\n | ESTree.TSCallSignatureDeclaration\n | ESTree.TSConstructSignatureDeclaration\n | ESTree.TSConstructorType\n | ESTree.TSFunctionType\n | ESTree.TSMethodSignature;\n\nfunction parameterAnnotation(parameter: Parameter): ESTree.TSTypeAnnotation | null | undefined {\n if (parameter.type === \"TSParameterProperty\") {\n return parameterAnnotation(parameter.parameter);\n }\n if (parameter.type === \"RestElement\") {\n return parameter.typeAnnotation ?? parameterAnnotation(parameter.argument);\n }\n if (parameter.type === \"AssignmentPattern\") {\n return parameter.typeAnnotation ?? parameter.left.typeAnnotation;\n }\n return parameter.typeAnnotation;\n}\n\nfunction parameterName(parameter: Parameter, sourceCode: SourceCode): string {\n return parameter.type === \"Identifier\"\n ? parameter.name\n : sourceCode.getText(parameter).replace(/\\s*:\\s*object\\s*$/u, \"\");\n}\n\n/** Ban the broad object type on function inputs, including local aliases to object. */\nexport const noObjectParametersRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow object function parameters; inputs must use an owner-provided type and be parsed at their boundary.\",\n },\n messages: {\n objectParameter:\n \"Parameter `{{parameter}}` uses the broad `object` type. Accept a named owner type; parse external input at its boundary before calling this function.\",\n },\n },\n createOnce(context) {\n const aliases = new Map<string, ESTree.TSType>();\n\n const resolvesToObject = (\n type: ESTree.TSType,\n shadowedAliases: ReadonlySet<string>,\n visited = new Set<string>(),\n ): boolean => {\n if (type.type === \"TSObjectKeyword\") return true;\n if (type.type === \"TSParenthesizedType\")\n return resolvesToObject(type.typeAnnotation, shadowedAliases, visited);\n if (type.type === \"TSUnionType\") {\n return type.types.some((member) => resolvesToObject(member, shadowedAliases, visited));\n }\n if (\n type.type !== \"TSTypeReference\" ||\n type.typeName.type !== \"Identifier\" ||\n (type.typeArguments !== null &&\n type.typeArguments !== undefined &&\n type.typeArguments.params.length > 0) ||\n visited.has(type.typeName.name) ||\n shadowedAliases.has(type.typeName.name)\n ) {\n return false;\n }\n const alias = aliases.get(type.typeName.name);\n if (alias === undefined) return false;\n const nextVisited = new Set(visited);\n nextVisited.add(type.typeName.name);\n return resolvesToObject(alias, shadowedAliases, nextVisited);\n };\n\n const checkParameters = (node: ParameterOwner) => {\n const shadowedAliases = lexicalTypeParameterNames(node, context.sourceCode.visitorKeys);\n for (const parameter of node.params) {\n const annotation = parameterAnnotation(parameter);\n if (annotation === null || annotation === undefined) continue;\n if (!resolvesToObject(annotation.typeAnnotation, shadowedAliases)) continue;\n context.report({\n node: annotation.typeAnnotation,\n messageId: \"objectParameter\",\n data: { parameter: parameterName(parameter, context.sourceCode) },\n });\n }\n };\n\n return {\n Program(node) {\n aliases.clear();\n for (const statement of node.body) {\n const declaration =\n statement.type === \"ExportNamedDeclaration\" ? statement.declaration : statement;\n if (\n declaration?.type === \"TSTypeAliasDeclaration\" &&\n (declaration.typeParameters === null || declaration.typeParameters === undefined)\n ) {\n aliases.set(declaration.id.name, declaration.typeAnnotation);\n }\n }\n },\n ArrowFunctionExpression: checkParameters,\n FunctionDeclaration: checkParameters,\n FunctionExpression: checkParameters,\n TSCallSignatureDeclaration: checkParameters,\n TSConstructSignatureDeclaration: checkParameters,\n TSConstructorType: checkParameters,\n TSDeclareFunction: checkParameters,\n TSEmptyBodyFunctionExpression: checkParameters,\n TSFunctionType: checkParameters,\n TSMethodSignature: checkParameters,\n };\n },\n});\n","import type { ESTree, Scope, SourceCode, Variable } from \"@oxlint/plugins\";\n\nfunction resolveVariable(\n sourceCode: SourceCode,\n identifier: ESTree.IdentifierReference,\n): Variable | null {\n let scope: Scope | null = sourceCode.getScope(identifier);\n while (scope !== null) {\n const variable = scope.set.get(identifier.name);\n if (variable !== undefined) return variable;\n scope = scope.upper;\n }\n return null;\n}\n\nfunction isGlobalReflect(sourceCode: SourceCode, expression: ESTree.Expression): boolean {\n if (expression.type !== \"Identifier\" || expression.name !== \"Reflect\") return false;\n if (sourceCode.isGlobalReference(expression)) return true;\n const variable = resolveVariable(sourceCode, expression);\n return variable === null || variable.defs.length === 0;\n}\n\n/** Reports whether a call target names one method on the global Reflect object. */\nexport function isGlobalReflectMethodCall(\n sourceCode: SourceCode,\n callee: ESTree.Expression,\n methodName: string,\n): boolean {\n if (!(\"property\" in callee) || !(\"object\" in callee) || !(\"computed\" in callee)) return false;\n if (!isGlobalReflect(sourceCode, callee.object)) return false;\n const property = callee.property;\n return callee.computed\n ? property.type === \"Literal\" && property.value === methodName\n : property.type === \"Identifier\" && property.name === methodName;\n}\n","import { defineRule } from \"@oxlint/plugins\";\n\nimport { isGlobalReflectMethodCall } from \"#src/shared/reflect-method.ts\";\n\n/** Ban Reflect.apply, which bypasses ordinary typed function calls. */\nexport const noReflectApplyRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Reflect.apply; call typed functions directly or model dynamic dispatch behind an interface.\",\n },\n messages: {\n reflectApply:\n \"Replace `Reflect.apply` with a typed function call. Model dynamic dispatch behind a named interface.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type === \"Super\" || node.callee.type === \"V8IntrinsicExpression\") return;\n if (isGlobalReflectMethodCall(context.sourceCode, node.callee, \"apply\")) {\n context.report({ node, messageId: \"reflectApply\" });\n }\n },\n };\n },\n});\n","import { defineRule } from \"@oxlint/plugins\";\n\nimport { isGlobalReflectMethodCall } from \"#src/shared/reflect-method.ts\";\n\n/** Ban Reflect.get, which bypasses ordinary property access and useful type evidence. */\nexport const noReflectGetRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow Reflect.get; use typed property access or parse dynamic input into a domain type.\",\n },\n messages: {\n reflectGet:\n \"Replace `Reflect.get` with typed property access. Parse dynamic input into a named domain type before reading it.\",\n },\n },\n createOnce(context) {\n return {\n CallExpression(node) {\n if (node.callee.type === \"Super\" || node.callee.type === \"V8IntrinsicExpression\") return;\n if (isGlobalReflectMethodCall(context.sourceCode, node.callee, \"get\")) {\n context.report({ node, messageId: \"reflectGet\" });\n }\n },\n };\n },\n});\n","import { defineRule, type ESTree } from \"@oxlint/plugins\";\n\ntype RuntimeFunction = ESTree.ArrowFunctionExpression | ESTree.Function;\n\nfunction isRuntimeFunction(node: ESTree.Node): node is RuntimeFunction {\n return (\n node.type === \"ArrowFunctionExpression\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"FunctionExpression\"\n );\n}\n\nfunction isInsideTypeGuard(node: ESTree.Node): boolean {\n let current: ESTree.Node | null = node.parent;\n while (current !== null && current.type !== \"Program\") {\n if (isRuntimeFunction(current)) {\n return current.returnType?.typeAnnotation.type === \"TSTypePredicate\";\n }\n current = current.parent;\n }\n return false;\n}\n\n/** Disallow runtime typeof checks that narrow unparsed values instead of decoding them. */\nexport const noRuntimeTypeofRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow runtime typeof checks; external values must be decoded into meaningful types at their I/O boundary.\",\n },\n messages: {\n runtimeTypeof:\n \"A `typeof` check narrows a representation without establishing its contract. Parse input at its I/O boundary, then branch on the domain value.\",\n },\n schema: [\n {\n type: \"object\",\n properties: {\n allowInTypeGuards: { type: \"boolean\" },\n },\n additionalProperties: false,\n },\n ],\n defaultOptions: [{ allowInTypeGuards: false }],\n },\n createOnce(context) {\n return {\n UnaryExpression(node) {\n const option = context.options?.[0];\n const allowInTypeGuards =\n typeof option === \"object\" &&\n option !== null &&\n !Array.isArray(option) &&\n option.allowInTypeGuards === true;\n if (node.operator === \"typeof\" && (!allowInTypeGuards || !isInsideTypeGuard(node))) {\n context.report({ node, messageId: \"runtimeTypeof\" });\n }\n },\n };\n },\n});\n","import { defineRule } from \"@oxlint/plugins\";\n\nimport { importResolution } from \"#src/shared/import-resolution.ts\";\nimport { importSources } from \"#src/shared/import-sources.ts\";\nimport { isTestPath, packageOwner, packagePath, physicalPath } from \"#src/shared/package-layout.ts\";\n\n/** Keep test dependencies out of a package's production source tree. */\nexport const noTestImportsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description: \"Disallow production source imports of tests, test helpers, and fixtures.\",\n },\n schema: [],\n messages: {\n testImport:\n \"Production source cannot import test code or resources. Move shared production code into src/.\",\n },\n },\n create(context) {\n const filename = physicalPath(context.filename);\n const owner = packageOwner(filename);\n if (!owner || !packagePath(owner, filename).startsWith(\"src/\")) return {};\n const resolution = importResolution();\n return importSources(\n () => context.sourceCode,\n (node, specifier) => {\n const target = resolution.target(filename, specifier);\n if (!target) return;\n const destination = packageOwner(target);\n if (destination && isTestPath(packagePath(destination, target))) {\n context.report({ node, messageId: \"testImport\" });\n }\n },\n );\n },\n});\n","import { defineRule, type ESTree } from \"@oxlint/plugins\";\n\ntype TypeAssertion = ESTree.TSAsExpression | ESTree.TSTypeAssertion;\n\nfunction isConstAssertion(node: TypeAssertion): boolean {\n return (\n node.typeAnnotation.type === \"TSTypeReference\" &&\n node.typeAnnotation.typeName.type === \"Identifier\" &&\n node.typeAnnotation.typeName.name === \"const\"\n );\n}\n\nfunction isNestedAssertion(node: TypeAssertion): boolean {\n return node.parent.type === \"TSAsExpression\" || node.parent.type === \"TSTypeAssertion\";\n}\n\n/** Reject non-const type assertions instead of allowing a comment-based escape hatch. */\nexport const noTypeAssertionsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Reject non-const type assertions; decode unknown input or preserve the type inferred by a typed API.\",\n },\n messages: {\n typeAssertion:\n \"Type assertions are forbidden. Decode unknown input with Schema, or preserve the type inferred by Effect SQL, Drizzle, or another typed API.\",\n },\n },\n createOnce(context) {\n const checkAssertion = (node: TypeAssertion) => {\n if (isConstAssertion(node) || isNestedAssertion(node)) return;\n context.report({ node, messageId: \"typeAssertion\" });\n };\n\n return {\n TSAsExpression: checkAssertion,\n TSTypeAssertion: checkAssertion,\n };\n },\n});\n","import { defineRule, type ESTree } from \"@oxlint/plugins\";\n\nimport { lexicalTypeParameterNames } from \"#src/shared/lexical-type-parameters.ts\";\n\ntype FunctionWithReturnType =\n | ESTree.ArrowFunctionExpression\n | ESTree.Function\n | ESTree.TSCallSignatureDeclaration\n | ESTree.TSConstructSignatureDeclaration\n | ESTree.TSConstructorType\n | ESTree.TSFunctionType\n | ESTree.TSMethodSignature;\n\nfunction referencedAliasName(type: ESTree.TSType): string | null {\n if (type.type === \"TSParenthesizedType\") return referencedAliasName(type.typeAnnotation);\n if (type.type !== \"TSTypeReference\" || type.typeName.type !== \"Identifier\") return null;\n return type.typeArguments === null ||\n type.typeArguments === undefined ||\n type.typeArguments.params.length === 0\n ? type.typeName.name\n : null;\n}\n\nfunction isConditionalTypeConstraint(node: FunctionWithReturnType): boolean {\n let current: ESTree.Node | null = node.parent;\n while (current !== null && current.type !== \"Program\") {\n if (current.type === \"TSConditionalType\") return current.extendsType === node;\n current = current.parent;\n }\n return false;\n}\n\n/** Ban function contracts that return unknown instead of a parsed domain type. */\nexport const noUnknownReturnsRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow functions whose explicit return contract is unknown or Promise<unknown>.\",\n },\n messages: {\n unknownReturn:\n \"This function exposes `unknown` to its caller. Parse the value at its boundary and return a named domain type.\",\n },\n },\n createOnce(context) {\n const aliases = new Map<string, ESTree.TSTypeAliasDeclaration>();\n\n const resolvesToUnknown = (\n type: ESTree.TSType,\n shadowedAliases: ReadonlySet<string>,\n visited = new Set<string>(),\n ): boolean => {\n if (type.type === \"TSUnknownKeyword\") return true;\n if (type.type === \"TSParenthesizedType\") {\n return resolvesToUnknown(type.typeAnnotation, shadowedAliases, visited);\n }\n if (type.type === \"TSUnionType\") {\n return type.types.some((member) => resolvesToUnknown(member, shadowedAliases, visited));\n }\n if (\n type.type === \"TSTypeReference\" &&\n type.typeName.type === \"Identifier\" &&\n (type.typeName.name === \"Promise\" || type.typeName.name === \"PromiseLike\")\n ) {\n const value = type.typeArguments?.params[0];\n return value !== undefined && resolvesToUnknown(value, shadowedAliases, visited);\n }\n const name = referencedAliasName(type);\n if (name === null || visited.has(name) || shadowedAliases.has(name)) return false;\n const alias = aliases.get(name);\n if (\n alias === undefined ||\n (alias.typeParameters !== null && alias.typeParameters !== undefined)\n ) {\n return false;\n }\n const nextVisited = new Set(visited);\n nextVisited.add(name);\n return resolvesToUnknown(alias.typeAnnotation, shadowedAliases, nextVisited);\n };\n\n const checkReturnType = (node: FunctionWithReturnType) => {\n if (isConditionalTypeConstraint(node)) return;\n const annotation = node.returnType;\n if (annotation === null || annotation === undefined) return;\n if (\n !resolvesToUnknown(\n annotation.typeAnnotation,\n lexicalTypeParameterNames(node, context.sourceCode.visitorKeys),\n )\n ) {\n return;\n }\n context.report({ node: annotation.typeAnnotation, messageId: \"unknownReturn\" });\n };\n\n return {\n Program(node) {\n aliases.clear();\n for (const statement of node.body) {\n const declaration =\n statement.type === \"ExportNamedDeclaration\" ? statement.declaration : statement;\n if (declaration?.type === \"TSTypeAliasDeclaration\") {\n aliases.set(declaration.id.name, declaration);\n }\n }\n },\n ArrowFunctionExpression: checkReturnType,\n FunctionDeclaration: checkReturnType,\n FunctionExpression: checkReturnType,\n TSCallSignatureDeclaration: checkReturnType,\n TSConstructSignatureDeclaration: checkReturnType,\n TSConstructorType: checkReturnType,\n TSDeclareFunction: checkReturnType,\n TSEmptyBodyFunctionExpression: checkReturnType,\n TSFunctionType: checkReturnType,\n TSMethodSignature: checkReturnType,\n };\n },\n});\n","import { defineRule, type ESTree } from \"@oxlint/plugins\";\n\nfunction referencedAliasName(type: ESTree.TSType): string | null {\n if (type.type === \"TSParenthesizedType\") return referencedAliasName(type.typeAnnotation);\n if (type.type !== \"TSTypeReference\" || type.typeName.type !== \"Identifier\") return null;\n return type.typeArguments === null ||\n type.typeArguments === undefined ||\n type.typeArguments.params.length === 0\n ? type.typeName.name\n : null;\n}\n\n/** Ban named aliases that merely conceal TypeScript's unknown top type. */\nexport const noUnknownTypeAliasesRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow type aliases whose resolved type is unknown; unknown must remain visible at an allowed boundary.\",\n },\n messages: {\n unknownAlias:\n \"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 },\n },\n createOnce(context) {\n const aliases = new Map<string, ESTree.TSTypeAliasDeclaration>();\n\n const resolvesToUnknown = (type: ESTree.TSType, visited = new Set<string>()): boolean => {\n if (type.type === \"TSUnknownKeyword\") return true;\n if (type.type === \"TSParenthesizedType\")\n return resolvesToUnknown(type.typeAnnotation, visited);\n const name = referencedAliasName(type);\n if (name === null || visited.has(name)) return false;\n const alias = aliases.get(name);\n if (\n alias === undefined ||\n (alias.typeParameters !== null && alias.typeParameters !== undefined)\n ) {\n return false;\n }\n const nextVisited = new Set(visited);\n nextVisited.add(name);\n return resolvesToUnknown(alias.typeAnnotation, nextVisited);\n };\n\n return {\n Program(node) {\n aliases.clear();\n for (const statement of node.body) {\n const declaration =\n statement.type === \"ExportNamedDeclaration\" ? statement.declaration : statement;\n if (declaration?.type === \"TSTypeAliasDeclaration\") {\n aliases.set(declaration.id.name, declaration);\n }\n }\n for (const alias of aliases.values()) {\n if (!resolvesToUnknown(alias.typeAnnotation, new Set([alias.id.name]))) continue;\n context.report({\n node: alias.id,\n messageId: \"unknownAlias\",\n data: { alias: alias.id.name },\n });\n }\n },\n };\n },\n});\n","import { defineRule, type ESTree } from \"@oxlint/plugins\";\n\nimport {\n classifyUnsafeDictionary,\n classifyUnsafeDictionaryValue,\n createTypeEnvironment,\n type TypeEnvironment,\n} from \"#src/shared/dictionary-types.ts\";\n\nconst typeNodeKinds: ReadonlySet<string> = new Set([\n \"JSDocNonNullableType\",\n \"JSDocNullableType\",\n \"JSDocUnknownType\",\n \"TSAnyKeyword\",\n \"TSArrayType\",\n \"TSBigIntKeyword\",\n \"TSBooleanKeyword\",\n \"TSConditionalType\",\n \"TSConstructorType\",\n \"TSFunctionType\",\n \"TSImportType\",\n \"TSIndexedAccessType\",\n \"TSInferType\",\n \"TSIntersectionType\",\n \"TSIntrinsicKeyword\",\n \"TSLiteralType\",\n \"TSMappedType\",\n \"TSNamedTupleMember\",\n \"TSNeverKeyword\",\n \"TSNullKeyword\",\n \"TSNumberKeyword\",\n \"TSObjectKeyword\",\n \"TSParenthesizedType\",\n \"TSStringKeyword\",\n \"TSSymbolKeyword\",\n \"TSTemplateLiteralType\",\n \"TSThisType\",\n \"TSTupleType\",\n \"TSTypeLiteral\",\n \"TSTypeOperator\",\n \"TSTypePredicate\",\n \"TSTypeQuery\",\n \"TSTypeReference\",\n \"TSUndefinedKeyword\",\n \"TSUnionType\",\n \"TSUnknownKeyword\",\n \"TSVoidKeyword\",\n]);\n\nfunction isTypeNode(node: ESTree.Node): node is ESTree.TSType {\n return typeNodeKinds.has(node.type);\n}\n\nfunction typeReferenceName(type: ESTree.TSTypeReference): string | null {\n return type.typeName.type === \"Identifier\" ? type.typeName.name : null;\n}\n\nfunction isInsideTypeAliasDeclaration(node: ESTree.Node): boolean {\n let current: ESTree.Node | null = node.parent;\n while (current !== null && current.type !== \"Program\") {\n if (current.type === \"TSTypeAliasDeclaration\") return true;\n current = current.parent;\n }\n return false;\n}\n\nfunction isGenericConstraint(node: ESTree.Node): boolean {\n let current: ESTree.Node | null = node.parent;\n while (current !== null && current.type !== \"Program\") {\n if (current.type === \"TSTypeParameter\") return current.constraint === node;\n current = current.parent;\n }\n return false;\n}\n\nfunction isPlainAliasConsumerUse(node: ESTree.TSType, environment: TypeEnvironment): boolean {\n if (node.type !== \"TSTypeReference\" || node.typeArguments?.params.length) return false;\n const name = typeReferenceName(node);\n return name !== null && environment.aliases.has(name) && !isInsideTypeAliasDeclaration(node);\n}\n\nfunction shouldReportType(node: ESTree.TSType, environment: TypeEnvironment): boolean {\n if (isGenericConstraint(node)) return false;\n if (isPlainAliasConsumerUse(node, environment)) return false;\n if (classifyUnsafeDictionary(node, environment) === null) return false;\n let current: ESTree.Node | null = node.parent;\n while (current !== null && current.type !== \"Program\") {\n if (isTypeNode(current) && classifyUnsafeDictionary(current, environment) !== null)\n return false;\n current = current.parent;\n }\n return true;\n}\n\n/** Disallow object-dictionary contracts whose direct value type is an unsafe escape hatch. */\nexport const noUnsafeDictionaryTypeRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Disallow object-dictionary contracts whose direct value type is unknown, any, object, {}, or a union/alias containing one of those escape hatches.\",\n },\n messages: {\n unsafeDictionary:\n \"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 },\n },\n createOnce(context) {\n let environment: TypeEnvironment | null = null;\n const report = (node: ESTree.Node, value: string) => {\n context.report({ node, messageId: \"unsafeDictionary\", data: { value } });\n };\n const reportIfUnsafe = (node: ESTree.TSType) => {\n if (environment === null || !shouldReportType(node, environment)) return;\n const unsafe = classifyUnsafeDictionary(node, environment);\n if (unsafe === null) return;\n report(node, unsafe.unsafeValue);\n };\n\n return {\n Program(node) {\n environment = createTypeEnvironment(node);\n },\n TSTypeReference: reportIfUnsafe,\n TSTypeLiteral: reportIfUnsafe,\n TSMappedType: reportIfUnsafe,\n TSIndexSignature(node) {\n if (\n environment === null ||\n node.typeAnnotation === null ||\n node.parent.type === \"TSTypeLiteral\"\n )\n return;\n const unsafe = classifyUnsafeDictionaryValue(\n node.typeAnnotation.typeAnnotation,\n environment,\n );\n if (unsafe !== null) report(node, unsafe.unsafeValue);\n },\n };\n },\n});\n","import { defineRule, type ESTree, type SourceCode } from \"@oxlint/plugins\";\n\ninterface Diagnostic {\n readonly code: string;\n readonly message: string;\n}\n\ninterface JSDocTag {\n readonly line: number;\n readonly name: string;\n value: string;\n}\n\nconst standardHeadings = [\"**When to use**\", \"**Details**\", \"**Gotchas**\"] as const;\nconst whenToUsePrefixes = [\"Use to\", \"Use when\", \"Use as\", \"Use with\"] as const;\nconst stableSemver = /^\\d+\\.\\d+\\.\\d+$/u;\nconst tagOrder = new Map([\n [\"deprecated\", 0],\n [\"see\", 1],\n [\"category\", 2],\n [\"since\", 3],\n]);\n\nfunction diagnostic(code: string, message: string): Diagnostic {\n return { code, message };\n}\n\nfunction normalizeJSDoc(comment: ESTree.Comment): string[] {\n const body = comment.value.slice(1);\n const lines = body.split(/\\r\\n|\\r|\\n/u).map((line) => line.replace(/^\\s*\\* ?/u, \"\").trimEnd());\n\n let start = 0;\n let end = lines.length;\n if (lines[start]?.trim() === \"\") start++;\n if (end > start && lines[end - 1]?.trim() === \"\") end--;\n return lines.slice(start, end);\n}\n\nfunction parseTags(lines: readonly string[]): JSDocTag[] {\n const tags: JSDocTag[] = [];\n let current: JSDocTag | undefined;\n let inFence = false;\n\n for (const [line, source] of lines.entries()) {\n const trimmed = source.trim();\n if (trimmed.startsWith(\"```\")) {\n inFence = !inFence;\n current = undefined;\n continue;\n }\n if (inFence) continue;\n\n const match = /^@([A-Za-z][\\w-]*)(?:\\s+(.*))?$/u.exec(trimmed);\n if (match !== null) {\n current = {\n line,\n name: match[1] ?? \"\",\n value: match[2]?.trim() ?? \"\",\n };\n tags.push(current);\n continue;\n }\n\n if (current !== undefined && trimmed !== \"\") {\n current.value = current.value === \"\" ? trimmed : `${current.value}\\n${trimmed}`;\n } else if (trimmed === \"\") {\n current = undefined;\n }\n }\n\n return tags;\n}\n\nfunction isForbiddenMarkdownHeading(line: string): boolean {\n return /^#{1,6}\\s+/u.test(line.trim());\n}\n\nfunction isBoldOnlyLine(line: string): boolean {\n return /^\\*\\*[^*]+\\*\\*\\s*$/u.test(line);\n}\n\nfunction isNearMissHeading(line: string): boolean {\n return (\n /^\\*\\*(When to use|When To Use|Details|Gotchas).*\\*\\*/u.test(line) &&\n !standardHeadings.includes(line as (typeof standardHeadings)[number])\n );\n}\n\nfunction isHeadingLine(line: string | undefined): boolean {\n if (line === undefined) return false;\n const trimmed = line.trim();\n return (\n standardHeadings.includes(trimmed as (typeof standardHeadings)[number]) ||\n trimmed.startsWith(\"**Example**\") ||\n isNearMissHeading(trimmed) ||\n isBoldOnlyLine(trimmed) ||\n isForbiddenMarkdownHeading(trimmed)\n );\n}\n\nfunction joinBody(lines: readonly string[]): string {\n let start = 0;\n let end = lines.length;\n while (start < end && lines[start]?.trim() === \"\") start++;\n while (end > start && lines[end - 1]?.trim() === \"\") end--;\n return lines.slice(start, end).join(\"\\n\");\n}\n\nfunction validateSection(\n lines: readonly string[],\n headingIndex: number,\n): {\n readonly diagnostics: readonly Diagnostic[];\n readonly nextIndex: number;\n readonly body: string;\n} {\n const diagnostics: Diagnostic[] = [];\n const heading = lines[headingIndex]?.trim() ?? \"section\";\n if (lines[headingIndex + 1]?.trim() !== \"\") {\n diagnostics.push(\n diagnostic(\"invalid-spacing\", `${heading} must be followed by exactly one blank line`),\n );\n }\n\n let index = headingIndex + 2;\n const bodyStart = index;\n let inFence = false;\n while (index < lines.length) {\n const trimmed = lines[index]?.trim() ?? \"\";\n if (trimmed.startsWith(\"```\")) {\n if (/^```ts(?:\\s.*)?$/u.test(trimmed)) {\n diagnostics.push(\n diagnostic(\"loose-ts-fence\", \"TypeScript examples must use **Example** (Title) sections\"),\n );\n }\n inFence = !inFence;\n }\n if (!inFence && trimmed === \"\" && isHeadingLine(lines[index + 1])) break;\n if (!inFence && isForbiddenMarkdownHeading(trimmed)) {\n diagnostics.push(\n diagnostic(\"invalid-heading\", \"Markdown headings are not allowed in JSDoc descriptions\"),\n );\n }\n if (\n !inFence &&\n isBoldOnlyLine(trimmed) &&\n !standardHeadings.includes(trimmed as (typeof standardHeadings)[number]) &&\n !trimmed.startsWith(\"**Example**\")\n ) {\n diagnostics.push(diagnostic(\"unknown-heading\", `Unknown JSDoc section heading: ${trimmed}`));\n }\n index++;\n }\n\n const bodyLines = lines.slice(bodyStart, index);\n if (joinBody(bodyLines).trim() === \"\") {\n diagnostics.push(diagnostic(\"empty-section\", `${heading} must have a non-empty body`));\n }\n if (bodyLines.at(-1)?.trim() === \"\") {\n diagnostics.push(\n diagnostic(\"invalid-spacing\", \"Section bodies must not end with extra blank lines\"),\n );\n }\n\n return { body: joinBody(bodyLines), diagnostics, nextIndex: index };\n}\n\nfunction validateExample(\n lines: readonly string[],\n headingIndex: number,\n): {\n readonly diagnostics: readonly Diagnostic[];\n readonly nextIndex: number;\n readonly title?: string;\n} {\n const diagnostics: Diagnostic[] = [];\n const heading = lines[headingIndex]?.trim() ?? \"\";\n const match = /^\\*\\*Example\\*\\* \\((.+)\\)$/u.exec(heading);\n if (match === null || match[1]?.trim() === \"\") {\n diagnostics.push(\n diagnostic(\"malformed-example\", \"TypeScript examples must use **Example** (Title)\"),\n );\n }\n if (lines[headingIndex + 1]?.trim() !== \"\") {\n diagnostics.push(\n diagnostic(\"invalid-spacing\", \"Example headings must be followed by exactly one blank line\"),\n );\n }\n\n let index = headingIndex + 2;\n const bodyStart = index;\n let fenceIndex = -1;\n while (index < lines.length) {\n const trimmed = lines[index]?.trim() ?? \"\";\n if (/^```ts(?:\\s.*)?$/u.test(trimmed)) {\n fenceIndex = index;\n break;\n }\n if (trimmed.startsWith(\"```\")) {\n diagnostics.push(\n diagnostic(\"malformed-example\", \"Examples may only contain one TypeScript code fence\"),\n );\n }\n if ((trimmed === \"\" && isHeadingLine(lines[index + 1])) || trimmed.startsWith(\"@\")) break;\n index++;\n }\n\n if (fenceIndex === -1) {\n diagnostics.push(\n diagnostic(\"malformed-example\", \"Examples must include a non-empty ```ts fence\"),\n );\n return { diagnostics, nextIndex: index };\n }\n\n const bodyLines = lines.slice(bodyStart, fenceIndex);\n if (joinBody(bodyLines).trim() !== \"\" && bodyLines.at(-1)?.trim() !== \"\") {\n diagnostics.push(\n diagnostic(\n \"invalid-spacing\",\n \"Example prose must be separated from code by exactly one blank line\",\n ),\n );\n }\n\n index = fenceIndex + 1;\n const codeStart = index;\n while (index < lines.length && lines[index]?.trim() !== \"```\") {\n if (/^```ts(?:\\s.*)?$/u.test(lines[index]?.trim() ?? \"\")) {\n diagnostics.push(\n diagnostic(\"malformed-example\", \"Examples must contain exactly one TypeScript code fence\"),\n );\n }\n index++;\n }\n const codeLines = lines.slice(codeStart, index);\n if (index >= lines.length) {\n diagnostics.push(\n diagnostic(\"malformed-example\", \"Examples must close the TypeScript code fence\"),\n );\n }\n if (joinBody(codeLines).trim() === \"\") {\n diagnostics.push(\n diagnostic(\"malformed-example\", \"Examples must include non-empty TypeScript code\"),\n );\n }\n\n index++;\n if (\n index < lines.length &&\n lines[index]?.trim() !== \"\" &&\n !lines[index]?.trim().startsWith(\"@\")\n ) {\n diagnostics.push(\n diagnostic(\n \"invalid-spacing\",\n \"Examples must be separated from following content by exactly one blank line\",\n ),\n );\n }\n\n return {\n diagnostics,\n nextIndex: index,\n ...(match?.[1] === undefined ? {} : { title: match[1].trim() }),\n };\n}\n\nfunction validateDescription(lines: readonly string[]): Diagnostic[] {\n const diagnostics: Diagnostic[] = [];\n const seenSections = new Set<string>();\n const exampleTitles = new Set<string>();\n let index = 0;\n let currentSectionOrder = -1;\n let examplesStarted = false;\n\n while (index < lines.length && lines[index]?.trim() !== \"\" && !isHeadingLine(lines[index])) {\n if (isForbiddenMarkdownHeading(lines[index] ?? \"\")) {\n diagnostics.push(\n diagnostic(\"invalid-heading\", \"Markdown headings are not allowed in JSDoc descriptions\"),\n );\n }\n index++;\n }\n\n const shortLines = lines.slice(0, index);\n if (shortLines.length === 0 || joinBody(shortLines).trim() === \"\") {\n diagnostics.push(diagnostic(\"missing-description\", \"JSDoc must include a short description\"));\n }\n if (index < lines.length && lines[index]?.trim() === \"\") {\n const next = lines[index + 1];\n if (next !== undefined && !isHeadingLine(next)) {\n diagnostics.push(\n diagnostic(\n \"multiple-description-paragraphs\",\n \"JSDoc short description must be one paragraph\",\n ),\n );\n }\n }\n\n while (index < lines.length) {\n if (lines[index]?.trim() !== \"\") {\n diagnostics.push(\n diagnostic(\"invalid-spacing\", \"JSDoc sections must be separated by exactly one blank line\"),\n );\n break;\n }\n if (lines[index + 1]?.trim() === \"\") {\n diagnostics.push(\n diagnostic(\"invalid-spacing\", \"JSDoc sections must be separated by exactly one blank line\"),\n );\n while (lines[index + 1]?.trim() === \"\") index++;\n }\n index++;\n if (index >= lines.length) break;\n\n const line = lines[index]?.trim() ?? \"\";\n if (line.startsWith(\"**Example**\")) {\n examplesStarted = true;\n const result = validateExample(lines, index);\n diagnostics.push(...result.diagnostics);\n if (result.title !== undefined) {\n const key = result.title.toLowerCase();\n if (exampleTitles.has(key)) {\n diagnostics.push(\n diagnostic(\"duplicate-example\", `Duplicate example title: ${result.title}`),\n );\n }\n exampleTitles.add(key);\n }\n index = result.nextIndex;\n continue;\n }\n\n const sectionOrder = standardHeadings.indexOf(line as (typeof standardHeadings)[number]);\n if (sectionOrder >= 0) {\n if (examplesStarted) {\n diagnostics.push(\n diagnostic(\"section-after-example\", `${line} must appear before examples`),\n );\n }\n if (sectionOrder <= currentSectionOrder || seenSections.has(line)) {\n diagnostics.push(\n diagnostic(\"section-out-of-order\", `${line} is out of order or duplicated`),\n );\n }\n currentSectionOrder = Math.max(currentSectionOrder, sectionOrder);\n seenSections.add(line);\n const result = validateSection(lines, index);\n diagnostics.push(...result.diagnostics);\n if (\n line === \"**When to use**\" &&\n !whenToUsePrefixes.some(\n (prefix) =>\n result.body.trimStart() === prefix || result.body.trimStart().startsWith(`${prefix} `),\n )\n ) {\n diagnostics.push(\n diagnostic(\n \"when-to-use-format\",\n \"**When to use** must start with `Use to`, `Use when`, `Use as`, or `Use with`\",\n ),\n );\n }\n index = result.nextIndex;\n continue;\n }\n\n if (isNearMissHeading(line) || isForbiddenMarkdownHeading(line)) {\n diagnostics.push(diagnostic(\"invalid-heading\", `Invalid JSDoc section heading: ${line}`));\n } else if (isBoldOnlyLine(line)) {\n diagnostics.push(diagnostic(\"unknown-heading\", `Unknown JSDoc section heading: ${line}`));\n } else {\n diagnostics.push(\n diagnostic(\n \"invalid-description\",\n \"JSDoc description content must appear under a standard section heading\",\n ),\n );\n }\n index++;\n }\n\n return diagnostics;\n}\n\nfunction validateTags(tags: readonly JSDocTag[]): Diagnostic[] {\n const diagnostics: Diagnostic[] = [];\n const values = new Map<string, string[]>();\n let previousOrder = -1;\n\n for (const tag of tags) {\n if (tag.name === \"internal\") continue;\n if (tag.name === \"example\") {\n diagnostics.push(\n diagnostic(\n \"forbidden-tag\",\n \"@example is not allowed; use a canonical **Example** (Title) section\",\n ),\n );\n continue;\n }\n const order = tagOrder.get(tag.name);\n if (order === undefined) {\n diagnostics.push(\n diagnostic(\"forbidden-tag\", `@${tag.name} is not allowed in public declaration JSDoc`),\n );\n continue;\n }\n if (order < previousOrder) {\n diagnostics.push(diagnostic(\"tag-out-of-order\", `@${tag.name} is out of order in JSDoc`));\n }\n previousOrder = Math.max(previousOrder, order);\n values.set(tag.name, [...(values.get(tag.name) ?? []), tag.value.trim()]);\n }\n\n for (const tag of [\"deprecated\", \"category\", \"since\"]) {\n if ((values.get(tag)?.length ?? 0) > 1) {\n diagnostics.push(\n diagnostic(\"duplicate-tag\", `JSDoc blocks may contain at most one @${tag} tag`),\n );\n }\n }\n for (const value of values.get(\"see\") ?? []) {\n if (value === \"\") diagnostics.push(diagnostic(\"empty-tag\", \"@see must include a value\"));\n }\n if (values.get(\"deprecated\")?.[0] === \"\") {\n diagnostics.push(diagnostic(\"empty-tag\", \"@deprecated must include a message\"));\n }\n\n const category = values.get(\"category\")?.[0];\n if (category === undefined) {\n diagnostics.push(diagnostic(\"missing-tag\", \"Public JSDoc must include @category\"));\n } else if (category === \"\") {\n diagnostics.push(diagnostic(\"empty-tag\", \"@category must include a value\"));\n }\n\n const since = values.get(\"since\")?.[0];\n if (since === undefined) {\n diagnostics.push(diagnostic(\"missing-tag\", \"Public JSDoc must include @since\"));\n } else if (!stableSemver.test(since)) {\n diagnostics.push(\n diagnostic(\"invalid-since\", \"@since must be a stable semver version like 1.2.3\"),\n );\n }\n\n return diagnostics;\n}\n\nfunction validateJSDoc(comment: ESTree.Comment): Diagnostic[] {\n const lines = normalizeJSDoc(comment);\n const tags = parseTags(lines);\n if (tags.some((tag) => tag.name === \"internal\")) return [];\n\n const diagnostics: Diagnostic[] = [];\n const firstTagLine = tags[0]?.line ?? lines.length;\n const content = lines.slice(0, firstTagLine);\n\n if (lines.length === 0) {\n diagnostics.push(diagnostic(\"missing-description\", \"JSDoc must include a short description\"));\n }\n if (tags.length > 0) {\n if (\n content.at(-1)?.trim() !== \"\" ||\n content.length < 2 ||\n content[content.length - 2]?.trim() === \"\"\n ) {\n diagnostics.push(\n diagnostic(\n \"invalid-spacing\",\n \"JSDoc tags must be separated from description content by exactly one blank line\",\n ),\n );\n }\n }\n if (content[0]?.trim() === \"\") {\n diagnostics.push(diagnostic(\"leading-blank\", \"JSDoc must not start with a blank line\"));\n }\n\n const description =\n tags.length > 0 && content.at(-1)?.trim() === \"\" ? content.slice(0, -1) : content;\n if (description.at(-1)?.trim() === \"\") {\n diagnostics.push(\n diagnostic(\"trailing-blank\", \"JSDoc description must not end with a blank line\"),\n );\n }\n diagnostics.push(...validateDescription(description), ...validateTags(tags));\n\n const seen = new Set<string>();\n return diagnostics.filter((item) => {\n const key = `${item.code}:${item.message}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n}\n\nfunction getJSDoc(sourceCode: SourceCode, node: ESTree.Node): ESTree.Comment | undefined {\n const comment = sourceCode.getCommentsBefore(node).at(-1);\n return comment?.type === \"Block\" && comment.value.startsWith(\"*\") ? comment : undefined;\n}\n\n/** Require exported declarations to use the public JSDoc format enforced by Effect. */\nexport const requirePublicJSDocRule = defineRule({\n meta: {\n type: \"problem\",\n docs: {\n description:\n \"Require exported declarations to use Effect-style public API JSDoc with canonical sections and tags.\",\n },\n messages: {\n invalidJSDoc: \"{{message}}\",\n missingJSDoc:\n \"Public declarations require Effect-style JSDoc with a description, @category, and @since.\",\n },\n },\n createOnce(context) {\n const checkedFunctionOverloads = new Set<string>();\n\n const check = (node: ESTree.Node) => {\n const comment = getJSDoc(context.sourceCode, node);\n if (comment === undefined) {\n context.report({ node, messageId: \"missingJSDoc\" });\n return;\n }\n\n for (const item of validateJSDoc(comment)) {\n context.report({\n node,\n messageId: \"invalidJSDoc\",\n data: { message: item.message },\n });\n }\n };\n\n return {\n ExportNamedDeclaration(node) {\n const declaration = node.declaration as\n | (ESTree.Declaration & {\n readonly id?: ESTree.IdentifierName | null;\n readonly params?: unknown;\n })\n | null;\n if (\n declaration !== null &&\n \"params\" in declaration &&\n declaration.id?.type === \"Identifier\"\n ) {\n if (checkedFunctionOverloads.has(declaration.id.name)) return;\n checkedFunctionOverloads.add(declaration.id.name);\n }\n\n if (node.declaration !== null) {\n check(node);\n return;\n }\n for (const specifier of node.specifiers) check(specifier);\n },\n };\n },\n});\n","import { defineRule } from \"@oxlint/plugins\";\n\nimport { isTestFile, packageOwner, packagePath } from \"#src/shared/package-layout.ts\";\n\n/** Place named test files under the owning package's sibling test directory. */\nexport const requireTestLocationRule = defineRule({\n meta: {\n type: \"problem\",\n docs: { description: \"Require .test filenames under the nearest package's test/ directory.\" },\n schema: [],\n messages: {\n location:\n \"Place this test under its package's test/ directory, alongside src/, using a .test filename.\",\n },\n },\n createOnce(context) {\n return {\n Program(node) {\n if (!isTestFile(context.filename)) return;\n const owner = packageOwner(context.filename);\n if (!owner) return;\n const path = packagePath(owner, context.filename);\n if (!path.startsWith(\"test/\") || /\\.spec\\.(?:[cm]?[jt]s|[jt]sx)$/u.test(path)) {\n context.report({ node, messageId: \"location\" });\n }\n },\n };\n },\n});\n","import { eslintCompatPlugin } from \"@oxlint/plugins\";\n\nimport { noEffectRunnersInLibraryRule } from \"./effect/rules/no-effect-runners-in-library.ts\";\nimport { noFallibleEffectPromiseRule } from \"./effect/rules/no-fallible-effect-promise.ts\";\nimport { noInlineLiveLayerRule } from \"./effect/rules/no-inline-live-layer.ts\";\nimport { noModuleLevelMutableStateRule } from \"./effect/rules/no-module-level-mutable-state.ts\";\nimport { noUnscopedForkRule } from \"./effect/rules/no-unscoped-fork.ts\";\nimport { noUntypedEffectErrorsRule } from \"./effect/rules/no-untyped-effect-errors.ts\";\nimport { preferEffectPlatformServicesRule } from \"./effect/rules/prefer-effect-platform-services.ts\";\nimport { preferEffectVoidRule } from \"./effect/rules/prefer-effect-void.ts\";\nimport { requireEffectFnNameRule } from \"./effect/rules/require-effect-fn-name.ts\";\nimport { requireEffectNamespaceRule } from \"./effect/rules/require-effect-namespace.ts\";\nimport { requireFetchAbortSignalRule } from \"./effect/rules/require-fetch-abort-signal.ts\";\nimport { requireServiceConstructorNamesRule } from \"./effect/rules/require-service-constructor-names.ts\";\nimport { requireServiceKeyPrefixRule } from \"./effect/rules/require-service-key-prefix.ts\";\nimport { noConditionalEmptyObjectSpreadRule } from \"./rules/no-conditional-empty-object-spread.ts\";\nimport { noCrossPackageInternalsRule } from \"./rules/no-cross-package-internals.ts\";\nimport { noExportAssignmentRule } from \"./rules/no-export-assignment.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 { noReflectApplyRule } from \"./rules/no-reflect-apply.ts\";\nimport { noReflectGetRule } from \"./rules/no-reflect-get.ts\";\nimport { noRuntimeTypeofRule } from \"./rules/no-runtime-typeof.ts\";\nimport { noTestImportsRule } from \"./rules/no-test-imports.ts\";\nimport { noTypeAssertionsRule } from \"./rules/no-type-assertions.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 { requirePublicJSDocRule } from \"./rules/require-public-jsdoc.ts\";\nimport { requireTestLocationRule } from \"./rules/require-test-location.ts\";\n\n/** Strict Oxlint rules for preserving type evidence and explicit Effect architecture. */\nconst nopeusPlugin = eslintCompatPlugin({\n meta: { name: \"nopeus\" },\n rules: {\n \"no-export-assignment\": noExportAssignmentRule,\n \"no-cross-package-internals\": noCrossPackageInternalsRule,\n \"no-test-imports\": noTestImportsRule,\n \"require-test-location\": requireTestLocationRule,\n \"no-effect-runners-in-library\": noEffectRunnersInLibraryRule,\n \"no-fallible-effect-promise\": noFallibleEffectPromiseRule,\n \"no-inline-live-layer\": noInlineLiveLayerRule,\n \"no-module-level-mutable-state\": noModuleLevelMutableStateRule,\n \"require-fetch-abort-signal\": requireFetchAbortSignalRule,\n \"no-unscoped-fork\": noUnscopedForkRule,\n \"no-untyped-effect-errors\": noUntypedEffectErrorsRule,\n \"no-conditional-empty-object-spread\": noConditionalEmptyObjectSpreadRule,\n \"no-known-value-widening\": noKnownValueWideningRule,\n \"no-module-mocking\": noModuleMockingRule,\n \"no-object-parameters\": noObjectParametersRule,\n \"no-reflect-apply\": noReflectApplyRule,\n \"no-reflect-get\": noReflectGetRule,\n \"no-runtime-typeof\": noRuntimeTypeofRule,\n \"no-type-assertions\": noTypeAssertionsRule,\n \"no-unsafe-dictionary-type\": noUnsafeDictionaryTypeRule,\n \"no-unknown-returns\": noUnknownReturnsRule,\n \"no-unknown-type-aliases\": noUnknownTypeAliasesRule,\n \"prefer-effect-platform-services\": preferEffectPlatformServicesRule,\n \"prefer-effect-void\": preferEffectVoidRule,\n \"require-public-jsdoc\": requirePublicJSDocRule,\n \"require-effect-fn-name\": requireEffectFnNameRule,\n \"require-effect-namespace\": requireEffectNamespaceRule,\n \"require-service-key-prefix\": requireServiceKeyPrefixRule,\n \"require-service-constructor-names\": requireServiceConstructorNamesRule,\n },\n});\n\nexport default nopeusPlugin;\n"],"mappings":";;;;;;AAQA,SAAgB,eAAe,YAAoB,YAAoC;CACrF,OAAO;EAAE;EAAY;CAAW;AAClC;AAEA,SAASA,eAAa,WAA2C;CAC/D,OAAO,UAAU,SAAS,SAAS,eAC/B,UAAU,SAAS,OACnB,UAAU,SAAS;AACzB;AAEA,SAASC,kBACP,YACA,YACiB;CACjB,IAAI,QAAsB,WAAW,SAAS,UAAU;CACxD,OAAO,UAAU,MAAM;EACrB,MAAM,WAAW,MAAM,IAAI,IAAI,WAAW,IAAI;EAC9C,IAAI,aAAa,KAAA,GAAW,OAAO;EACnC,QAAQ,MAAM;CAChB;CACA,OAAO;AACT;;AAGA,SAAgB,mBACd,YACA,YACA,MACS;CACT,IAAI,WAAW,SAAS,MAAM,OAAO;CACrC,IAAI,WAAW,kBAAkB,UAAU,GAAG,OAAO;CACrD,MAAM,WAAWA,kBAAgB,YAAY,UAAU;CACvD,OAAO,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