@r_masseater/msch 0.98.0 → 0.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"lint-rules.mjs","names":["START","END","ONE","textOf","Str","Arr","MESSAGE","ONE","Arr","Arr","Rec","MESSAGE_ID","MESSAGE","Str","Arr","isStringLiteral","visitorOf","MESSAGE","Arr","MESSAGE","Arr","MESSAGE","Str","Arr","Arr","Arr","Str","MESSAGE","Arr","unwrapped","Str","Arr","START","NEXT","propertyOf","Arr","Str","MESSAGES","Arr","Str","MESSAGES","OptionsSchema","optionsOf","Str","Arr","Rec","NEXT","Arr","propertyOf","Rec","propertyOf","Arr","Str","propertyOf","Arr","Rec","Arr","Str","Rec"],"sources":["../src/features/define-lint-rules/model/get-or-insert-ast.ts","../src/features/define-lint-rules/model/array-from-async.ts","../src/features/define-lint-rules/model/ecosystem-readers.ts","../src/features/define-lint-rules/model/typed-rule.ts","../src/features/define-lint-rules/model/explicit-import-path.ts","../src/features/define-lint-rules/model/get-or-insert.ts","../src/features/define-lint-rules/model/inline-exports.ts","../src/features/define-lint-rules/model/mcp-tool-layer.ts","../src/features/define-lint-rules/model/declared-outside.ts","../src/features/define-lint-rules/model/writable-part.ts","../src/features/define-lint-rules/model/readonly-parameters.ts","../src/features/define-lint-rules/model/separate-min-max.ts","../src/features/define-lint-rules/model/video-script-ast.ts","../src/features/define-lint-rules/model/video-readings.ts","../src/features/define-lint-rules/model/video-say.ts","../src/features/define-lint-rules/model/video-values.ts","../src/features/define-lint-rules/model/video-intro.ts","../src/features/define-lint-rules/model/video-series.ts","../src/features/define-lint-rules/model/video-rules.ts","../src/features/define-lint-rules/model/coded-rules.ts","../src/features/define-lint-rules/model/intent-rule.ts","../src/features/define-lint-rules/model/intents.ts","../src/features/define-lint-rules/model/plugin.ts"],"sourcesContent":["import { Array as Arr, Option, Predicate, Schema, String as Str, pipe } from \"effect\";\n\nexport type Keys = Readonly<Record<string, readonly string[] | undefined>>;\n\nexport interface Scope {\n readonly text: string;\n readonly keys: Keys;\n}\n\nexport interface Access {\n readonly map: string;\n readonly key: string;\n readonly value: Option.Option<string>;\n}\n\nconst START = 0;\nconst END = 1;\nconst KEY = 0;\nconst VALUE = 1;\nconst ONE = 1;\n\nconst RangeSchema = Schema.Tuple([Schema.Finite, Schema.Finite]);\nconst RangedSchema = Schema.Struct({ range: RangeSchema });\n\ntype Ranged = typeof RangedSchema.Type;\n\nconst decodeRanged = Schema.decodeUnknownOption(RangedSchema);\n\nconst IdentifierSchema = Schema.Struct({ type: Schema.Literal(\"Identifier\"), name: Schema.String });\n\nconst MemberSchema = Schema.Struct({\n type: Schema.Literal(\"MemberExpression\"),\n computed: Schema.Literal(false),\n object: RangedSchema,\n property: IdentifierSchema,\n});\n\nconst MemberCallSchema = Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: MemberSchema,\n arguments: Schema.Array(RangedSchema),\n});\n\nconst decodeMemberCall = Schema.decodeUnknownOption(MemberCallSchema);\n\nconst decodeCall = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: RangedSchema,\n arguments: Schema.Array(Schema.Unknown),\n }),\n);\n\nconst decodeBlock = Schema.decodeUnknownOption(\n Schema.Struct({ type: Schema.Literal(\"BlockStatement\"), body: Schema.Array(Schema.Unknown) }),\n);\n\nconst decodeExpressionStatement = Schema.decodeUnknownOption(\n Schema.Struct({ type: Schema.Literal(\"ExpressionStatement\"), expression: Schema.Unknown }),\n);\n\nconst decodeReturn = Schema.decodeUnknownOption(\n Schema.Struct({ type: Schema.Literal(\"ReturnStatement\"), argument: RangedSchema }),\n);\n\nconst decodeTyped = Schema.decodeUnknownOption(Schema.Struct({ type: Schema.String }));\n\nconst textOf =\n (scope: Scope) =>\n (node: Ranged): string =>\n Str.slice(node.range[START], node.range[END])(scope.text);\n\nexport const textOfNode =\n (scope: Scope) =>\n (node: unknown): Option.Option<string> =>\n pipe(decodeRanged(node), Option.map(textOf(scope)));\n\nexport const accessOf =\n (scope: Scope) =>\n (method: string) =>\n (node: unknown): Option.Option<Access> =>\n pipe(\n decodeMemberCall(node),\n Option.filter((call) => call.callee.property.name === method),\n Option.flatMap((call) =>\n pipe(\n Arr.get(call.arguments, KEY),\n Option.map((key) => ({\n map: textOf(scope)(call.callee.object),\n key: textOf(scope)(key),\n value: pipe(Arr.get(call.arguments, VALUE), Option.map(textOf(scope))),\n })),\n ),\n ),\n );\n\nexport const sameEntry =\n (left: Access) =>\n (right: Access): boolean =>\n left.map === right.map && left.key === right.key;\n\nexport const calleeMatches =\n (scope: Scope) =>\n (pattern: RegExp) =>\n (node: unknown): Option.Option<readonly unknown[]> =>\n pipe(\n decodeCall(node),\n Option.filter((call) => pattern.test(textOf(scope)(call.callee))),\n Option.map((call) => call.arguments),\n );\n\nexport const expressionOf = (statement: unknown): Option.Option<unknown> =>\n pipe(\n decodeExpressionStatement(statement),\n Option.map((found) => found.expression),\n );\n\nexport const returnedText =\n (scope: Scope) =>\n (statement: unknown): Option.Option<string> =>\n pipe(\n decodeReturn(statement),\n Option.map((found) => textOf(scope)(found.argument)),\n );\n\nexport const bodyOf = (node: unknown): Option.Option<readonly unknown[]> =>\n pipe(\n decodeBlock(node),\n Option.map((block) => block.body),\n );\n\nexport const onlyStatement = (statement: unknown): Option.Option<unknown> =>\n Option.match(bodyOf(statement), {\n onNone: () => Option.some(statement),\n onSome: (body) =>\n Option.flatMap(\n Option.liftPredicate(body, (all) => all.length === ONE),\n Arr.head,\n ),\n });\n\nexport const typeOf = (node: unknown): string =>\n pipe(decodeTyped(node), Option.match({ onNone: () => \"\", onSome: (found) => found.type }));\n\nexport const parentOf = (node: unknown): Option.Option<unknown> =>\n pipe(\n Option.liftPredicate(node, Predicate.hasProperty(\"parent\")),\n Option.flatMap((found) => Option.fromNullishOr(found.parent)),\n );\n\nconst childrenOf = (keys: Keys, node: unknown): readonly unknown[] =>\n pipe(\n Option.liftPredicate(node, Predicate.isObject),\n Option.match({\n onNone: (): readonly unknown[] => [],\n onSome: (found) =>\n pipe(\n keys[typeOf(found)] ?? [],\n Arr.flatMap((key): readonly unknown[] =>\n pipe(\n Option.liftPredicate(found, Predicate.hasProperty(key)),\n Option.match({\n onNone: (): readonly unknown[] => [],\n onSome: (owner) => Arr.ensure(owner[key]),\n }),\n ),\n ),\n Arr.filter(Predicate.isObject),\n ),\n }),\n );\n\nexport const descendants =\n (keys: Keys) =>\n (node: unknown): readonly unknown[] => [\n node,\n ...pipe(childrenOf(keys, node), Arr.flatMap(descendants(keys))),\n ];\n\nexport const accessesIn =\n (scope: Scope) =>\n (method: string) =>\n (node: unknown): readonly Access[] =>\n pipe(descendants(scope.keys)(node), Arr.map(accessOf(scope)(method)), Arr.getSomes);\n","import { Array as Arr, Option, Schema, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nimport { expressionOf, onlyStatement } from \"./get-or-insert-ast.ts\";\n\nconst MESSAGE =\n \"Collect an async iterable with Array.fromAsync, passing the mapping as its second argument. Do not push each item from a for await loop.\";\n\nconst ONE = 1;\n\nconst DeclarationSchema = Schema.Struct({\n type: Schema.Literal(\"VariableDeclaration\"),\n declarations: Schema.Array(Schema.Unknown),\n});\n\nconst decodeLoop = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"ForOfStatement\"),\n await: Schema.Literal(true),\n left: DeclarationSchema,\n body: Schema.Unknown,\n }),\n);\n\nconst PushNameSchema = Schema.Struct({\n type: Schema.Literal(\"Identifier\"),\n name: Schema.Literal(\"push\"),\n});\n\nconst PushCalleeSchema = Schema.Struct({\n type: Schema.Literal(\"MemberExpression\"),\n computed: Schema.Literal(false),\n property: PushNameSchema,\n});\n\nconst ArgumentSchema = Schema.Struct({ type: Schema.String });\n\nconst decodePush = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: PushCalleeSchema,\n arguments: Schema.Array(ArgumentSchema),\n }),\n);\n\nconst pushesOne = (statement: unknown): boolean =>\n pipe(\n expressionOf(statement),\n Option.flatMap(decodePush),\n Option.exists(\n (call) =>\n call.arguments.length === ONE &&\n !pipe(\n call.arguments,\n Arr.some((argument) => argument.type === \"SpreadElement\"),\n ),\n ),\n );\n\nconst collectsByHand = (node: unknown): boolean =>\n pipe(\n decodeLoop(node),\n Option.filter((loop) => loop.left.declarations.length === ONE),\n Option.flatMap((loop) => onlyStatement(loop.body)),\n Option.exists(pushesOne),\n );\n\nexport const arrayFromAsync: Rule = {\n meta: { type: \"suggestion\" },\n create: (context) => ({\n ForOfStatement: (node): void => {\n if (collectsByHand(node)) {\n context.report({ node, message: MESSAGE });\n }\n },\n }),\n};\n","import { baseName } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Option, Record as Rec, pipe } from \"effect\";\nimport type { Context, ESTree, Rule } from \"vite-plus/lint/plugins\";\n\ntype Format = \"json\" | \"toml\" | \"typescript\" | \"yaml\";\n\ninterface EcosystemFile {\n readonly name: RegExp;\n readonly format: Format;\n readonly reader: string;\n}\n\nconst ECOSYSTEM_FILES: readonly EcosystemFile[] = [\n {\n name: /^pnpm-workspace\\.yaml$/u,\n format: \"yaml\",\n reader:\n \"readWorkspaceManifest, findWorkspaceProjects or updateWorkspaceManifest from @r_masseater/masseater-utils/kestrion/pnpm, which run the @pnpm readers\",\n },\n {\n name: /^pnpm-lock\\.yaml$/u,\n format: \"yaml\",\n reader:\n \"readWantedLockfile, lockedPackageIds or lockedGraph from @r_masseater/masseater-utils/kestrion/pnpm, which run @pnpm/lockfile.fs\",\n },\n { name: /^Cargo\\.(?:toml|lock)$/u, format: \"toml\", reader: \"cargo metadata\" },\n {\n name: /^tsconfig(?:\\.[\\w-]+)?\\.json$/u,\n format: \"json\",\n reader: \"parse from tsconfck or the TypeScript compiler API\",\n },\n {\n name: /^vite\\.config\\.[cm]?[jt]s$/u,\n format: \"typescript\",\n reader:\n \"resolveConfigFromFile from vite-plus, or parse from vite-plus for a read that must not run the file\",\n },\n];\n\nconst PARSER_MODULES: Readonly<Record<Format, readonly string[]>> = {\n json: [\"jsonc-parser\", \"json5\", \"strip-json-comments\"],\n toml: [\"smol-toml\", \"@iarna/toml\", \"toml\", \"toml-eslint-parser\"],\n typescript: [\"typescript\", \"oxc-parser\", \"@babel/parser\", \"@typescript-eslint/parser\", \"acorn\"],\n yaml: [\"yaml\", \"js-yaml\"],\n};\n\nconst PARSER_CALLS: Readonly<Record<Format, Option.Option<RegExp>>> = {\n json: Option.some(/\\b(?:JSON\\.parse|parseJson)\\b/u),\n toml: Option.none(),\n typescript: Option.none(),\n yaml: Option.none(),\n};\n\nconst importedModules = (statements: readonly ESTree.Statement[]): readonly string[] =>\n pipe(\n statements,\n Arr.filter((statement) => statement.type === \"ImportDeclaration\"),\n Arr.map((declaration) => declaration.source.value),\n );\n\nconst parserIn =\n (context: Context) =>\n (format: Format): Option.Option<string> => {\n const imported = importedModules(context.sourceCode.ast.body);\n const fromModule = pipe(\n Rec.get(PARSER_MODULES, format),\n Option.getOrElse((): readonly string[] => []),\n Arr.findFirst((module) => Arr.contains(imported, module)),\n );\n if (Option.isSome(fromModule)) {\n return fromModule;\n }\n return pipe(\n Rec.get(PARSER_CALLS, format),\n Option.flatten,\n Option.flatMap((pattern) => Option.fromNullishOr(pattern.exec(context.sourceCode.text))),\n Option.map(([call]) => call),\n );\n };\n\nconst messageFor =\n (context: Context) =>\n (text: string): Option.Option<string> => {\n const name = baseName(text);\n return pipe(\n ECOSYSTEM_FILES,\n Arr.findFirst((entry) => entry.name.test(name)),\n Option.flatMap(({ format, reader }) =>\n pipe(\n parserIn(context)(format),\n Option.map(\n (parser) =>\n `${name} has an official reader: ${reader}. Read it with that instead of parsing it with ${parser}, so that the file means what its own tool says it means.`,\n ),\n ),\n ),\n );\n };\n\nexport const ecosystemReaders: Rule = {\n meta: { type: \"problem\" },\n create: (context) => ({\n Literal: (node): void => {\n const message = pipe(\n Option.liftPredicate(node.value, (value) => typeof value === \"string\"),\n Option.flatMap(messageFor(context)),\n );\n if (Option.isSome(message)) {\n context.report({ node, message: message.value });\n }\n },\n TemplateElement: (node): void => {\n const message = messageFor(context)(node.value.raw);\n if (Option.isSome(message)) {\n context.report({ node, message: message.value });\n }\n },\n }),\n};\n","import { withTypeInformation } from \"@r_masseater/oxlint-typed-rules\";\nimport type { ParserServices, TypedContext } from \"@r_masseater/oxlint-typed-rules\";\nimport { Option, pipe } from \"effect\";\nimport type { Rule, RuleMeta, Visitor } from \"vite-plus/lint/plugins\";\n\nexport interface TypedRuleParts {\n readonly meta: RuleMeta;\n readonly visitorOf: (context: TypedContext, services: ParserServices) => Visitor;\n}\n\nexport const typedRuleOf = ({ meta, visitorOf }: TypedRuleParts): Rule =>\n withTypeInformation({\n meta,\n create: (context: TypedContext) =>\n pipe(\n Option.fromNullishOr(context.sourceCode.parserServices),\n Option.match({\n onNone: (): Visitor => ({}),\n onSome: (services) => visitorOf(context, services),\n }),\n ),\n });\n","import { baseName, parent } from \"@masseater.dev/path-kit\";\nimport type { ParserServices, TypedContext } from \"@r_masseater/oxlint-typed-rules\";\nimport { Array as Arr, Option, Predicate, String as Str, pipe } from \"effect\";\nimport type { ESTree, Rule, Visitor } from \"vite-plus/lint/plugins\";\n\nimport { typedRuleOf } from \"./typed-rule.ts\";\n\nconst MESSAGE_ID = \"spellOut\";\nconst MESSAGE =\n \"`{{specifier}}` does not name a file. Write `{{fixed}}`: Node ESM and TypeScript nodenext resolve neither a missing extension nor a directory index, so spelling out the file works under every resolver.\";\n\nconst RELATIVE = /^\\.{1,2}(?:\\/|$)/u;\nconst PARTS = /^(?<path>[^?]*)(?<query>.*)$/su;\nconst TRAILING_SEPARATORS = /\\/+$/u;\nconst DIRECTORY_NAMES: readonly string[] = [\".\", \"..\"];\nconst INDEX = \"index.\";\nconst DEFAULT_QUOTE = '\"';\nconst FIRST = 0;\n\ninterface Parts {\n readonly path: string;\n readonly query: string;\n}\n\nconst partsOf = (specifier: string): Option.Option<Parts> =>\n pipe(\n Str.match(PARTS)(specifier),\n Option.flatMap((matched) => Option.fromNullishOr(matched.groups)),\n Option.map((groups) => ({ path: groups[\"path\"] ?? \"\", query: groups[\"query\"] ?? \"\" })),\n );\n\nconst completionOf = (resolved: string, path: string): Option.Option<string> => {\n const file = baseName(resolved);\n const name = baseName(path);\n const index = Str.startsWith(INDEX)(file);\n if (Arr.contains(DIRECTORY_NAMES, name)) {\n return Option.liftPredicate(`/${file}`, () => index);\n }\n if (Str.startsWith(`${name}.`)(file)) {\n return Option.some(Str.slice(name.length)(file));\n }\n return Option.liftPredicate(`/${file}`, () => index && baseName(parent(resolved)) === name);\n};\n\nconst resolvedFileOf = (\n services: ParserServices,\n source: ESTree.StringLiteral,\n): Option.Option<string> =>\n pipe(\n Option.fromNullishOr(services.getSymbolAtLocation(source)),\n Option.flatMap((symbol) => Arr.head(symbol.declarations)),\n Option.map((declaration) => declaration.getSourceFile().fileName),\n );\n\nconst fixedOf = (services: ParserServices, source: ESTree.StringLiteral): Option.Option<string> =>\n pipe(\n partsOf(source.value),\n Option.filter(({ path }) => RELATIVE.test(path)),\n Option.flatMap(({ path, query }) =>\n pipe(\n resolvedFileOf(services, source),\n Option.flatMap((resolved) =>\n completionOf(resolved, Str.replace(TRAILING_SEPARATORS, \"\")(path)),\n ),\n Option.map(\n (completion) => `${Str.replace(TRAILING_SEPARATORS, \"\")(path)}${completion}${query}`,\n ),\n ),\n ),\n );\n\nconst quoteOf = (source: ESTree.StringLiteral): string =>\n pipe(\n Option.fromNullishOr(source.raw),\n Option.flatMap(Str.charAt(FIRST)),\n Option.getOrElse(() => DEFAULT_QUOTE),\n );\n\nconst isStringLiteral = (node: ESTree.Node | null): node is ESTree.StringLiteral =>\n Predicate.isNotNull(node) && node.type === \"Literal\" && Predicate.isString(node.value);\n\nconst visitorOf = (context: TypedContext, services: ParserServices): Visitor => {\n const check = (source: ESTree.Node | null): void => {\n if (!isStringLiteral(source)) {\n return;\n }\n const fixed = fixedOf(services, source);\n if (Option.isSome(fixed)) {\n context.report({\n node: source,\n messageId: MESSAGE_ID,\n data: { specifier: source.value, fixed: fixed.value },\n fix: (fixer) =>\n fixer.replaceText(source, `${quoteOf(source)}${fixed.value}${quoteOf(source)}`),\n });\n }\n };\n return {\n ImportDeclaration: (node): void => {\n check(node.source);\n },\n ExportAllDeclaration: (node): void => {\n check(node.source);\n },\n ExportNamedDeclaration: (node): void => {\n check(node.source);\n },\n ImportExpression: (node): void => {\n check(node.source);\n },\n };\n};\n\nexport const explicitImportPath: Rule = typedRuleOf({\n meta: { type: \"suggestion\", fixable: \"code\", messages: { [MESSAGE_ID]: MESSAGE } },\n visitorOf,\n});\n","import { Array as Arr, Option, Schema, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nimport {\n accessOf,\n accessesIn,\n bodyOf,\n calleeMatches,\n descendants,\n expressionOf,\n onlyStatement,\n parentOf,\n returnedText,\n sameEntry,\n textOfNode,\n typeOf,\n} from \"./get-or-insert-ast.ts\";\nimport type { Access, Scope } from \"./get-or-insert-ast.ts\";\n\nconst MESSAGE =\n \"Use getOrInsert or getOrInsertComputed on the Map or WeakMap, so that reading a key and storing its first value is one call. Do not read the key and then set it by hand.\";\n\nconst ONE = 1;\nconst TWO = 2;\nconst OPTION_FROM = /^(?:Option\\.)?from(?:NullishOr|UndefinedOr|Nullable)$/u;\nconst GET_OR_ELSE = /^(?:Option\\.)?getOrElse$/u;\nconst FUNCTIONS: readonly string[] = [\"ArrowFunctionExpression\", \"FunctionExpression\"];\n\nconst decodeGuard = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"IfStatement\"),\n test: Schema.Unknown,\n consequent: Schema.Unknown,\n alternate: Schema.Null,\n }),\n);\n\nconst decodeNot = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"UnaryExpression\"),\n operator: Schema.Literal(\"!\"),\n argument: Schema.Unknown,\n }),\n);\n\nconst DeclaratorSchema = Schema.Struct({\n id: Schema.Struct({ type: Schema.Literal(\"Identifier\"), name: Schema.String }),\n init: Schema.Unknown,\n});\n\ntype Declarator = typeof DeclaratorSchema.Type;\n\nconst decodeDeclaration = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"VariableDeclaration\"),\n declarations: Schema.Array(DeclaratorSchema),\n }),\n);\n\nconst decodeNullish = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"LogicalExpression\"),\n operator: Schema.Literal(\"??\"),\n left: Schema.Unknown,\n }),\n);\n\nconst storeOf =\n (scope: Scope) =>\n (statement: unknown): Option.Option<Access> =>\n pipe(expressionOf(statement), Option.flatMap(accessOf(scope)(\"set\")));\n\nconst isHasGuard = (scope: Scope, node: unknown): boolean =>\n pipe(\n decodeGuard(node),\n Option.exists((guard) => {\n const guarded = pipe(\n decodeNot(guard.test),\n Option.flatMap((not) => accessOf(scope)(\"has\")(not.argument)),\n );\n const stored = pipe(onlyStatement(guard.consequent), Option.flatMap(storeOf(scope)));\n return Option.isSome(guarded) && Option.exists(stored, sameEntry(guarded.value));\n }),\n );\n\nconst deletes =\n (scope: Scope, read: Access) =>\n (statement: unknown): boolean =>\n pipe(\n expressionOf(statement),\n Option.flatMap(accessOf(scope)(\"delete\")),\n Option.exists(sameEntry(read)),\n );\n\nconst storesBack =\n (scope: Scope, read: Access, name: string) =>\n (statement: unknown): boolean =>\n Option.exists(\n storeOf(scope)(statement),\n (stored) => sameEntry(read)(stored) && Option.exists(stored.value, (value) => value === name),\n );\n\nconst fallsBack =\n (scope: Scope, later: readonly unknown[]) =>\n (declarator: Declarator): boolean =>\n pipe(\n decodeNullish(declarator.init),\n Option.flatMap((nullish) => accessOf(scope)(\"get\")(nullish.left)),\n Option.exists(\n (read) =>\n pipe(later, Arr.some(storesBack(scope, read, declarator.id.name))) &&\n !pipe(later, Arr.some(deletes(scope, read))),\n ),\n );\n\nconst fallbackIndices = (scope: Scope, body: readonly unknown[]): readonly number[] =>\n pipe(\n body,\n Arr.map((statement, index) => {\n const fallsBackLater = fallsBack(scope, Arr.drop(body, index + ONE));\n return pipe(\n decodeDeclaration(statement),\n Option.map((declaration) => declaration.declarations),\n Option.filter(Arr.some(fallsBackLater)),\n Option.as(index),\n );\n }),\n Arr.getSomes,\n );\n\ninterface CachedCheck {\n readonly test: (name: string) => string;\n readonly value: (name: string) => string;\n}\n\nconst itself = (name: string): string => name;\n\nconst CACHED_CHECKS: readonly CachedCheck[] = [\n { test: (name) => `${name} !== undefined`, value: itself },\n { test: (name) => `${name} != null`, value: itself },\n { test: (name) => `${name} !== null`, value: itself },\n { test: (name) => `Predicate.isNotUndefined(${name})`, value: itself },\n { test: (name) => `Predicate.isNotNullish(${name})`, value: itself },\n { test: itself, value: itself },\n { test: (name) => `Option.isSome(${name})`, value: (name) => `${name}.value` },\n];\n\nconst returnsCached =\n (scope: Scope, name: string) =>\n (statement: unknown): boolean =>\n pipe(\n decodeGuard(statement),\n Option.exists((guard) => {\n const tested = textOfNode(scope)(guard.test);\n const returned = pipe(onlyStatement(guard.consequent), Option.flatMap(returnedText(scope)));\n return pipe(\n CACHED_CHECKS,\n Arr.some(\n (check) =>\n Option.exists(tested, (found) => found === check.test(name)) &&\n Option.exists(returned, (found) => found === check.value(name)),\n ),\n );\n }),\n );\n\nconst unwrapOption =\n (scope: Scope) =>\n (node: unknown): unknown =>\n pipe(\n calleeMatches(scope)(OPTION_FROM)(node),\n Option.flatMap(Arr.head),\n Option.getOrElse(() => node),\n );\n\nconst readsCached =\n (scope: Scope, stored: Access) =>\n (declarator: Declarator): boolean =>\n pipe(\n unwrapOption(scope)(declarator.init),\n accessOf(scope)(\"get\"),\n Option.exists(sameEntry(stored)),\n );\n\nconst earlyReturn = (scope: Scope, body: readonly unknown[], stored: Access): boolean =>\n pipe(\n body,\n Arr.some((statement, index) =>\n pipe(\n decodeDeclaration(statement),\n Option.flatMap((declaration) => Arr.head(declaration.declarations)),\n Option.filter(readsCached(scope, stored)),\n Option.exists((declarator) =>\n Option.exists(Arr.get(body, index + ONE), returnsCached(scope, declarator.id.name)),\n ),\n ),\n ),\n );\n\nconst storedAndReturned = (scope: Scope, body: readonly unknown[]): Option.Option<Access> => {\n const returned = pipe(Arr.last(body), Option.flatMap(returnedText(scope)));\n return pipe(\n Arr.get(body, body.length - TWO),\n Option.flatMap(storeOf(scope)),\n Option.filter(\n (stored) => Option.isSome(returned) && Option.contains(stored.value, returned.value),\n ),\n );\n};\n\nconst optionRegion = (scope: Scope, block: unknown): Option.Option<unknown> =>\n pipe(\n parentOf(block),\n Option.filter((fn) => Arr.contains(FUNCTIONS, typeOf(fn))),\n Option.flatMap(parentOf),\n Option.filter((call) => Option.isSome(calleeMatches(scope)(GET_OR_ELSE)(call))),\n Option.flatMap(parentOf),\n );\n\nconst readsThroughOption =\n (scope: Scope, stored: Access) =>\n (node: unknown): boolean =>\n pipe(\n calleeMatches(scope)(OPTION_FROM)(node),\n Option.flatMap(Arr.head),\n Option.flatMap(accessOf(scope)(\"get\")),\n Option.exists(sameEntry(stored)),\n );\n\nconst storesOnce =\n (scope: Scope, stored: Access) =>\n (region: unknown): boolean =>\n pipe(accessesIn(scope)(\"set\")(region), Arr.filter(sameEntry(stored))).length === ONE;\n\nconst returnsOnce = (scope: Scope, block: unknown): boolean =>\n pipe(\n descendants(scope.keys)(block),\n Arr.filter((node) => typeOf(node) === \"ReturnStatement\"),\n ).length === ONE;\n\nconst fallsBackInOption = (scope: Scope, block: unknown, stored: Access): boolean =>\n returnsOnce(scope, block) &&\n Option.exists(\n optionRegion(scope, block),\n (region) =>\n pipe(descendants(scope.keys)(region), Arr.some(readsThroughOption(scope, stored))) &&\n storesOnce(scope, stored)(region),\n );\n\nconst isMemoized = (scope: Scope, block: unknown): boolean =>\n pipe(\n bodyOf(block),\n Option.exists((body) =>\n Option.exists(storedAndReturned(scope, body), (stored) => {\n if (earlyReturn(scope, body, stored)) {\n return storesOnce(scope, stored)(block);\n }\n return fallsBackInOption(scope, block, stored);\n }),\n ),\n );\n\nexport const getOrInsert: Rule = {\n meta: { type: \"suggestion\" },\n create: (context) => {\n const scope: Scope = { text: context.sourceCode.text, keys: context.sourceCode.visitorKeys };\n return {\n IfStatement: (node): void => {\n if (isHasGuard(scope, node)) {\n context.report({ node, message: MESSAGE });\n }\n },\n BlockStatement: (node): void => {\n for (const index of fallbackIndices(scope, node.body)) {\n for (const statement of Option.toArray(Arr.get(node.body, index))) {\n context.report({ node: statement, message: MESSAGE });\n }\n }\n if (isMemoized(scope, node)) {\n context.report({ node, message: MESSAGE });\n }\n },\n };\n },\n};\n","import { Array as Arr, pipe } from \"effect\";\nimport type { Context, ESTree, Rule } from \"vite-plus/lint/plugins\";\n\nconst MESSAGE =\n \"export は宣言に付ける(export const・export function など)。ファイルの末尾で export { … } にまとめない。\";\nconst TYPE = \"type\";\nconst CLASS_NAME = \"ClassName\";\n\nconst isList = (node: ESTree.ExportNamedDeclaration): boolean =>\n node.declaration === null && node.source === null && !Arr.isReadonlyArrayEmpty(node.specifiers);\n\nconst localName = (specifier: ESTree.ExportSpecifier): string => {\n if (specifier.local.type === \"Literal\") {\n return specifier.local.value;\n }\n return specifier.local.name;\n};\n\nconst isClass = (context: Context, name: string): boolean =>\n pipe(\n context.sourceCode.scopeManager.scopes,\n Arr.flatMap((scope) => scope.variables),\n Arr.filter((variable) => variable.name === name),\n Arr.flatMap((variable) => variable.defs),\n (defs) =>\n Arr.isReadonlyArrayNonEmpty(defs) &&\n pipe(\n defs,\n Arr.every(({ type }) => type === CLASS_NAME),\n ),\n );\n\nconst isTypeOnlyClass =\n (context: Context, node: ESTree.ExportNamedDeclaration) =>\n (specifier: ESTree.ExportSpecifier): boolean =>\n (node.exportKind === TYPE || specifier.exportKind === TYPE) &&\n isClass(context, localName(specifier));\n\nexport const inlineExports: Rule = {\n meta: { type: \"suggestion\" },\n create: (context) => ({\n ExportNamedDeclaration: (node): void => {\n if (isList(node) && !pipe(node.specifiers, Arr.every(isTypeOnlyClass(context, node)))) {\n context.report({ node, message: MESSAGE });\n }\n },\n }),\n};\n","import { segments, toPosix } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nconst SOURCE = \"/src/\";\nconst TOOL_LAYERS: readonly string[] = [\"features\", \"shared\"];\nconst TEST_FILE = /\\.test(?:\\.support)?\\.[cm]?[jt]sx?$/u;\nconst METHOD = \"registerTool\";\n\nconst MESSAGE =\n \"Register an MCP tool in the features slice of the operation it performs. A tool is one operation, so app/ only composes the slices' register functions and entities/ only holds the data they share.\";\n\nconst layerIn = (path: string): Option.Option<string> =>\n pipe(\n Str.lastIndexOf(SOURCE)(path),\n Option.map((index) => Arr.headNonEmpty(segments(Str.slice(index + SOURCE.length)(path)))),\n );\n\nconst layerOf = (filename: string): Option.Option<string> => layerIn(toPosix(filename));\n\nconst outsideToolLayers = (filename: string): boolean =>\n !TEST_FILE.test(filename) &&\n Option.exists(layerOf(filename), (layer) => !Arr.contains(TOOL_LAYERS, layer));\n\nexport const mcpToolLayer: Rule = {\n meta: { type: \"problem\" },\n create: (context) => {\n if (!outsideToolLayers(context.filename)) {\n return {};\n }\n return {\n CallExpression: (node): void => {\n const { callee } = node;\n if (\n callee.type === \"MemberExpression\" &&\n callee.property.type === \"Identifier\" &&\n callee.property.name === METHOD\n ) {\n context.report({ node: callee.property, message: MESSAGE });\n }\n },\n };\n },\n};\n","import { Array as Arr, Option, pipe } from \"effect\";\nimport { SymbolFlags } from \"tsrs/sync\";\nimport type { NodeHandle, Project, Symbol as TypeSymbol } from \"tsrs/sync\";\n\nexport type Origin = \"own\" | \"package\" | \"builtin\";\n\nconst origins = new WeakMap<TypeSymbol, Origin>();\nconst readonlyForms = new WeakMap<Project, Map<string, Option.Option<string>>>();\n\nconst fileOrigin = (project: Project, handle: NodeHandle): Option.Option<Origin> =>\n pipe(\n Option.fromNullishOr(project.program.getSourceFileMetadataByPath(handle.path)),\n Option.flatMap(({ isDefaultLibrary, isFromExternalLibrary }): Option.Option<Origin> => {\n if (isDefaultLibrary) {\n return Option.some(\"builtin\");\n }\n if (isFromExternalLibrary) {\n return Option.some(\"package\");\n }\n return Option.none();\n }),\n );\n\nconst declarationOrigin =\n (project: Project) =>\n (handle: NodeHandle): Origin =>\n pipe(\n fileOrigin(project, handle),\n Option.orElse(() =>\n pipe(\n Option.fromNullishOr(handle.resolve(project)),\n Option.filter((node) => node.getSourceFile().isDeclarationFile),\n Option.as<Origin>(\"package\"),\n ),\n ),\n Option.getOrElse((): Origin => \"own\"),\n );\n\nexport const originOf =\n (project: Project) =>\n (symbol: TypeSymbol): Origin =>\n origins.getOrInsertComputed(symbol, () => {\n const found = pipe(symbol.declarations, Arr.map(declarationOrigin(project)));\n if (Arr.contains(found, \"builtin\")) {\n return \"builtin\";\n }\n if (Arr.contains(found, \"package\")) {\n return \"package\";\n }\n return \"own\";\n });\n\nconst builtinNamed =\n (project: Project) =>\n (name: string): Option.Option<string> =>\n pipe(\n Option.fromNullishOr(project.checker.resolveName(name, SymbolFlags.Type)),\n Option.filter((symbol) => originOf(project)(symbol) === \"builtin\"),\n Option.as(name),\n );\n\nexport const readonlyFormOf =\n (project: Project) =>\n (name: string): Option.Option<string> =>\n readonlyForms\n .getOrInsertComputed(project, () => new Map<string, Option.Option<string>>())\n .getOrInsertComputed(name, () =>\n pipe([`Readonly${name}`, `${name}ReadOnly`], Arr.findFirst(builtinNamed(project))),\n );\n","import { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Checker, Project, Symbol as TypeSymbol, Type } from \"tsrs/sync\";\n\nimport { originOf, readonlyFormOf } from \"./declared-outside.ts\";\nimport type { Origin } from \"./declared-outside.ts\";\n\nexport type Mutability =\n | { readonly kind: \"array\" }\n | { readonly kind: \"tuple\" }\n | { readonly kind: \"property\" }\n | { readonly kind: \"index\" }\n | { readonly kind: \"form\"; readonly name: string; readonly readonlyName: string };\n\nexport interface WritablePart {\n readonly path: readonly string[];\n readonly mutability: Mutability;\n}\n\ntype Found = Option.Option<WritablePart>;\n\ninterface Search {\n readonly project: Project;\n readonly partOf: (type: Type) => Found;\n}\n\nexport const ELEMENT = \"[]\";\n\nconst MUTABLE_ARRAY = \"Array\";\nconst PRIVATE_NAME = \"__#\";\nconst SYMBOL_NAME = \"__@\";\n\nconst here = (mutability: Mutability): Found => Option.some({ path: [], mutability });\n\nconst under =\n (segment: string) =>\n (part: WritablePart): WritablePart => ({ ...part, path: [segment, ...part.path] });\n\nconst firstPart = (search: Search, types: readonly Type[]): Found =>\n pipe(types, Arr.findFirst(search.partOf));\n\nconst formOf =\n (project: Project) =>\n (name: string): Found =>\n pipe(\n readonlyFormOf(project)(name),\n Option.flatMap((readonlyName) => here({ kind: \"form\", name, readonlyName })),\n );\n\nconst isOpaqueAlias = (project: Project, type: Type): boolean =>\n pipe(\n Option.fromNullishOr(type.getAliasSymbol()),\n Option.exists((alias) => {\n const origin = originOf(project)(alias);\n return (\n origin === \"package\" ||\n (origin === \"builtin\" && Arr.isReadonlyArrayEmpty(type.getAliasTypeArguments()))\n );\n }),\n );\n\nconst isNamed = (type: Type): boolean =>\n type.isClassOrInterface() || (type.isTypeReference() && type.getTarget().isClassOrInterface());\n\nconst declaredOutside = (project: Project, type: Type): Option.Option<Found> =>\n pipe(\n Option.fromNullishOr(type.getSymbol()),\n Option.flatMap((symbol): Option.Option<Found> => {\n const origin = originOf(project)(symbol);\n if (origin === \"package\") {\n return Option.some(Option.none());\n }\n if (origin === \"own\" || !isNamed(type)) {\n return Option.none();\n }\n return Option.some(formOf(project)(symbol.name));\n }),\n );\n\nconst isOutside = (project: Project, type: Type): boolean =>\n isOpaqueAlias(project, type) ||\n (type.isObjectType() && Option.exists(declaredOutside(project, type), Option.isNone));\n\nconst sourceOf = (type: Type): Option.Option<Type> => {\n if (!type.isMappedType()) {\n return Option.none();\n }\n const template = type.getTemplateType();\n if (!template.isIndexedAccessType()) {\n return Option.none();\n }\n return Option.some(template.getObjectType());\n};\n\nconst takenFromOutside =\n (project: Project) =>\n (type: Type): readonly string[] => {\n if (isOutside(project, type)) {\n return pipe(\n type.getProperties(),\n Arr.map((property) => property.name),\n );\n }\n if (type.isUnionType() || type.isIntersectionType()) {\n return pipe(type.getTypes(), Arr.flatMap(takenFromOutside(project)));\n }\n return pipe(\n sourceOf(type),\n Option.map(takenFromOutside(project)),\n Option.getOrElse((): readonly string[] => []),\n );\n };\n\nconst elementsPart = (search: Search, type: Type): Found => {\n if (!type.isTypeReference()) {\n return Option.none();\n }\n return pipe(\n firstPart(search, search.project.checker.getTypeArguments(type)),\n Option.map(under(ELEMENT)),\n );\n};\n\nconst arrayPart = (search: Search, type: Type): Found => {\n const mutable = pipe(\n Option.fromNullishOr(type.getSymbol()),\n Option.exists((symbol) => symbol.name === MUTABLE_ARRAY),\n );\n if (mutable) {\n return here({ kind: \"array\" });\n }\n return elementsPart(search, type);\n};\n\nconst tuplePart = (search: Search, type: Type): Found => {\n if (type.isTupleType() && !type.getTarget().readonly) {\n return here({ kind: \"tuple\" });\n }\n return elementsPart(search, type);\n};\n\nconst named =\n (prefix: string) =>\n (property: TypeSymbol): boolean =>\n pipe(String(property.escapedName), Str.startsWith(prefix));\n\nconst isWritable =\n (checker: Checker) =>\n (property: TypeSymbol): boolean =>\n !checker.isReadonlySymbol(property) && !named(PRIVATE_NAME)(property);\n\nconst isStringNamed = (property: TypeSymbol): boolean =>\n !named(PRIVATE_NAME)(property) && !named(SYMBOL_NAME)(property);\n\nconst declaredIn =\n (project: Project, origin: Origin) =>\n (property: TypeSymbol): boolean =>\n originOf(project)(property) === origin;\n\nconst inheritedForm =\n (project: Project) =>\n (property: TypeSymbol): Found =>\n pipe(\n Option.fromNullishOr(property.getParent()),\n Option.flatMap((owner) => formOf(project)(owner.name)),\n );\n\nconst propertyTypesPart = (search: Search, properties: readonly TypeSymbol[]): Found => {\n const judged = pipe(properties, Arr.filter(isStringNamed));\n return pipe(\n Arr.zip(judged, search.project.checker.getTypeOfSymbol(judged)),\n Arr.findFirst(([property, type]) =>\n pipe(search.partOf(type), Option.map(under(property.name))),\n ),\n );\n};\n\nconst indexPart = (search: Search, type: Type): Found =>\n pipe(\n type.getIndexInfos(),\n Arr.findFirst((info) => {\n if (!info.isReadonly) {\n return here({ kind: \"index\" });\n }\n return pipe(search.partOf(info.valueType), Option.map(under(ELEMENT)));\n }),\n );\n\nconst membersPart = (search: Search, type: Type): Found => {\n const { project } = search;\n const properties = type.getProperties();\n const taken = pipe(\n sourceOf(type),\n Option.map(takenFromOutside(project)),\n Option.getOrElse((): readonly string[] => []),\n );\n const own = pipe(\n properties,\n Arr.filter(\n (property) => declaredIn(project, \"own\")(property) && !Arr.contains(taken, property.name),\n ),\n );\n return pipe(\n own,\n Arr.findFirst(isWritable(project.checker)),\n Option.map((property): WritablePart => ({\n path: [property.name],\n mutability: { kind: \"property\" },\n })),\n Option.orElse(() =>\n pipe(\n properties,\n Arr.filter(declaredIn(project, \"builtin\")),\n Arr.findFirst(inheritedForm(project)),\n ),\n ),\n Option.orElse(() => propertyTypesPart(search, own)),\n Option.orElse(() => indexPart(search, type)),\n );\n};\n\nconst isFunction = (type: Type): boolean =>\n Arr.isReadonlyArrayNonEmpty(type.getCallSignatures()) &&\n Arr.isReadonlyArrayEmpty(type.getProperties());\n\nconst objectPart = (search: Search, type: Type): Found => {\n if (isFunction(type)) {\n return Option.none();\n }\n if (search.project.checker.isArrayType(type)) {\n return arrayPart(search, type);\n }\n if (type.isTupleType()) {\n return tuplePart(search, type);\n }\n return pipe(\n declaredOutside(search.project, type),\n Option.getOrElse(() => membersPart(search, type)),\n );\n};\n\nconst typePart = (search: Search, type: Type): Found => {\n if (isOpaqueAlias(search.project, type)) {\n return Option.none();\n }\n if (type.isUnionType() || type.isIntersectionType()) {\n return firstPart(search, type.getTypes());\n }\n if (type.isConditionalType()) {\n return firstPart(search, [type.getTrueType(), type.getFalseType()]);\n }\n if (!type.isObjectType()) {\n return Option.none();\n }\n return objectPart(search, type);\n};\n\nexport const writablePartOf =\n (project: Project) =>\n (type: Type): Option.Option<WritablePart> => {\n const seen = new Set<Type>();\n const partOf = (inner: Type): Found => {\n if (seen.has(inner)) {\n return Option.none();\n }\n seen.add(inner);\n return typePart({ project, partOf }, inner);\n };\n return partOf(type);\n };\n","import type { ParserServices, TypedContext } from \"@r_masseater/oxlint-typed-rules\";\nimport { Array as Arr, Match, Option, String as Str, pipe } from \"effect\";\nimport type { Node } from \"tsrs/ast\";\nimport { isTypeNode } from \"tsrs/ast/is\";\nimport type { Type } from \"tsrs/sync\";\nimport type { ESTree, Rule, Visitor } from \"vite-plus/lint/plugins\";\n\nimport { typedRuleOf } from \"./typed-rule.ts\";\nimport { ELEMENT, writablePartOf } from \"./writable-part.ts\";\nimport type { Mutability, WritablePart } from \"./writable-part.ts\";\n\nconst MESSAGE =\n \"A function must not be able to change its arguments, but {{part}}. Declare the parameter with a read-only type. Types declared by a package or by the language are exempt unless the language has a read-only form of them.\";\nconst MESSAGE_ID = \"shouldBeReadonly\";\nconst WHOLE = \"the type\";\nconst SEPARATOR = \".\";\nconst TAGGABLE: readonly string[] = [\"string\", \"number\", \"bigint\"];\n\ntype Annotated = ESTree.FormalParameter | ESTree.FormalParameterRest;\n\ntype FunctionLike =\n | ESTree.ArrowFunctionExpression\n | ESTree.Function\n | ESTree.TSCallSignatureDeclaration\n | ESTree.TSConstructSignatureDeclaration\n | ESTree.TSFunctionType\n | ESTree.TSMethodSignature;\n\nconst isBrandObject = (type: Type): boolean =>\n type.isObjectType() &&\n Arr.isReadonlyArrayEmpty(type.getCallSignatures()) &&\n Arr.isReadonlyArrayEmpty(type.getConstructSignatures());\n\nconst isTaggable = (type: Type): boolean =>\n type.isLiteralType() ||\n type.isTemplateLiteralType() ||\n (type.isIntrinsicType() && Arr.contains(TAGGABLE, type.intrinsicName));\n\nconst isBrandedLiteral = (type: Type): boolean => {\n if (!type.isIntersectionType()) {\n return false;\n }\n const parts = type.getTypes();\n const objects = pipe(parts, Arr.filter(isBrandObject));\n const primitives = pipe(parts, Arr.filter(isTaggable));\n return (\n Arr.isReadonlyArrayNonEmpty(objects) &&\n Arr.isReadonlyArrayNonEmpty(primitives) &&\n objects.length + primitives.length === parts.length\n );\n};\n\nconst isBrandedLiteralLike = (type: Type): boolean => {\n if (type.isUnionType()) {\n return pipe(type.getTypes(), Arr.every(isBrandedLiteral));\n }\n return isBrandedLiteral(type);\n};\n\nconst outermost = (node: Node): Node =>\n pipe(\n Option.fromNullishOr(node.parent),\n Option.filter((parent) => parent.getStart() === node.getStart() && parent.end === node.end),\n Option.match({ onNone: () => node, onSome: outermost }),\n );\n\nconst unwrapped = (parameter: ESTree.ParamPattern): Annotated => {\n if (parameter.type === \"TSParameterProperty\") {\n return parameter.parameter;\n }\n return parameter;\n};\n\nconst annotationOf = (parameter: Annotated): Option.Option<ESTree.TSTypeAnnotation> => {\n if (parameter.type === \"AssignmentPattern\") {\n return Option.fromNullishOr(parameter.left.typeAnnotation);\n }\n return Option.fromNullishOr(parameter.typeAnnotation);\n};\n\nconst annotatedType = (services: ParserServices, parameter: Annotated): Option.Option<Type> =>\n pipe(\n annotationOf(parameter),\n Option.map((annotation) =>\n outermost(services.esTreeNodeToTSNodeMap.get(annotation.typeAnnotation)),\n ),\n Option.filter(isTypeNode),\n Option.map((node) => services.program.native.checker.getTypeFromTypeNode(node)),\n );\n\nconst subjectOf = (path: readonly string[]): string => {\n if (Arr.isReadonlyArrayEmpty(path)) {\n return WHOLE;\n }\n return `\\`${pipe(Arr.join(path, SEPARATOR), Str.replaceAll(`${SEPARATOR}${ELEMENT}`, ELEMENT))}\\``;\n};\n\nconst predicateOf = Match.type<Mutability>().pipe(\n Match.discriminatorsExhaustive(\"kind\")({\n array: () => \"is a mutable array\",\n tuple: () => \"is a mutable tuple\",\n property: () => \"is writable\",\n index: () => \"has a writable index signature\",\n form: ({ name, readonlyName }) =>\n `is a \\`${name}\\`, which has the read-only form \\`${readonlyName}\\``,\n }),\n);\n\nconst describe = ({ path, mutability }: WritablePart): string =>\n `${subjectOf(path)} ${predicateOf(mutability)}`;\n\nconst visitorOf = (context: TypedContext, services: ParserServices): Visitor => {\n const partOf = writablePartOf(services.program.native);\n const check = ({ params }: FunctionLike): void => {\n for (const parameter of pipe(params, Arr.map(unwrapped))) {\n const part = pipe(\n annotatedType(services, parameter),\n Option.filter((type) => !isBrandedLiteralLike(type)),\n Option.flatMap(partOf),\n );\n if (Option.isSome(part)) {\n context.report({\n node: parameter,\n messageId: MESSAGE_ID,\n data: { part: describe(part.value) },\n });\n }\n }\n };\n return {\n ArrowFunctionExpression: check,\n FunctionDeclaration: check,\n FunctionExpression: check,\n TSCallSignatureDeclaration: check,\n TSConstructSignatureDeclaration: check,\n TSDeclareFunction: check,\n TSEmptyBodyFunctionExpression: check,\n TSFunctionType: check,\n TSMethodSignature: check,\n };\n};\n\nexport const readonlyParameters: Rule = typedRuleOf({\n meta: { type: \"suggestion\", messages: { [MESSAGE_ID]: MESSAGE } },\n visitorOf,\n});\n","import { Array as Arr, Option, Schema, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nconst MESSAGE =\n \"Select min and max in separate queries. SQLite uses an index for a lone min or max only, so one select with both reads every row in the range, and D1 bills each row read.\";\n\nconst AGGREGATES = [\"min\", \"max\"] as const;\n\ntype Aggregate = (typeof AGGREGATES)[number];\n\nconst AggregateCallSchema = Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: Schema.Struct({\n type: Schema.Literal(\"Identifier\"),\n name: Schema.Literals(AGGREGATES),\n }),\n});\n\nconst PropertySchema = Schema.Struct({\n type: Schema.Literal(\"Property\"),\n value: Schema.Unknown,\n});\n\nconst SelectMemberSchema = Schema.Struct({\n type: Schema.Literal(\"MemberExpression\"),\n computed: Schema.Literal(false),\n property: Schema.Struct({\n type: Schema.Literal(\"Identifier\"),\n name: Schema.Literal(\"select\"),\n }),\n});\n\nconst decodeSelect = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: SelectMemberSchema,\n arguments: Schema.Array(Schema.Unknown),\n }),\n);\n\nconst decodeFields = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"ObjectExpression\"),\n properties: Schema.Array(Schema.Unknown),\n }),\n);\n\nconst decodeProperty = Schema.decodeUnknownOption(PropertySchema);\nconst decodeAggregate = Schema.decodeUnknownOption(AggregateCallSchema);\n\nconst aggregateNameOf = (field: unknown): Option.Option<Aggregate> =>\n pipe(\n decodeProperty(field),\n Option.flatMap((property) => decodeAggregate(property.value)),\n Option.map((call) => call.callee.name),\n );\n\nconst aggregatesOf = (fields: readonly unknown[]): readonly Aggregate[] =>\n pipe(fields, Arr.map(aggregateNameOf), Arr.getSomes);\n\nconst selectsBoth = (node: unknown): boolean =>\n pipe(\n decodeSelect(node),\n Option.flatMap((call) => Arr.head(call.arguments)),\n Option.flatMap(decodeFields),\n Option.map((fields) => aggregatesOf(fields.properties)),\n Option.exists((found) => Arr.contains(found, \"min\") && Arr.contains(found, \"max\")),\n );\n\nexport const separateMinMax: Rule = {\n meta: { type: \"problem\" },\n create: (context) => ({\n CallExpression: (node): void => {\n if (selectsBoth(node)) {\n context.report({ node, message: MESSAGE });\n }\n },\n }),\n};\n","import { Array as Arr, Option, Predicate, Schema, String as Str, pipe } from \"effect\";\nimport type { Context, ESTree } from \"vite-plus/lint/plugins\";\n\nexport const SAY = \"say\";\nexport const CUTS = \"cuts\";\n\nexport type Property = ESTree.ObjectProperty;\nexport type StringLiteral = ESTree.StringLiteral;\nexport type ObjectExpression = ESTree.ObjectExpression;\nexport type Range = [number, number];\n\nconst START = 0;\nconst END = 1;\nconst NEXT = 1;\n\nexport const keyOf = (property: ObjectExpression[\"properties\"][number]): Option.Option<string> => {\n if (property.type !== \"Property\" || property.computed) {\n return Option.none();\n }\n if (property.key.type === \"Identifier\") {\n return Option.some(property.key.name);\n }\n if (property.key.type === \"Literal\" && Predicate.isString(property.key.value)) {\n return Option.some(property.key.value);\n }\n return Option.none();\n};\n\nexport const propertyOf =\n (key: string) =>\n (object: ObjectExpression): Option.Option<Property> =>\n Arr.findFirst(\n object.properties,\n (property): property is Property =>\n property.type === \"Property\" && Option.contains(keyOf(property), key),\n );\n\nexport const propertiesOf = (object: ObjectExpression): readonly Property[] =>\n pipe(\n object.properties,\n Arr.filter((property): property is Property => property.type === \"Property\"),\n );\n\nexport const isStringLiteral = (node: unknown): node is StringLiteral =>\n Predicate.hasProperty(node, \"type\") &&\n node[\"type\"] === \"Literal\" &&\n Predicate.hasProperty(node, \"value\") &&\n Predicate.isString(node[\"value\"]);\n\nconst unwrapped = (node: ESTree.Node): ESTree.Node => {\n if (\n node.type === \"TSAsExpression\" ||\n node.type === \"TSSatisfiesExpression\" ||\n node.type === \"TSNonNullExpression\"\n ) {\n return unwrapped(node.expression);\n }\n return node;\n};\n\nexport const asObject = (node: ESTree.Node): Option.Option<ObjectExpression> =>\n Option.liftPredicate(\n unwrapped(node),\n (value): value is ObjectExpression => value.type === \"ObjectExpression\",\n );\n\nexport const asArray = (node: ESTree.Node): Option.Option<ESTree.ArrayExpression> =>\n Option.liftPredicate(\n unwrapped(node),\n (value): value is ESTree.ArrayExpression => value.type === \"ArrayExpression\",\n );\n\nexport const stringsOf = (node: ESTree.Node): readonly StringLiteral[] =>\n pipe(\n asArray(node),\n Option.map(({ elements }) => pipe(elements, Arr.filter(isStringLiteral))),\n Option.getOrElse(() => []),\n );\n\nexport const saidOf = (property: Property): readonly StringLiteral[] => {\n if (!Option.contains(keyOf(property), SAY)) {\n return [];\n }\n return stringsOf(property.value);\n};\n\nexport const quotedOf = (text: string): string =>\n pipe(\n text,\n Str.replaceAll(\"\\\\\", String.raw`\\\\`),\n Str.replaceAll('\"', String.raw`\\\"`),\n Str.replaceAll(\"\\n\", String.raw`\\n`),\n (escaped) => `\"${escaped}\"`,\n );\n\nexport const removedRange = ({\n object,\n property,\n}: Readonly<{ object: ObjectExpression; property: Property }>): Range => {\n const index = object.properties.indexOf(property);\n const next = Arr.get(object.properties, index + NEXT);\n if (Option.isSome(next)) {\n return [property.range[START], next.value.range[START]];\n }\n return pipe(\n Arr.get(object.properties, index - NEXT),\n Option.map((previous): Range => [previous.range[END], property.range[END]]),\n Option.getOrElse((): Range => [property.range[START], property.range[END]]),\n );\n};\n\ntype TopLevel = ESTree.Program[\"body\"][number];\n\nconst declaratorsOf = (statement: TopLevel): readonly ESTree.VariableDeclarator[] => {\n if (statement.type === \"VariableDeclaration\") {\n return statement.declarations;\n }\n if (statement.type === \"ExportNamedDeclaration\") {\n return pipe(\n Option.fromNullishOr(statement.declaration),\n Option.filter(\n (declaration): declaration is ESTree.VariableDeclaration =>\n declaration.type === \"VariableDeclaration\",\n ),\n Option.map(({ declarations }) => declarations),\n Option.getOrElse(() => []),\n );\n }\n return [];\n};\n\nconst declaredArray = (context: Context, name: string): Option.Option<ESTree.ArrayExpression> =>\n pipe(\n context.sourceCode.ast.body,\n Arr.flatMap(declaratorsOf),\n Arr.findFirst(({ id }) => id.type === \"Identifier\" && id.name === name),\n Option.flatMap(({ init }) => Option.fromNullishOr(init)),\n Option.flatMap(asArray),\n );\n\nconst objectsOf = ({ elements }: ESTree.ArrayExpression): readonly ObjectExpression[] =>\n pipe(\n elements,\n Arr.filter(Predicate.isNotNull),\n Arr.flatMap((element) => Option.toArray(asObject(element))),\n );\n\nconst cutArrayOf =\n (context: Context) =>\n ({ value }: Property): Option.Option<ESTree.ArrayExpression> => {\n if (value.type === \"Identifier\") {\n return declaredArray(context, value.name);\n }\n return asArray(value);\n };\n\nexport const cutsOf = ({\n context,\n script,\n}: Readonly<{ context: Context; script: ObjectExpression }>): readonly ObjectExpression[] =>\n pipe(\n propertyOf(CUTS)(script),\n Option.flatMap(cutArrayOf(context)),\n Option.map(objectsOf),\n Option.getOrElse(() => []),\n );\n\nexport const Texts = Schema.Record(Schema.String, Schema.String);\n\nexport const optionsWith =\n <Value>({ schema, fallback }: Readonly<{ schema: Schema.Decoder<Value>; fallback: Value }>) =>\n (options: readonly unknown[]): Value =>\n pipe(\n Arr.head(options),\n Option.flatMap(Schema.decodeUnknownOption(schema)),\n Option.getOrElse(() => fallback),\n );\n","import { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nimport type { ObjectExpression, StringLiteral } from \"./video-script-ast.ts\";\nimport { asObject, keyOf, propertiesOf, saidOf } from \"./video-script-ast.ts\";\n\nconst UNREAD = \"unread\";\nconst MESSAGES = {\n [UNREAD]:\n \"英字の語「{{word}}」の読みが readings にない。VOICEVOX は英字を1文字ずつ読むことがある\",\n} as const;\n\nconst READINGS = \"readings\";\nconst RUBY = /\\{[^}]*\\}/gu;\nconst WORD = /[A-Za-z][A-Za-z0-9+#.-]*/gu;\n\nconst isRead =\n (keys: readonly string[]) =>\n (word: string): boolean =>\n pipe(\n keys,\n Arr.some((key) => Str.includes(key)(word) || Str.includes(word)(key)),\n );\n\nconst wordsOf = (say: string): readonly string[] =>\n pipe(\n Str.replaceAll(RUBY, Str.empty)(say),\n Str.matchAll(WORD),\n Arr.fromIterable,\n Arr.map(([word]) => word),\n Arr.dedupe,\n );\n\nconst keysOf = ({ properties }: ObjectExpression): readonly string[] =>\n pipe(\n properties,\n Arr.flatMap((property) => Option.toArray(keyOf(property))),\n );\n\nexport const videoReadings: Rule = {\n meta: { type: \"problem\", messages: MESSAGES },\n create: (context) => {\n const keys: string[] = [];\n const said: StringLiteral[] = [];\n return {\n ObjectExpression: (object): void => {\n for (const node of propertiesOf(object)) {\n said.push(...saidOf(node));\n if (Option.contains(keyOf(node), READINGS)) {\n keys.push(...pipe(asObject(node.value), Option.toArray, Arr.flatMap(keysOf)));\n }\n }\n },\n \"Program:exit\": (): void => {\n for (const literal of said) {\n for (const word of pipe(\n wordsOf(literal.value),\n Arr.filter((candidate) => !isRead(keys)(candidate)),\n )) {\n context.report({ node: literal, messageId: UNREAD, data: { word } });\n }\n }\n },\n };\n },\n};\n","import { Array as Arr, Record as Rec, Schema, String as Str, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nimport type { StringLiteral } from \"./video-script-ast.ts\";\nimport { Texts, optionsWith, propertiesOf, quotedOf, saidOf } from \"./video-script-ast.ts\";\n\nconst FIX = \"fix\";\nconst BANNED = \"banned\";\nconst EMPHASIS = \"emphasis\";\n\nconst MESSAGES = {\n [FIX]:\n \"「{{say}}」は日本語と英数字の間に空白があるか、決まった言葉を言い換えている。「{{fixed}}」と書く\",\n [BANNED]: \"「{{say}}」に「{{word}}」がある。{{instead}}\",\n [EMPHASIS]: \"「{{say}}」の太字(**)が{{count}}か所ある。{{max}}か所までにする\",\n} as const;\n\nconst JAPANESE = String.raw`[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}ー々、。!?」』)]`;\nconst LATIN = \"[A-Za-z0-9]\";\nconst SPACE = \"[  ]+\";\nconst AFTER_JAPANESE = new RegExp(`(?<head>${JAPANESE}[*}]*)${SPACE}(?<tail>[*{]*${LATIN})`, \"gu\");\nconst BEFORE_JAPANESE = new RegExp(`(?<head>${LATIN}[*}]*)${SPACE}(?<tail>[*{]*${JAPANESE})`, \"gu\");\nconst KEPT = \"$<head>$<tail>\";\nconst OUTSIDE_RUBY = String.raw`(?![^{]*\\})`;\nconst EMPHASIZED = /\\*\\*[^*]+\\*\\*/gu;\nconst SPECIAL = /[.*+?^${}()|[\\]\\\\]/gu;\nconst ESCAPED = String.raw`\\$&`;\nconst DEFAULT_MAX = 1;\n\nconst OptionsSchema = Schema.Struct({\n terms: Schema.optional(Texts),\n banned: Schema.optional(Texts),\n maxEmphasis: Schema.optional(Schema.Finite),\n});\n\nconst optionsOf = optionsWith({ schema: OptionsSchema, fallback: {} });\n\nconst unspacedOf = (say: string): string =>\n pipe(say, Str.replaceAll(AFTER_JAPANESE, KEPT), Str.replaceAll(BEFORE_JAPANESE, KEPT));\n\nconst outsideRuby = (word: string): RegExp =>\n new RegExp(`${Str.replaceAll(SPECIAL, ESCAPED)(word)}${OUTSIDE_RUBY}`, \"gu\");\n\nconst termedOf =\n (terms: Readonly<Record<string, string>>) =>\n (say: string): string =>\n Arr.reduce(Rec.toEntries(terms), say, (text, [vague, precise]) =>\n Str.replaceAll(outsideRuby(vague), precise)(text),\n );\n\nconst emphasisCount = (say: string): number =>\n Arr.fromIterable(Str.matchAll(EMPHASIZED)(say)).length;\n\nexport const videoSay: Rule = {\n meta: {\n type: \"suggestion\",\n fixable: \"code\",\n messages: MESSAGES,\n schema: [{ type: \"object\", additionalProperties: true }],\n },\n create: (context) => {\n const { terms = {}, banned = {}, maxEmphasis = DEFAULT_MAX } = optionsOf(context.options);\n const check = (literal: StringLiteral): void => {\n const say = literal.value;\n const fixed = termedOf(terms)(unspacedOf(say));\n if (fixed !== say) {\n context.report({\n node: literal,\n messageId: FIX,\n data: { say, fixed },\n fix: (fixer) => fixer.replaceText(literal, quotedOf(fixed)),\n });\n }\n for (const [word, instead] of Rec.toEntries(banned)) {\n if (Str.includes(word)(say)) {\n context.report({ node: literal, messageId: BANNED, data: { say, word, instead } });\n }\n }\n const count = emphasisCount(say);\n if (count > maxEmphasis) {\n context.report({\n node: literal,\n messageId: EMPHASIS,\n data: { say, count: String(count), max: String(maxEmphasis) },\n });\n }\n };\n return {\n ObjectExpression: (node): void => {\n for (const literal of pipe(propertiesOf(node), Arr.flatMap(saidOf))) {\n check(literal);\n }\n },\n };\n },\n};\n","import { Array as Arr, Option, Record as Rec, pipe } from \"effect\";\nimport type { Context, ESTree } from \"vite-plus/lint/plugins\";\n\nimport type { ObjectExpression, Property } from \"./video-script-ast.ts\";\nimport { asObject, propertyOf } from \"./video-script-ast.ts\";\n\nconst START = 0;\nconst NEXT = 1;\n\nexport interface ValuesCheck {\n readonly context: Context;\n readonly object: ObjectExpression;\n readonly values: Readonly<Record<string, string>>;\n readonly name: string;\n readonly before: Option.Option<ESTree.Node>;\n}\n\nexport const textOf =\n (context: Context) =>\n (node: ESTree.Node): string =>\n context.sourceCode.getText(node);\n\nconst valueTarget = (property: Property): ESTree.Node =>\n pipe(\n asObject(property.value),\n Option.flatMap(({ properties }) =>\n Arr.findFirst(\n properties,\n (part): part is ESTree.SpreadElement => part.type === \"SpreadElement\",\n ),\n ),\n Option.match({ onNone: () => property.value, onSome: ({ argument }) => argument }),\n );\n\nconst reportMissing = (\n { context, object, before }: ValuesCheck,\n {\n key,\n expected,\n data,\n }: Readonly<{ key: string; expected: string; data: Readonly<Record<string, string>> }>,\n): void => {\n context.report({\n node: object,\n messageId: \"value\",\n data,\n fix: (fixer) =>\n Option.match(before, {\n onNone: () =>\n fixer.insertTextAfterRange(\n [object.range[START], object.range[START] + NEXT],\n ` ${key}: ${expected},`,\n ),\n onSome: (node) => fixer.insertTextBefore(node, `${key}: ${expected},\\n `),\n }),\n });\n};\n\nconst checkValue =\n (check: ValuesCheck) =>\n ([key, expected]: readonly [string, string]): void => {\n const { context, object, name } = check;\n const data = { series: name, key, expected };\n const property = propertyOf(key)(object);\n if (Option.isNone(property)) {\n reportMissing(check, { key, expected, data });\n return;\n }\n const target = valueTarget(property.value);\n if (textOf(context)(target) !== expected) {\n context.report({\n node: target,\n messageId: \"value\",\n data,\n fix: (fixer) => fixer.replaceText(target, expected),\n });\n }\n };\n\nexport const checkValues = (check: ValuesCheck): void => {\n for (const entry of Rec.toEntries(check.values)) {\n checkValue(check)(entry);\n }\n};\n","import { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Context } from \"vite-plus/lint/plugins\";\n\nimport type { VideoIntro } from \"#/shared/config/index.ts\";\n\nimport type { ObjectExpression, StringLiteral } from \"./video-script-ast.ts\";\nimport {\n SAY,\n cutsOf,\n isStringLiteral,\n propertyOf,\n quotedOf,\n removedRange,\n stringsOf,\n} from \"./video-script-ast.ts\";\nimport { checkValues } from \"./video-values.ts\";\n\nexport type IntroRule = VideoIntro;\n\nexport interface IntroCheck {\n readonly context: Context;\n readonly script: ObjectExpression;\n readonly name: string;\n readonly rule: IntroRule;\n}\n\nconst ID = \"id\";\nconst AT = \"at\";\nconst INTRO = \"intro\";\nconst PART = \"|\";\nconst NEXT = 1;\n\nconst isIntro = (cut: ObjectExpression): boolean =>\n pipe(\n propertyOf(ID)(cut),\n Option.exists(({ value }) => isStringLiteral(value) && value.value === INTRO),\n );\n\nconst partedLines = (cut: ObjectExpression): readonly StringLiteral[] =>\n pipe(\n propertyOf(SAY)(cut),\n Option.map(({ value }) => stringsOf(value)),\n Option.getOrElse((): readonly StringLiteral[] => []),\n Arr.filter(({ value }) => Str.includes(PART)(value)),\n );\n\nconst checkBeats = ({ context, name }: IntroCheck, cut: ObjectExpression): void => {\n if (Option.isNone(propertyOf(AT)(cut)) || Arr.isReadonlyArrayEmpty(partedLines(cut))) {\n context.report({ node: cut, messageId: \"beats\", data: { series: name } });\n }\n};\n\nconst checkPlain = ({ context, name }: IntroCheck, cut: ObjectExpression): void => {\n const data = { series: name };\n for (const property of Option.toArray(propertyOf(AT)(cut))) {\n context.report({\n node: property,\n messageId: \"plainBeats\",\n data,\n fix: (fixer) => fixer.removeRange(removedRange({ object: cut, property })),\n });\n }\n for (const line of partedLines(cut)) {\n context.report({\n node: line,\n messageId: \"plainParts\",\n data,\n fix: (fixer) =>\n fixer.replaceText(line, quotedOf(Str.replaceAll(PART, Str.empty)(line.value))),\n });\n }\n};\n\nexport const checkIntro = (check: IntroCheck): void => {\n const { context, script, name, rule } = check;\n const intro = Arr.findFirst(cutsOf({ context, script }), isIntro);\n if (Option.isNone(intro)) {\n context.report({ node: script, messageId: \"noIntro\", data: { series: name } });\n return;\n }\n if (rule === \"beats\") {\n checkBeats(check, intro.value);\n return;\n }\n checkPlain(check, intro.value);\n};\n\nexport interface AfterIntroCheck {\n readonly context: Context;\n readonly script: ObjectExpression;\n readonly name: string;\n readonly values: Readonly<Record<string, string>>;\n}\n\nexport const checkIntroValues = ({ context, script, name, values }: AfterIntroCheck): void => {\n for (const cut of Option.toArray(Arr.findFirst(cutsOf({ context, script }), isIntro))) {\n checkValues({ context, object: cut, values, name, before: Option.none() });\n }\n};\n\nexport const checkAfterIntro = ({ context, script, name, values }: AfterIntroCheck): void => {\n const cuts = cutsOf({ context, script });\n const next = pipe(\n Arr.findFirstIndex(cuts, isIntro),\n Option.flatMap((index) => Arr.get(cuts, index + NEXT)),\n );\n for (const cut of Option.toArray(next)) {\n checkValues({ context, object: cut, values, name, before: Option.none() });\n }\n};\n","import { Array as Arr, Option, Record as Rec, Schema, pipe } from \"effect\";\nimport type { Context, ESTree, Rule } from \"vite-plus/lint/plugins\";\n\nimport { VIDEO_INTROS } from \"#/shared/config/index.ts\";\n\nimport { checkAfterIntro, checkIntro, checkIntroValues } from \"./video-intro.ts\";\nimport type { ObjectExpression } from \"./video-script-ast.ts\";\nimport {\n CUTS,\n Texts,\n cutsOf,\n isStringLiteral,\n keyOf,\n optionsWith,\n propertiesOf,\n propertyOf,\n removedRange,\n} from \"./video-script-ast.ts\";\nimport { checkValues, textOf } from \"./video-values.ts\";\n\nconst MESSAGES = {\n unknown: \"series「{{series}}」の決まりがない。{{known}} のどれかにする\",\n value: \"{{series}} の {{key}} は {{expected}} にする\",\n banned: \"{{key}} を使わない。{{reason}}\",\n voice: \"{{series}} に出ない話者 {{voice}} が話している\",\n opener: \"{{series}} の最初の台詞は {{voice}} が言う\",\n closer: \"{{series}} の最後の台詞は {{voice}} が言う\",\n noIntro: \"{{series}} は最初のカットを intro にする\",\n plainBeats: \"{{series}} のイントロは音ハメしない。at を外す\",\n plainParts: \"{{series}} のイントロは句に分けず、1つの台詞で読む\",\n beats: \"{{series}} のイントロは「|」で句に分け、at で各句の頭を拍に置く\",\n} as const;\n\nconst SERIES = \"series\";\nconst VOICE = \"voice\";\n\nconst SeriesSchema = Schema.Struct({\n values: Schema.optional(Texts),\n voices: Schema.String.pipe(Schema.Array, Schema.optional),\n opener: Schema.optional(Schema.String),\n closer: Schema.optional(Schema.String),\n intro: Schema.optional(Schema.Literals(VIDEO_INTROS)),\n introValues: Schema.optional(Texts),\n afterIntro: Schema.optional(Texts),\n});\n\ntype Series = typeof SeriesSchema.Type;\n\nconst OptionsSchema = Schema.Struct({\n series: Schema.Record(Schema.String, SeriesSchema),\n banned: Schema.optional(Texts),\n});\n\ntype Options = typeof OptionsSchema.Type;\n\nconst optionsOf = optionsWith({ schema: OptionsSchema, fallback: { series: {} } });\n\ninterface Check {\n readonly context: Context;\n readonly script: ObjectExpression;\n readonly name: string;\n readonly series: Series;\n}\n\nconst voiceOf = (context: Context, object: ObjectExpression): Option.Option<string> =>\n Option.map(propertyOf(VOICE)(object), ({ value }) => textOf(context)(value));\n\nconst speakerOf =\n ({ context, script }: Check) =>\n (cut: ObjectExpression): Option.Option<string> =>\n Option.orElse(voiceOf(context, cut), () => voiceOf(context, script));\n\nconst checkCast = (check: Check, cuts: readonly ObjectExpression[]): void => {\n const { context, name, series } = check;\n const voices = series.voices ?? [];\n if (Arr.isReadonlyArrayEmpty(voices)) {\n return;\n }\n for (const cut of cuts) {\n for (const voice of Option.toArray(speakerOf(check)(cut))) {\n if (!voices.includes(voice)) {\n context.report({ node: cut, messageId: \"voice\", data: { series: name, voice } });\n }\n }\n }\n};\n\nconst checkEnds = (check: Check, cuts: readonly ObjectExpression[]): void => {\n const { context, name, series } = check;\n const ends = [\n [\"opener\", series.opener, Arr.head(cuts)],\n [\"closer\", series.closer, Arr.last(cuts)],\n ] as const;\n for (const [messageId, voice, cut] of ends) {\n for (const [expected, end] of Option.toArray(Option.all([Option.fromNullishOr(voice), cut]))) {\n if (!Option.contains(speakerOf(check)(end), expected)) {\n context.report({ node: end, messageId, data: { series: name, voice: expected } });\n }\n }\n }\n};\n\nconst checkVoices = (check: Check): void => {\n const cuts = cutsOf({ context: check.context, script: check.script });\n checkCast(check, cuts);\n checkEnds(check, cuts);\n};\n\nconst checkBanned = (\n context: Context,\n {\n object,\n banned,\n }: Readonly<{ object: ObjectExpression; banned: Readonly<Record<string, string>> }>,\n): void => {\n for (const property of propertiesOf(object)) {\n for (const reason of Option.toArray(\n Option.flatMap(keyOf(property), (key) => Rec.get(banned, key)),\n )) {\n context.report({\n node: property,\n messageId: \"banned\",\n data: { key: textOf(context)(property.key), reason },\n fix: (fixer) => fixer.removeRange(removedRange({ object, property })),\n });\n }\n }\n};\n\nconst seriesNameOf = (script: ObjectExpression): Option.Option<ESTree.StringLiteral> =>\n pipe(\n propertyOf(SERIES)(script),\n Option.map(({ value }) => value),\n Option.filter(isStringLiteral),\n );\n\nconst checkSeries = (check: Check): void => {\n const { context, script, name, series } = check;\n checkValues({\n context,\n object: script,\n values: series.values ?? {},\n name,\n before: propertyOf(CUTS)(script),\n });\n checkIntroValues({ context, script, name, values: series.introValues ?? {} });\n checkAfterIntro({ context, script, name, values: series.afterIntro ?? {} });\n checkVoices(check);\n for (const rule of Option.toArray(Option.fromNullishOr(check.series.intro))) {\n checkIntro({ context: check.context, script: check.script, name: check.name, rule });\n }\n};\n\nconst checkScript = (\n context: Context,\n { script, options }: Readonly<{ script: ObjectExpression; options: Options }>,\n): void => {\n for (const literal of Option.toArray(seriesNameOf(script))) {\n const name = literal.value;\n const series = Rec.get(options.series, name);\n if (Option.isNone(series)) {\n context.report({\n node: literal,\n messageId: \"unknown\",\n data: { series: name, known: Arr.join(Rec.keys(options.series), \", \") },\n });\n return;\n }\n checkSeries({ context, script, name, series: series.value });\n }\n};\n\nexport const videoSeries: Rule = {\n meta: {\n type: \"problem\",\n fixable: \"code\",\n messages: MESSAGES,\n schema: [{ type: \"object\", additionalProperties: true }],\n },\n create: (context) => {\n const options = optionsOf(context.options);\n return {\n ObjectExpression: (object): void => {\n checkBanned(context, { object, banned: options.banned ?? {} });\n if (Option.isSome(propertyOf(CUTS)(object))) {\n checkScript(context, { script: object, options });\n }\n },\n };\n },\n};\n","import type { Rule } from \"vite-plus/lint/plugins\";\n\nimport { videoReadings } from \"./video-readings.ts\";\nimport { videoSay } from \"./video-say.ts\";\nimport { videoSeries } from \"./video-series.ts\";\n\nexport const VIDEO_RULES: Readonly<Record<string, Rule>> = {\n \"video-readings\": videoReadings,\n \"video-say\": videoSay,\n \"video-series\": videoSeries,\n};\n","import type { Rule } from \"vite-plus/lint/plugins\";\n\nimport { arrayFromAsync } from \"./array-from-async.ts\";\nimport { ecosystemReaders } from \"./ecosystem-readers.ts\";\nimport { explicitImportPath } from \"./explicit-import-path.ts\";\nimport { getOrInsert } from \"./get-or-insert.ts\";\nimport { inlineExports } from \"./inline-exports.ts\";\nimport { mcpToolLayer } from \"./mcp-tool-layer.ts\";\nimport { readonlyParameters } from \"./readonly-parameters.ts\";\nimport { separateMinMax } from \"./separate-min-max.ts\";\nimport { VIDEO_RULES } from \"./video-rules.ts\";\n\nexport const CODED_RULES: Readonly<Record<string, Rule>> = {\n \"array-from-async\": arrayFromAsync,\n \"ecosystem-readers\": ecosystemReaders,\n \"explicit-import-path\": explicitImportPath,\n \"get-or-insert\": getOrInsert,\n \"inline-exports\": inlineExports,\n \"mcp-tool-layer\": mcpToolLayer,\n \"readonly-parameters\": readonlyParameters,\n \"separate-min-max\": separateMinMax,\n ...VIDEO_RULES,\n};\n","import { toPosix } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Context, ESTree, Rule } from \"vite-plus/lint/plugins\";\n\nconst NAMESPACE = \"*\";\nconst DEFAULT = \"default\";\n\nexport interface ImportBan {\n readonly module: string;\n readonly names: Option.Option<readonly string[]>;\n readonly typesAllowed: boolean;\n}\n\nexport interface MemberBan {\n readonly object: string;\n readonly properties: readonly string[];\n}\n\nexport interface Intent {\n readonly message: string;\n readonly home: Option.Option<string>;\n readonly imports: readonly ImportBan[];\n readonly members: readonly MemberBan[];\n}\n\nconst importedName = (specifier: ESTree.ImportDeclarationSpecifier): string => {\n if (specifier.type === \"ImportDefaultSpecifier\") {\n return DEFAULT;\n }\n if (specifier.type === \"ImportNamespaceSpecifier\") {\n return NAMESPACE;\n }\n if (specifier.imported.type === \"Identifier\") {\n return specifier.imported.name;\n }\n return specifier.imported.value;\n};\n\nconst isTypeOnly = (\n node: ESTree.ImportDeclaration,\n specifier: ESTree.ImportDeclarationSpecifier,\n): boolean =>\n node.importKind === \"type\" ||\n (specifier.type === \"ImportSpecifier\" && specifier.importKind === \"type\");\n\nconst isBannedSpecifier =\n (node: ESTree.ImportDeclaration, ban: ImportBan, names: readonly string[]) =>\n (specifier: ESTree.ImportDeclarationSpecifier): boolean =>\n !(ban.typesAllowed && isTypeOnly(node, specifier)) &&\n Arr.contains([NAMESPACE, ...names], importedName(specifier));\n\nconst wholeImport = (node: ESTree.ImportDeclaration, ban: ImportBan): readonly ESTree.Node[] => {\n if (ban.typesAllowed && node.importKind === \"type\") {\n return [];\n }\n return [node];\n};\n\nconst bannedIn =\n (node: ESTree.ImportDeclaration) =>\n (ban: ImportBan): readonly ESTree.Node[] => {\n if (node.source.value !== ban.module) {\n return [];\n }\n return Option.match(ban.names, {\n onNone: () => wholeImport(node, ban),\n onSome: (names): readonly ESTree.Node[] =>\n pipe(node.specifiers, Arr.filter(isBannedSpecifier(node, ban, names))),\n });\n };\n\nconst propertyOf = (node: ESTree.MemberExpression): Option.Option<string> => {\n if (!node.computed && node.property.type === \"Identifier\") {\n return Option.some(node.property.name);\n }\n if (node.property.type === \"Literal\" && typeof node.property.value === \"string\") {\n return Option.some(node.property.value);\n }\n return Option.none();\n};\n\nconst isBannedMember =\n (node: ESTree.MemberExpression) =>\n (ban: MemberBan): boolean =>\n node.object.type === \"Identifier\" &&\n node.object.name === ban.object &&\n pipe(\n propertyOf(node),\n Option.exists((property) => Arr.contains(ban.properties, property)),\n );\n\nconst reportImports = (context: Context, intent: Intent, node: ESTree.ImportDeclaration): void => {\n const banned = pipe(intent.imports, Arr.flatMap(bannedIn(node)));\n for (const found of banned) {\n context.report({ node: found, message: intent.message });\n }\n};\n\nconst isHome = (intent: Intent, filename: string): boolean =>\n Option.exists(intent.home, (home) => Str.endsWith(home)(toPosix(filename)));\n\nexport const ruleOf = (intent: Intent): Rule => ({\n meta: { type: \"problem\" },\n create: (context) => {\n if (isHome(intent, context.filename)) {\n return {};\n }\n return {\n ImportDeclaration: (node): void => {\n reportImports(context, intent, node);\n },\n MemberExpression: (node): void => {\n if (pipe(intent.members, Arr.some(isBannedMember(node)))) {\n context.report({ node, message: intent.message });\n }\n },\n };\n },\n});\n","import { Option } from \"effect\";\n\nimport type { Intent } from \"./intent-rule.ts\";\n\nconst RUN_MESSAGE =\n \"Run Effects with run or runner from @r_masseater/masseater-utils/workers-tracing/effect, so their spans reach the Workers trace.\";\n\nconst RUN_FUNCTIONS: readonly string[] = [\n \"runPromise\",\n \"runPromiseExit\",\n \"runFork\",\n \"runCallback\",\n \"runSync\",\n \"runSyncExit\",\n \"runPromiseWith\",\n \"runPromiseExitWith\",\n \"runForkWith\",\n \"runCallbackWith\",\n \"runSyncWith\",\n \"runSyncExitWith\",\n];\n\nconst HAND_WRITTEN_SQL =\n \"Build queries with the Drizzle query builder, so that their columns and types come from the schema. Do not write SQL by hand with sql.\";\n\nexport const INTENTS: Readonly<Record<string, Intent>> = {\n \"ui-state-in-atoms\": {\n message:\n \"Keep UI state in effect-atom (Atom.make, useAtom, useAtomValue), so that state has one home outside the component tree. Do not use React state hooks or context.\",\n home: Option.none(),\n imports: [\n {\n module: \"react\",\n names: Option.some([\"useState\", \"useReducer\", \"createContext\", \"useContext\"]),\n typesAllowed: false,\n },\n ],\n members: [],\n },\n \"no-hand-written-sql\": {\n message: HAND_WRITTEN_SQL,\n home: Option.none(),\n imports: [\n { module: \"drizzle-orm\", names: Option.some([\"sql\"]), typesAllowed: false },\n { module: \"drizzle-orm/sql\", names: Option.none(), typesAllowed: false },\n ],\n members: [],\n },\n \"traced-elysia\": {\n message:\n \"Import Elysia from @r_masseater/masseater-utils/workers-tracing/elysia, so every handle call is a span.\",\n home: Option.none(),\n imports: [{ module: \"elysia\", names: Option.some([\"Elysia\", \"default\"]), typesAllowed: true }],\n members: [],\n },\n \"traced-effect-run\": {\n message: RUN_MESSAGE,\n home: Option.none(),\n imports: [\n { module: \"effect/Effect\", names: Option.some(RUN_FUNCTIONS), typesAllowed: false },\n { module: \"effect/ManagedRuntime\", names: Option.some([\"make\"]), typesAllowed: false },\n ],\n members: [\n { object: \"Effect\", properties: RUN_FUNCTIONS },\n { object: \"ManagedRuntime\", properties: [\"make\"] },\n ],\n },\n \"platform-node-by-module\": {\n message:\n 'Import names from a module path, such as import { layer } from \"@effect/platform-node/NodeServices\". The package root loads every module, the Redis client included, and adds about 250 ms to each start.',\n home: Option.none(),\n imports: [{ module: \"@effect/platform-node\", names: Option.none(), typesAllowed: true }],\n members: [],\n },\n \"main-through-node-main\": {\n message:\n 'Start a Node.js program with runMain from \"@r_masseater/masseater-utils/node-main\", so that it is traced and a failure prints one line instead of a stack trace.',\n home: Option.some(\"/src/features/run-main/model/run-main.ts\"),\n imports: [\n {\n module: \"@effect/platform-node/NodeRuntime\",\n names: Option.some([\"runMain\"]),\n typesAllowed: false,\n },\n {\n module: \"@effect/platform-node-shared/NodeRuntime\",\n names: Option.some([\"runMain\"]),\n typesAllowed: false,\n },\n ],\n members: [{ object: \"NodeRuntime\", properties: [\"runMain\"] }],\n },\n \"typed-calls-not-reflect\": {\n message:\n \"Read properties and call functions through typed access, or decode untyped values with Schema at the boundary. Do not go around the types with Reflect.\",\n home: Option.none(),\n imports: [],\n members: [{ object: \"Reflect\", properties: [\"get\", \"apply\"] }],\n },\n \"db-writes-in-writers\": {\n message:\n \"Write tables only from a *-writer.server.ts module, so that a table update and its revision go into the same batch. Call the writer here instead of writing through db.\",\n home: Option.none(),\n imports: [],\n members: [{ object: \"db\", properties: [\"insert\", \"update\", \"delete\", \"batch\", \"run\"] }],\n },\n};\n","import { Record as Rec, pipe } from \"effect\";\nimport type { Plugin } from \"vite-plus/lint/plugins\";\n\nimport { CODED_RULES } from \"./coded-rules.ts\";\nimport { ruleOf } from \"./intent-rule.ts\";\nimport { INTENTS } from \"./intents.ts\";\n\nexport const mschLintPlugin: Plugin & { readonly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ESSAGE_ID","MESSAGE","Str","Arr","isStringLiteral","visitorOf","MESSAGE","Arr","MESSAGE","Arr","MESSAGE","Str","Arr","Arr","Arr","Str","MESSAGE","Arr","unwrapped","Str","Arr","START","NEXT","propertyOf","Arr","Str","MESSAGES","Arr","Str","MESSAGES","OptionsSchema","optionsOf","Str","Arr","Rec","NEXT","Arr","propertyOf","Rec","propertyOf","Arr","Str","propertyOf","Arr","Rec","Arr","Str","Arr","Rec","Rec"],"sources":["../src/features/define-lint-rules/model/get-or-insert-ast.ts","../src/features/define-lint-rules/model/array-from-async.ts","../src/features/define-lint-rules/model/ecosystem-readers.ts","../src/features/define-lint-rules/model/typed-rule.ts","../src/features/define-lint-rules/model/explicit-import-path.ts","../src/features/define-lint-rules/model/get-or-insert.ts","../src/features/define-lint-rules/model/inline-exports.ts","../src/features/define-lint-rules/model/mcp-tool-layer.ts","../src/features/define-lint-rules/model/declared-outside.ts","../src/features/define-lint-rules/model/writable-part.ts","../src/features/define-lint-rules/model/readonly-parameters.ts","../src/features/define-lint-rules/model/separate-min-max.ts","../src/features/define-lint-rules/model/video-script-ast.ts","../src/features/define-lint-rules/model/video-readings.ts","../src/features/define-lint-rules/model/video-say.ts","../src/features/define-lint-rules/model/video-values.ts","../src/features/define-lint-rules/model/video-intro.ts","../src/features/define-lint-rules/model/video-series.ts","../src/features/define-lint-rules/model/video-rules.ts","../src/features/define-lint-rules/model/coded-rules.ts","../src/features/define-lint-rules/model/intent-rule.ts","../src/features/define-lint-rules/model/intents.ts","../src/features/define-lint-rules/model/model-call-rules.ts","../src/features/define-lint-rules/model/resource-rules.ts","../src/features/define-lint-rules/model/selector-rule.ts","../src/features/define-lint-rules/model/test-honesty-rules.ts","../src/features/define-lint-rules/model/plugin.ts"],"sourcesContent":["import { Array as Arr, Option, Predicate, Schema, String as Str, pipe } from \"effect\";\n\nexport type Keys = Readonly<Record<string, readonly string[] | undefined>>;\n\nexport interface Scope {\n readonly text: string;\n readonly keys: Keys;\n}\n\nexport interface Access {\n readonly map: string;\n readonly key: string;\n readonly value: Option.Option<string>;\n}\n\nconst START = 0;\nconst END = 1;\nconst KEY = 0;\nconst VALUE = 1;\nconst ONE = 1;\n\nconst RangeSchema = Schema.Tuple([Schema.Finite, Schema.Finite]);\nconst RangedSchema = Schema.Struct({ range: RangeSchema });\n\ntype Ranged = typeof RangedSchema.Type;\n\nconst decodeRanged = Schema.decodeUnknownOption(RangedSchema);\n\nconst IdentifierSchema = Schema.Struct({ type: Schema.Literal(\"Identifier\"), name: Schema.String });\n\nconst MemberSchema = Schema.Struct({\n type: Schema.Literal(\"MemberExpression\"),\n computed: Schema.Literal(false),\n object: RangedSchema,\n property: IdentifierSchema,\n});\n\nconst MemberCallSchema = Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: MemberSchema,\n arguments: Schema.Array(RangedSchema),\n});\n\nconst decodeMemberCall = Schema.decodeUnknownOption(MemberCallSchema);\n\nconst decodeCall = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: RangedSchema,\n arguments: Schema.Array(Schema.Unknown),\n }),\n);\n\nconst decodeBlock = Schema.decodeUnknownOption(\n Schema.Struct({ type: Schema.Literal(\"BlockStatement\"), body: Schema.Array(Schema.Unknown) }),\n);\n\nconst decodeExpressionStatement = Schema.decodeUnknownOption(\n Schema.Struct({ type: Schema.Literal(\"ExpressionStatement\"), expression: Schema.Unknown }),\n);\n\nconst decodeReturn = Schema.decodeUnknownOption(\n Schema.Struct({ type: Schema.Literal(\"ReturnStatement\"), argument: RangedSchema }),\n);\n\nconst decodeTyped = Schema.decodeUnknownOption(Schema.Struct({ type: Schema.String }));\n\nconst textOf =\n (scope: Scope) =>\n (node: Ranged): string =>\n Str.slice(node.range[START], node.range[END])(scope.text);\n\nexport const textOfNode =\n (scope: Scope) =>\n (node: unknown): Option.Option<string> =>\n pipe(decodeRanged(node), Option.map(textOf(scope)));\n\nexport const accessOf =\n (scope: Scope) =>\n (method: string) =>\n (node: unknown): Option.Option<Access> =>\n pipe(\n decodeMemberCall(node),\n Option.filter((call) => call.callee.property.name === method),\n Option.flatMap((call) =>\n pipe(\n Arr.get(call.arguments, KEY),\n Option.map((key) => ({\n map: textOf(scope)(call.callee.object),\n key: textOf(scope)(key),\n value: pipe(Arr.get(call.arguments, VALUE), Option.map(textOf(scope))),\n })),\n ),\n ),\n );\n\nexport const sameEntry =\n (left: Access) =>\n (right: Access): boolean =>\n left.map === right.map && left.key === right.key;\n\nexport const calleeMatches =\n (scope: Scope) =>\n (pattern: RegExp) =>\n (node: unknown): Option.Option<readonly unknown[]> =>\n pipe(\n decodeCall(node),\n Option.filter((call) => pattern.test(textOf(scope)(call.callee))),\n Option.map((call) => call.arguments),\n );\n\nexport const expressionOf = (statement: unknown): Option.Option<unknown> =>\n pipe(\n decodeExpressionStatement(statement),\n Option.map((found) => found.expression),\n );\n\nexport const returnedText =\n (scope: Scope) =>\n (statement: unknown): Option.Option<string> =>\n pipe(\n decodeReturn(statement),\n Option.map((found) => textOf(scope)(found.argument)),\n );\n\nexport const bodyOf = (node: unknown): Option.Option<readonly unknown[]> =>\n pipe(\n decodeBlock(node),\n Option.map((block) => block.body),\n );\n\nexport const onlyStatement = (statement: unknown): Option.Option<unknown> =>\n Option.match(bodyOf(statement), {\n onNone: () => Option.some(statement),\n onSome: (body) =>\n Option.flatMap(\n Option.liftPredicate(body, (all) => all.length === ONE),\n Arr.head,\n ),\n });\n\nexport const typeOf = (node: unknown): string =>\n pipe(decodeTyped(node), Option.match({ onNone: () => \"\", onSome: (found) => found.type }));\n\nexport const parentOf = (node: unknown): Option.Option<unknown> =>\n pipe(\n Option.liftPredicate(node, Predicate.hasProperty(\"parent\")),\n Option.flatMap((found) => Option.fromNullishOr(found.parent)),\n );\n\nconst childrenOf = (keys: Keys, node: unknown): readonly unknown[] =>\n pipe(\n Option.liftPredicate(node, Predicate.isObject),\n Option.match({\n onNone: (): readonly unknown[] => [],\n onSome: (found) =>\n pipe(\n keys[typeOf(found)] ?? [],\n Arr.flatMap((key): readonly unknown[] =>\n pipe(\n Option.liftPredicate(found, Predicate.hasProperty(key)),\n Option.match({\n onNone: (): readonly unknown[] => [],\n onSome: (owner) => Arr.ensure(owner[key]),\n }),\n ),\n ),\n Arr.filter(Predicate.isObject),\n ),\n }),\n );\n\nexport const descendants =\n (keys: Keys) =>\n (node: unknown): readonly unknown[] => [\n node,\n ...pipe(childrenOf(keys, node), Arr.flatMap(descendants(keys))),\n ];\n\nexport const accessesIn =\n (scope: Scope) =>\n (method: string) =>\n (node: unknown): readonly Access[] =>\n pipe(descendants(scope.keys)(node), Arr.map(accessOf(scope)(method)), Arr.getSomes);\n","import { Array as Arr, Option, Schema, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nimport { expressionOf, onlyStatement } from \"./get-or-insert-ast.ts\";\n\nconst MESSAGE =\n \"Collect an async iterable with Array.fromAsync, passing the mapping as its second argument. Do not push each item from a for await loop.\";\n\nconst ONE = 1;\n\nconst DeclarationSchema = Schema.Struct({\n type: Schema.Literal(\"VariableDeclaration\"),\n declarations: Schema.Array(Schema.Unknown),\n});\n\nconst decodeLoop = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"ForOfStatement\"),\n await: Schema.Literal(true),\n left: DeclarationSchema,\n body: Schema.Unknown,\n }),\n);\n\nconst PushNameSchema = Schema.Struct({\n type: Schema.Literal(\"Identifier\"),\n name: Schema.Literal(\"push\"),\n});\n\nconst PushCalleeSchema = Schema.Struct({\n type: Schema.Literal(\"MemberExpression\"),\n computed: Schema.Literal(false),\n property: PushNameSchema,\n});\n\nconst ArgumentSchema = Schema.Struct({ type: Schema.String });\n\nconst decodePush = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: PushCalleeSchema,\n arguments: Schema.Array(ArgumentSchema),\n }),\n);\n\nconst pushesOne = (statement: unknown): boolean =>\n pipe(\n expressionOf(statement),\n Option.flatMap(decodePush),\n Option.exists(\n (call) =>\n call.arguments.length === ONE &&\n !pipe(\n call.arguments,\n Arr.some((argument) => argument.type === \"SpreadElement\"),\n ),\n ),\n );\n\nconst collectsByHand = (node: unknown): boolean =>\n pipe(\n decodeLoop(node),\n Option.filter((loop) => loop.left.declarations.length === ONE),\n Option.flatMap((loop) => onlyStatement(loop.body)),\n Option.exists(pushesOne),\n );\n\nexport const arrayFromAsync: Rule = {\n meta: { type: \"suggestion\" },\n create: (context) => ({\n ForOfStatement: (node): void => {\n if (collectsByHand(node)) {\n context.report({ node, message: MESSAGE });\n }\n },\n }),\n};\n","import { baseName } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Option, Record as Rec, pipe } from \"effect\";\nimport type { Context, ESTree, Rule } from \"vite-plus/lint/plugins\";\n\ntype Format = \"json\" | \"toml\" | \"typescript\" | \"yaml\";\n\ninterface EcosystemFile {\n readonly name: RegExp;\n readonly format: Format;\n readonly reader: string;\n}\n\nconst ECOSYSTEM_FILES: readonly EcosystemFile[] = [\n {\n name: /^pnpm-workspace\\.yaml$/u,\n format: \"yaml\",\n reader:\n \"readWorkspaceManifest, findWorkspaceProjects or updateWorkspaceManifest from @r_masseater/masseater-utils/kestrion/pnpm, which run the @pnpm readers\",\n },\n {\n name: /^pnpm-lock\\.yaml$/u,\n format: \"yaml\",\n reader:\n \"readWantedLockfile, lockedPackageIds or lockedGraph from @r_masseater/masseater-utils/kestrion/pnpm, which run @pnpm/lockfile.fs\",\n },\n { name: /^Cargo\\.(?:toml|lock)$/u, format: \"toml\", reader: \"cargo metadata\" },\n {\n name: /^tsconfig(?:\\.[\\w-]+)?\\.json$/u,\n format: \"json\",\n reader: \"parse from tsconfck or the TypeScript compiler API\",\n },\n {\n name: /^vite\\.config\\.[cm]?[jt]s$/u,\n format: \"typescript\",\n reader:\n \"resolveConfigFromFile from vite-plus, or parse from vite-plus for a read that must not run the file\",\n },\n];\n\nconst PARSER_MODULES: Readonly<Record<Format, readonly string[]>> = {\n json: [\"jsonc-parser\", \"json5\", \"strip-json-comments\"],\n toml: [\"smol-toml\", \"@iarna/toml\", \"toml\", \"toml-eslint-parser\"],\n typescript: [\"typescript\", \"oxc-parser\", \"@babel/parser\", \"@typescript-eslint/parser\", \"acorn\"],\n yaml: [\"yaml\", \"js-yaml\"],\n};\n\nconst PARSER_CALLS: Readonly<Record<Format, Option.Option<RegExp>>> = {\n json: Option.some(/\\b(?:JSON\\.parse|parseJson)\\b/u),\n toml: Option.none(),\n typescript: Option.none(),\n yaml: Option.none(),\n};\n\nconst importedModules = (statements: readonly ESTree.Statement[]): readonly string[] =>\n pipe(\n statements,\n Arr.filter((statement) => statement.type === \"ImportDeclaration\"),\n Arr.map((declaration) => declaration.source.value),\n );\n\nconst parserIn =\n (context: Context) =>\n (format: Format): Option.Option<string> => {\n const imported = importedModules(context.sourceCode.ast.body);\n const fromModule = pipe(\n Rec.get(PARSER_MODULES, format),\n Option.getOrElse((): readonly string[] => []),\n Arr.findFirst((module) => Arr.contains(imported, module)),\n );\n if (Option.isSome(fromModule)) {\n return fromModule;\n }\n return pipe(\n Rec.get(PARSER_CALLS, format),\n Option.flatten,\n Option.flatMap((pattern) => Option.fromNullishOr(pattern.exec(context.sourceCode.text))),\n Option.map(([call]) => call),\n );\n };\n\nconst messageFor =\n (context: Context) =>\n (text: string): Option.Option<string> => {\n const name = baseName(text);\n return pipe(\n ECOSYSTEM_FILES,\n Arr.findFirst((entry) => entry.name.test(name)),\n Option.flatMap(({ format, reader }) =>\n pipe(\n parserIn(context)(format),\n Option.map(\n (parser) =>\n `${name} has an official reader: ${reader}. Read it with that instead of parsing it with ${parser}, so that the file means what its own tool says it means.`,\n ),\n ),\n ),\n );\n };\n\nexport const ecosystemReaders: Rule = {\n meta: { type: \"problem\" },\n create: (context) => ({\n Literal: (node): void => {\n const message = pipe(\n Option.liftPredicate(node.value, (value) => typeof value === \"string\"),\n Option.flatMap(messageFor(context)),\n );\n if (Option.isSome(message)) {\n context.report({ node, message: message.value });\n }\n },\n TemplateElement: (node): void => {\n const message = messageFor(context)(node.value.raw);\n if (Option.isSome(message)) {\n context.report({ node, message: message.value });\n }\n },\n }),\n};\n","import { withTypeInformation } from \"@r_masseater/oxlint-typed-rules\";\nimport type { ParserServices, TypedContext } from \"@r_masseater/oxlint-typed-rules\";\nimport { Option, pipe } from \"effect\";\nimport type { Rule, RuleMeta, Visitor } from \"vite-plus/lint/plugins\";\n\nexport interface TypedRuleParts {\n readonly meta: RuleMeta;\n readonly visitorOf: (context: TypedContext, services: ParserServices) => Visitor;\n}\n\nexport const typedRuleOf = ({ meta, visitorOf }: TypedRuleParts): Rule =>\n withTypeInformation({\n meta,\n create: (context: TypedContext) =>\n pipe(\n Option.fromNullishOr(context.sourceCode.parserServices),\n Option.match({\n onNone: (): Visitor => ({}),\n onSome: (services) => visitorOf(context, services),\n }),\n ),\n });\n","import { baseName, parent } from \"@masseater.dev/path-kit\";\nimport type { ParserServices, TypedContext } from \"@r_masseater/oxlint-typed-rules\";\nimport { Array as Arr, Option, Predicate, String as Str, pipe } from \"effect\";\nimport type { ESTree, Rule, Visitor } from \"vite-plus/lint/plugins\";\n\nimport { typedRuleOf } from \"./typed-rule.ts\";\n\nconst MESSAGE_ID = \"spellOut\";\nconst MESSAGE =\n \"`{{specifier}}` does not name a file. Write `{{fixed}}`: Node ESM and TypeScript nodenext resolve neither a missing extension nor a directory index, so spelling out the file works under every resolver.\";\n\nconst RELATIVE = /^\\.{1,2}(?:\\/|$)/u;\nconst PARTS = /^(?<path>[^?]*)(?<query>.*)$/su;\nconst TRAILING_SEPARATORS = /\\/+$/u;\nconst DIRECTORY_NAMES: readonly string[] = [\".\", \"..\"];\nconst INDEX = \"index.\";\nconst DEFAULT_QUOTE = '\"';\nconst FIRST = 0;\n\ninterface Parts {\n readonly path: string;\n readonly query: string;\n}\n\nconst partsOf = (specifier: string): Option.Option<Parts> =>\n pipe(\n Str.match(PARTS)(specifier),\n Option.flatMap((matched) => Option.fromNullishOr(matched.groups)),\n Option.map((groups) => ({ path: groups[\"path\"] ?? \"\", query: groups[\"query\"] ?? \"\" })),\n );\n\nconst completionOf = (resolved: string, path: string): Option.Option<string> => {\n const file = baseName(resolved);\n const name = baseName(path);\n const index = Str.startsWith(INDEX)(file);\n if (Arr.contains(DIRECTORY_NAMES, name)) {\n return Option.liftPredicate(`/${file}`, () => index);\n }\n if (Str.startsWith(`${name}.`)(file)) {\n return Option.some(Str.slice(name.length)(file));\n }\n return Option.liftPredicate(`/${file}`, () => index && baseName(parent(resolved)) === name);\n};\n\nconst resolvedFileOf = (\n services: ParserServices,\n source: ESTree.StringLiteral,\n): Option.Option<string> =>\n pipe(\n Option.fromNullishOr(services.getSymbolAtLocation(source)),\n Option.flatMap((symbol) => Arr.head(symbol.declarations)),\n Option.map((declaration) => declaration.getSourceFile().fileName),\n );\n\nconst fixedOf = (services: ParserServices, source: ESTree.StringLiteral): Option.Option<string> =>\n pipe(\n partsOf(source.value),\n Option.filter(({ path }) => RELATIVE.test(path)),\n Option.flatMap(({ path, query }) =>\n pipe(\n resolvedFileOf(services, source),\n Option.flatMap((resolved) =>\n completionOf(resolved, Str.replace(TRAILING_SEPARATORS, \"\")(path)),\n ),\n Option.map(\n (completion) => `${Str.replace(TRAILING_SEPARATORS, \"\")(path)}${completion}${query}`,\n ),\n ),\n ),\n );\n\nconst quoteOf = (source: ESTree.StringLiteral): string =>\n pipe(\n Option.fromNullishOr(source.raw),\n Option.flatMap(Str.charAt(FIRST)),\n Option.getOrElse(() => DEFAULT_QUOTE),\n );\n\nconst isStringLiteral = (node: ESTree.Node | null): node is ESTree.StringLiteral =>\n Predicate.isNotNull(node) && node.type === \"Literal\" && Predicate.isString(node.value);\n\nconst visitorOf = (context: TypedContext, services: ParserServices): Visitor => {\n const check = (source: ESTree.Node | null): void => {\n if (!isStringLiteral(source)) {\n return;\n }\n const fixed = fixedOf(services, source);\n if (Option.isSome(fixed)) {\n context.report({\n node: source,\n messageId: MESSAGE_ID,\n data: { specifier: source.value, fixed: fixed.value },\n fix: (fixer) =>\n fixer.replaceText(source, `${quoteOf(source)}${fixed.value}${quoteOf(source)}`),\n });\n }\n };\n return {\n ImportDeclaration: (node): void => {\n check(node.source);\n },\n ExportAllDeclaration: (node): void => {\n check(node.source);\n },\n ExportNamedDeclaration: (node): void => {\n check(node.source);\n },\n ImportExpression: (node): void => {\n check(node.source);\n },\n };\n};\n\nexport const explicitImportPath: Rule = typedRuleOf({\n meta: { type: \"suggestion\", fixable: \"code\", messages: { [MESSAGE_ID]: MESSAGE } },\n visitorOf,\n});\n","import { Array as Arr, Option, Schema, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nimport {\n accessOf,\n accessesIn,\n bodyOf,\n calleeMatches,\n descendants,\n expressionOf,\n onlyStatement,\n parentOf,\n returnedText,\n sameEntry,\n textOfNode,\n typeOf,\n} from \"./get-or-insert-ast.ts\";\nimport type { Access, Scope } from \"./get-or-insert-ast.ts\";\n\nconst MESSAGE =\n \"Use getOrInsert or getOrInsertComputed on the Map or WeakMap, so that reading a key and storing its first value is one call. Do not read the key and then set it by hand.\";\n\nconst ONE = 1;\nconst TWO = 2;\nconst OPTION_FROM = /^(?:Option\\.)?from(?:NullishOr|UndefinedOr|Nullable)$/u;\nconst GET_OR_ELSE = /^(?:Option\\.)?getOrElse$/u;\nconst FUNCTIONS: readonly string[] = [\"ArrowFunctionExpression\", \"FunctionExpression\"];\n\nconst decodeGuard = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"IfStatement\"),\n test: Schema.Unknown,\n consequent: Schema.Unknown,\n alternate: Schema.Null,\n }),\n);\n\nconst decodeNot = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"UnaryExpression\"),\n operator: Schema.Literal(\"!\"),\n argument: Schema.Unknown,\n }),\n);\n\nconst DeclaratorSchema = Schema.Struct({\n id: Schema.Struct({ type: Schema.Literal(\"Identifier\"), name: Schema.String }),\n init: Schema.Unknown,\n});\n\ntype Declarator = typeof DeclaratorSchema.Type;\n\nconst decodeDeclaration = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"VariableDeclaration\"),\n declarations: Schema.Array(DeclaratorSchema),\n }),\n);\n\nconst decodeNullish = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"LogicalExpression\"),\n operator: Schema.Literal(\"??\"),\n left: Schema.Unknown,\n }),\n);\n\nconst storeOf =\n (scope: Scope) =>\n (statement: unknown): Option.Option<Access> =>\n pipe(expressionOf(statement), Option.flatMap(accessOf(scope)(\"set\")));\n\nconst isHasGuard = (scope: Scope, node: unknown): boolean =>\n pipe(\n decodeGuard(node),\n Option.exists((guard) => {\n const guarded = pipe(\n decodeNot(guard.test),\n Option.flatMap((not) => accessOf(scope)(\"has\")(not.argument)),\n );\n const stored = pipe(onlyStatement(guard.consequent), Option.flatMap(storeOf(scope)));\n return Option.isSome(guarded) && Option.exists(stored, sameEntry(guarded.value));\n }),\n );\n\nconst deletes =\n (scope: Scope, read: Access) =>\n (statement: unknown): boolean =>\n pipe(\n expressionOf(statement),\n Option.flatMap(accessOf(scope)(\"delete\")),\n Option.exists(sameEntry(read)),\n );\n\nconst storesBack =\n (scope: Scope, read: Access, name: string) =>\n (statement: unknown): boolean =>\n Option.exists(\n storeOf(scope)(statement),\n (stored) => sameEntry(read)(stored) && Option.exists(stored.value, (value) => value === name),\n );\n\nconst fallsBack =\n (scope: Scope, later: readonly unknown[]) =>\n (declarator: Declarator): boolean =>\n pipe(\n decodeNullish(declarator.init),\n Option.flatMap((nullish) => accessOf(scope)(\"get\")(nullish.left)),\n Option.exists(\n (read) =>\n pipe(later, Arr.some(storesBack(scope, read, declarator.id.name))) &&\n !pipe(later, Arr.some(deletes(scope, read))),\n ),\n );\n\nconst fallbackIndices = (scope: Scope, body: readonly unknown[]): readonly number[] =>\n pipe(\n body,\n Arr.map((statement, index) => {\n const fallsBackLater = fallsBack(scope, Arr.drop(body, index + ONE));\n return pipe(\n decodeDeclaration(statement),\n Option.map((declaration) => declaration.declarations),\n Option.filter(Arr.some(fallsBackLater)),\n Option.as(index),\n );\n }),\n Arr.getSomes,\n );\n\ninterface CachedCheck {\n readonly test: (name: string) => string;\n readonly value: (name: string) => string;\n}\n\nconst itself = (name: string): string => name;\n\nconst CACHED_CHECKS: readonly CachedCheck[] = [\n { test: (name) => `${name} !== undefined`, value: itself },\n { test: (name) => `${name} != null`, value: itself },\n { test: (name) => `${name} !== null`, value: itself },\n { test: (name) => `Predicate.isNotUndefined(${name})`, value: itself },\n { test: (name) => `Predicate.isNotNullish(${name})`, value: itself },\n { test: itself, value: itself },\n { test: (name) => `Option.isSome(${name})`, value: (name) => `${name}.value` },\n];\n\nconst returnsCached =\n (scope: Scope, name: string) =>\n (statement: unknown): boolean =>\n pipe(\n decodeGuard(statement),\n Option.exists((guard) => {\n const tested = textOfNode(scope)(guard.test);\n const returned = pipe(onlyStatement(guard.consequent), Option.flatMap(returnedText(scope)));\n return pipe(\n CACHED_CHECKS,\n Arr.some(\n (check) =>\n Option.exists(tested, (found) => found === check.test(name)) &&\n Option.exists(returned, (found) => found === check.value(name)),\n ),\n );\n }),\n );\n\nconst unwrapOption =\n (scope: Scope) =>\n (node: unknown): unknown =>\n pipe(\n calleeMatches(scope)(OPTION_FROM)(node),\n Option.flatMap(Arr.head),\n Option.getOrElse(() => node),\n );\n\nconst readsCached =\n (scope: Scope, stored: Access) =>\n (declarator: Declarator): boolean =>\n pipe(\n unwrapOption(scope)(declarator.init),\n accessOf(scope)(\"get\"),\n Option.exists(sameEntry(stored)),\n );\n\nconst earlyReturn = (scope: Scope, body: readonly unknown[], stored: Access): boolean =>\n pipe(\n body,\n Arr.some((statement, index) =>\n pipe(\n decodeDeclaration(statement),\n Option.flatMap((declaration) => Arr.head(declaration.declarations)),\n Option.filter(readsCached(scope, stored)),\n Option.exists((declarator) =>\n Option.exists(Arr.get(body, index + ONE), returnsCached(scope, declarator.id.name)),\n ),\n ),\n ),\n );\n\nconst storedAndReturned = (scope: Scope, body: readonly unknown[]): Option.Option<Access> => {\n const returned = pipe(Arr.last(body), Option.flatMap(returnedText(scope)));\n return pipe(\n Arr.get(body, body.length - TWO),\n Option.flatMap(storeOf(scope)),\n Option.filter(\n (stored) => Option.isSome(returned) && Option.contains(stored.value, returned.value),\n ),\n );\n};\n\nconst optionRegion = (scope: Scope, block: unknown): Option.Option<unknown> =>\n pipe(\n parentOf(block),\n Option.filter((fn) => Arr.contains(FUNCTIONS, typeOf(fn))),\n Option.flatMap(parentOf),\n Option.filter((call) => Option.isSome(calleeMatches(scope)(GET_OR_ELSE)(call))),\n Option.flatMap(parentOf),\n );\n\nconst readsThroughOption =\n (scope: Scope, stored: Access) =>\n (node: unknown): boolean =>\n pipe(\n calleeMatches(scope)(OPTION_FROM)(node),\n Option.flatMap(Arr.head),\n Option.flatMap(accessOf(scope)(\"get\")),\n Option.exists(sameEntry(stored)),\n );\n\nconst storesOnce =\n (scope: Scope, stored: Access) =>\n (region: unknown): boolean =>\n pipe(accessesIn(scope)(\"set\")(region), Arr.filter(sameEntry(stored))).length === ONE;\n\nconst returnsOnce = (scope: Scope, block: unknown): boolean =>\n pipe(\n descendants(scope.keys)(block),\n Arr.filter((node) => typeOf(node) === \"ReturnStatement\"),\n ).length === ONE;\n\nconst fallsBackInOption = (scope: Scope, block: unknown, stored: Access): boolean =>\n returnsOnce(scope, block) &&\n Option.exists(\n optionRegion(scope, block),\n (region) =>\n pipe(descendants(scope.keys)(region), Arr.some(readsThroughOption(scope, stored))) &&\n storesOnce(scope, stored)(region),\n );\n\nconst isMemoized = (scope: Scope, block: unknown): boolean =>\n pipe(\n bodyOf(block),\n Option.exists((body) =>\n Option.exists(storedAndReturned(scope, body), (stored) => {\n if (earlyReturn(scope, body, stored)) {\n return storesOnce(scope, stored)(block);\n }\n return fallsBackInOption(scope, block, stored);\n }),\n ),\n );\n\nexport const getOrInsert: Rule = {\n meta: { type: \"suggestion\" },\n create: (context) => {\n const scope: Scope = { text: context.sourceCode.text, keys: context.sourceCode.visitorKeys };\n return {\n IfStatement: (node): void => {\n if (isHasGuard(scope, node)) {\n context.report({ node, message: MESSAGE });\n }\n },\n BlockStatement: (node): void => {\n for (const index of fallbackIndices(scope, node.body)) {\n for (const statement of Option.toArray(Arr.get(node.body, index))) {\n context.report({ node: statement, message: MESSAGE });\n }\n }\n if (isMemoized(scope, node)) {\n context.report({ node, message: MESSAGE });\n }\n },\n };\n },\n};\n","import { Array as Arr, pipe } from \"effect\";\nimport type { Context, ESTree, Rule } from \"vite-plus/lint/plugins\";\n\nconst MESSAGE =\n \"export は宣言に付ける(export const・export function など)。ファイルの末尾で export { … } にまとめない。\";\nconst TYPE = \"type\";\nconst CLASS_NAME = \"ClassName\";\n\nconst isList = (node: ESTree.ExportNamedDeclaration): boolean =>\n node.declaration === null && node.source === null && !Arr.isReadonlyArrayEmpty(node.specifiers);\n\nconst localName = (specifier: ESTree.ExportSpecifier): string => {\n if (specifier.local.type === \"Literal\") {\n return specifier.local.value;\n }\n return specifier.local.name;\n};\n\nconst isClass = (context: Context, name: string): boolean =>\n pipe(\n context.sourceCode.scopeManager.scopes,\n Arr.flatMap((scope) => scope.variables),\n Arr.filter((variable) => variable.name === name),\n Arr.flatMap((variable) => variable.defs),\n (defs) =>\n Arr.isReadonlyArrayNonEmpty(defs) &&\n pipe(\n defs,\n Arr.every(({ type }) => type === CLASS_NAME),\n ),\n );\n\nconst isTypeOnlyClass =\n (context: Context, node: ESTree.ExportNamedDeclaration) =>\n (specifier: ESTree.ExportSpecifier): boolean =>\n (node.exportKind === TYPE || specifier.exportKind === TYPE) &&\n isClass(context, localName(specifier));\n\nexport const inlineExports: Rule = {\n meta: { type: \"suggestion\" },\n create: (context) => ({\n ExportNamedDeclaration: (node): void => {\n if (isList(node) && !pipe(node.specifiers, Arr.every(isTypeOnlyClass(context, node)))) {\n context.report({ node, message: MESSAGE });\n }\n },\n }),\n};\n","import { segments, toPosix } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nconst SOURCE = \"/src/\";\nconst TOOL_LAYERS: readonly string[] = [\"features\", \"shared\"];\nconst TEST_FILE = /\\.test(?:\\.support)?\\.[cm]?[jt]sx?$/u;\nconst METHOD = \"registerTool\";\n\nconst MESSAGE =\n \"Register an MCP tool in the features slice of the operation it performs. A tool is one operation, so app/ only composes the slices' register functions and entities/ only holds the data they share.\";\n\nconst layerIn = (path: string): Option.Option<string> =>\n pipe(\n Str.lastIndexOf(SOURCE)(path),\n Option.map((index) => Arr.headNonEmpty(segments(Str.slice(index + SOURCE.length)(path)))),\n );\n\nconst layerOf = (filename: string): Option.Option<string> => layerIn(toPosix(filename));\n\nconst outsideToolLayers = (filename: string): boolean =>\n !TEST_FILE.test(filename) &&\n Option.exists(layerOf(filename), (layer) => !Arr.contains(TOOL_LAYERS, layer));\n\nexport const mcpToolLayer: Rule = {\n meta: { type: \"problem\" },\n create: (context) => {\n if (!outsideToolLayers(context.filename)) {\n return {};\n }\n return {\n CallExpression: (node): void => {\n const { callee } = node;\n if (\n callee.type === \"MemberExpression\" &&\n callee.property.type === \"Identifier\" &&\n callee.property.name === METHOD\n ) {\n context.report({ node: callee.property, message: MESSAGE });\n }\n },\n };\n },\n};\n","import { Array as Arr, Option, pipe } from \"effect\";\nimport { SymbolFlags } from \"tsrs/sync\";\nimport type { NodeHandle, Project, Symbol as TypeSymbol } from \"tsrs/sync\";\n\nexport type Origin = \"own\" | \"package\" | \"builtin\";\n\nconst origins = new WeakMap<TypeSymbol, Origin>();\nconst readonlyForms = new WeakMap<Project, Map<string, Option.Option<string>>>();\n\nconst fileOrigin = (project: Project, handle: NodeHandle): Option.Option<Origin> =>\n pipe(\n Option.fromNullishOr(project.program.getSourceFileMetadataByPath(handle.path)),\n Option.flatMap(({ isDefaultLibrary, isFromExternalLibrary }): Option.Option<Origin> => {\n if (isDefaultLibrary) {\n return Option.some(\"builtin\");\n }\n if (isFromExternalLibrary) {\n return Option.some(\"package\");\n }\n return Option.none();\n }),\n );\n\nconst declarationOrigin =\n (project: Project) =>\n (handle: NodeHandle): Origin =>\n pipe(\n fileOrigin(project, handle),\n Option.orElse(() =>\n pipe(\n Option.fromNullishOr(handle.resolve(project)),\n Option.filter((node) => node.getSourceFile().isDeclarationFile),\n Option.as<Origin>(\"package\"),\n ),\n ),\n Option.getOrElse((): Origin => \"own\"),\n );\n\nexport const originOf =\n (project: Project) =>\n (symbol: TypeSymbol): Origin =>\n origins.getOrInsertComputed(symbol, () => {\n const found = pipe(symbol.declarations, Arr.map(declarationOrigin(project)));\n if (Arr.contains(found, \"builtin\")) {\n return \"builtin\";\n }\n if (Arr.contains(found, \"package\")) {\n return \"package\";\n }\n return \"own\";\n });\n\nconst builtinNamed =\n (project: Project) =>\n (name: string): Option.Option<string> =>\n pipe(\n Option.fromNullishOr(project.checker.resolveName(name, SymbolFlags.Type)),\n Option.filter((symbol) => originOf(project)(symbol) === \"builtin\"),\n Option.as(name),\n );\n\nexport const readonlyFormOf =\n (project: Project) =>\n (name: string): Option.Option<string> =>\n readonlyForms\n .getOrInsertComputed(project, () => new Map<string, Option.Option<string>>())\n .getOrInsertComputed(name, () =>\n pipe([`Readonly${name}`, `${name}ReadOnly`], Arr.findFirst(builtinNamed(project))),\n );\n","import { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Checker, Project, Symbol as TypeSymbol, Type } from \"tsrs/sync\";\n\nimport { originOf, readonlyFormOf } from \"./declared-outside.ts\";\nimport type { Origin } from \"./declared-outside.ts\";\n\nexport type Mutability =\n | { readonly kind: \"array\" }\n | { readonly kind: \"tuple\" }\n | { readonly kind: \"property\" }\n | { readonly kind: \"index\" }\n | { readonly kind: \"form\"; readonly name: string; readonly readonlyName: string };\n\nexport interface WritablePart {\n readonly path: readonly string[];\n readonly mutability: Mutability;\n}\n\ntype Found = Option.Option<WritablePart>;\n\ninterface Search {\n readonly project: Project;\n readonly partOf: (type: Type) => Found;\n}\n\nexport const ELEMENT = \"[]\";\n\nconst MUTABLE_ARRAY = \"Array\";\nconst PRIVATE_NAME = \"__#\";\nconst SYMBOL_NAME = \"__@\";\n\nconst here = (mutability: Mutability): Found => Option.some({ path: [], mutability });\n\nconst under =\n (segment: string) =>\n (part: WritablePart): WritablePart => ({ ...part, path: [segment, ...part.path] });\n\nconst firstPart = (search: Search, types: readonly Type[]): Found =>\n pipe(types, Arr.findFirst(search.partOf));\n\nconst formOf =\n (project: Project) =>\n (name: string): Found =>\n pipe(\n readonlyFormOf(project)(name),\n Option.flatMap((readonlyName) => here({ kind: \"form\", name, readonlyName })),\n );\n\nconst isOpaqueAlias = (project: Project, type: Type): boolean =>\n pipe(\n Option.fromNullishOr(type.getAliasSymbol()),\n Option.exists((alias) => {\n const origin = originOf(project)(alias);\n return (\n origin === \"package\" ||\n (origin === \"builtin\" && Arr.isReadonlyArrayEmpty(type.getAliasTypeArguments()))\n );\n }),\n );\n\nconst isNamed = (type: Type): boolean =>\n type.isClassOrInterface() || (type.isTypeReference() && type.getTarget().isClassOrInterface());\n\nconst declaredOutside = (project: Project, type: Type): Option.Option<Found> =>\n pipe(\n Option.fromNullishOr(type.getSymbol()),\n Option.flatMap((symbol): Option.Option<Found> => {\n const origin = originOf(project)(symbol);\n if (origin === \"package\") {\n return Option.some(Option.none());\n }\n if (origin === \"own\" || !isNamed(type)) {\n return Option.none();\n }\n return Option.some(formOf(project)(symbol.name));\n }),\n );\n\nconst isOutside = (project: Project, type: Type): boolean =>\n isOpaqueAlias(project, type) ||\n (type.isObjectType() && Option.exists(declaredOutside(project, type), Option.isNone));\n\nconst sourceOf = (type: Type): Option.Option<Type> => {\n if (!type.isMappedType()) {\n return Option.none();\n }\n const template = type.getTemplateType();\n if (!template.isIndexedAccessType()) {\n return Option.none();\n }\n return Option.some(template.getObjectType());\n};\n\nconst takenFromOutside =\n (project: Project) =>\n (type: Type): readonly string[] => {\n if (isOutside(project, type)) {\n return pipe(\n type.getProperties(),\n Arr.map((property) => property.name),\n );\n }\n if (type.isUnionType() || type.isIntersectionType()) {\n return pipe(type.getTypes(), Arr.flatMap(takenFromOutside(project)));\n }\n return pipe(\n sourceOf(type),\n Option.map(takenFromOutside(project)),\n Option.getOrElse((): readonly string[] => []),\n );\n };\n\nconst elementsPart = (search: Search, type: Type): Found => {\n if (!type.isTypeReference()) {\n return Option.none();\n }\n return pipe(\n firstPart(search, search.project.checker.getTypeArguments(type)),\n Option.map(under(ELEMENT)),\n );\n};\n\nconst arrayPart = (search: Search, type: Type): Found => {\n const mutable = pipe(\n Option.fromNullishOr(type.getSymbol()),\n Option.exists((symbol) => symbol.name === MUTABLE_ARRAY),\n );\n if (mutable) {\n return here({ kind: \"array\" });\n }\n return elementsPart(search, type);\n};\n\nconst tuplePart = (search: Search, type: Type): Found => {\n if (type.isTupleType() && !type.getTarget().readonly) {\n return here({ kind: \"tuple\" });\n }\n return elementsPart(search, type);\n};\n\nconst named =\n (prefix: string) =>\n (property: TypeSymbol): boolean =>\n pipe(String(property.escapedName), Str.startsWith(prefix));\n\nconst isWritable =\n (checker: Checker) =>\n (property: TypeSymbol): boolean =>\n !checker.isReadonlySymbol(property) && !named(PRIVATE_NAME)(property);\n\nconst isStringNamed = (property: TypeSymbol): boolean =>\n !named(PRIVATE_NAME)(property) && !named(SYMBOL_NAME)(property);\n\nconst declaredIn =\n (project: Project, origin: Origin) =>\n (property: TypeSymbol): boolean =>\n originOf(project)(property) === origin;\n\nconst inheritedForm =\n (project: Project) =>\n (property: TypeSymbol): Found =>\n pipe(\n Option.fromNullishOr(property.getParent()),\n Option.flatMap((owner) => formOf(project)(owner.name)),\n );\n\nconst propertyTypesPart = (search: Search, properties: readonly TypeSymbol[]): Found => {\n const judged = pipe(properties, Arr.filter(isStringNamed));\n return pipe(\n Arr.zip(judged, search.project.checker.getTypeOfSymbol(judged)),\n Arr.findFirst(([property, type]) =>\n pipe(search.partOf(type), Option.map(under(property.name))),\n ),\n );\n};\n\nconst indexPart = (search: Search, type: Type): Found =>\n pipe(\n type.getIndexInfos(),\n Arr.findFirst((info) => {\n if (!info.isReadonly) {\n return here({ kind: \"index\" });\n }\n return pipe(search.partOf(info.valueType), Option.map(under(ELEMENT)));\n }),\n );\n\nconst membersPart = (search: Search, type: Type): Found => {\n const { project } = search;\n const properties = type.getProperties();\n const taken = pipe(\n sourceOf(type),\n Option.map(takenFromOutside(project)),\n Option.getOrElse((): readonly string[] => []),\n );\n const own = pipe(\n properties,\n Arr.filter(\n (property) => declaredIn(project, \"own\")(property) && !Arr.contains(taken, property.name),\n ),\n );\n return pipe(\n own,\n Arr.findFirst(isWritable(project.checker)),\n Option.map((property): WritablePart => ({\n path: [property.name],\n mutability: { kind: \"property\" },\n })),\n Option.orElse(() =>\n pipe(\n properties,\n Arr.filter(declaredIn(project, \"builtin\")),\n Arr.findFirst(inheritedForm(project)),\n ),\n ),\n Option.orElse(() => propertyTypesPart(search, own)),\n Option.orElse(() => indexPart(search, type)),\n );\n};\n\nconst isFunction = (type: Type): boolean =>\n Arr.isReadonlyArrayNonEmpty(type.getCallSignatures()) &&\n Arr.isReadonlyArrayEmpty(type.getProperties());\n\nconst objectPart = (search: Search, type: Type): Found => {\n if (isFunction(type)) {\n return Option.none();\n }\n if (search.project.checker.isArrayType(type)) {\n return arrayPart(search, type);\n }\n if (type.isTupleType()) {\n return tuplePart(search, type);\n }\n return pipe(\n declaredOutside(search.project, type),\n Option.getOrElse(() => membersPart(search, type)),\n );\n};\n\nconst typePart = (search: Search, type: Type): Found => {\n if (isOpaqueAlias(search.project, type)) {\n return Option.none();\n }\n if (type.isUnionType() || type.isIntersectionType()) {\n return firstPart(search, type.getTypes());\n }\n if (type.isConditionalType()) {\n return firstPart(search, [type.getTrueType(), type.getFalseType()]);\n }\n if (!type.isObjectType()) {\n return Option.none();\n }\n return objectPart(search, type);\n};\n\nexport const writablePartOf =\n (project: Project) =>\n (type: Type): Option.Option<WritablePart> => {\n const seen = new Set<Type>();\n const partOf = (inner: Type): Found => {\n if (seen.has(inner)) {\n return Option.none();\n }\n seen.add(inner);\n return typePart({ project, partOf }, inner);\n };\n return partOf(type);\n };\n","import type { ParserServices, TypedContext } from \"@r_masseater/oxlint-typed-rules\";\nimport { Array as Arr, Match, Option, String as Str, pipe } from \"effect\";\nimport type { Node } from \"tsrs/ast\";\nimport { isTypeNode } from \"tsrs/ast/is\";\nimport type { Type } from \"tsrs/sync\";\nimport type { ESTree, Rule, Visitor } from \"vite-plus/lint/plugins\";\n\nimport { typedRuleOf } from \"./typed-rule.ts\";\nimport { ELEMENT, writablePartOf } from \"./writable-part.ts\";\nimport type { Mutability, WritablePart } from \"./writable-part.ts\";\n\nconst MESSAGE =\n \"A function must not be able to change its arguments, but {{part}}. Declare the parameter with a read-only type. Types declared by a package or by the language are exempt unless the language has a read-only form of them.\";\nconst MESSAGE_ID = \"shouldBeReadonly\";\nconst WHOLE = \"the type\";\nconst SEPARATOR = \".\";\nconst TAGGABLE: readonly string[] = [\"string\", \"number\", \"bigint\"];\n\ntype Annotated = ESTree.FormalParameter | ESTree.FormalParameterRest;\n\ntype FunctionLike =\n | ESTree.ArrowFunctionExpression\n | ESTree.Function\n | ESTree.TSCallSignatureDeclaration\n | ESTree.TSConstructSignatureDeclaration\n | ESTree.TSFunctionType\n | ESTree.TSMethodSignature;\n\nconst isBrandObject = (type: Type): boolean =>\n type.isObjectType() &&\n Arr.isReadonlyArrayEmpty(type.getCallSignatures()) &&\n Arr.isReadonlyArrayEmpty(type.getConstructSignatures());\n\nconst isTaggable = (type: Type): boolean =>\n type.isLiteralType() ||\n type.isTemplateLiteralType() ||\n (type.isIntrinsicType() && Arr.contains(TAGGABLE, type.intrinsicName));\n\nconst isBrandedLiteral = (type: Type): boolean => {\n if (!type.isIntersectionType()) {\n return false;\n }\n const parts = type.getTypes();\n const objects = pipe(parts, Arr.filter(isBrandObject));\n const primitives = pipe(parts, Arr.filter(isTaggable));\n return (\n Arr.isReadonlyArrayNonEmpty(objects) &&\n Arr.isReadonlyArrayNonEmpty(primitives) &&\n objects.length + primitives.length === parts.length\n );\n};\n\nconst isBrandedLiteralLike = (type: Type): boolean => {\n if (type.isUnionType()) {\n return pipe(type.getTypes(), Arr.every(isBrandedLiteral));\n }\n return isBrandedLiteral(type);\n};\n\nconst outermost = (node: Node): Node =>\n pipe(\n Option.fromNullishOr(node.parent),\n Option.filter((parent) => parent.getStart() === node.getStart() && parent.end === node.end),\n Option.match({ onNone: () => node, onSome: outermost }),\n );\n\nconst unwrapped = (parameter: ESTree.ParamPattern): Annotated => {\n if (parameter.type === \"TSParameterProperty\") {\n return parameter.parameter;\n }\n return parameter;\n};\n\nconst annotationOf = (parameter: Annotated): Option.Option<ESTree.TSTypeAnnotation> => {\n if (parameter.type === \"AssignmentPattern\") {\n return Option.fromNullishOr(parameter.left.typeAnnotation);\n }\n return Option.fromNullishOr(parameter.typeAnnotation);\n};\n\nconst annotatedType = (services: ParserServices, parameter: Annotated): Option.Option<Type> =>\n pipe(\n annotationOf(parameter),\n Option.map((annotation) =>\n outermost(services.esTreeNodeToTSNodeMap.get(annotation.typeAnnotation)),\n ),\n Option.filter(isTypeNode),\n Option.map((node) => services.program.native.checker.getTypeFromTypeNode(node)),\n );\n\nconst subjectOf = (path: readonly string[]): string => {\n if (Arr.isReadonlyArrayEmpty(path)) {\n return WHOLE;\n }\n return `\\`${pipe(Arr.join(path, SEPARATOR), Str.replaceAll(`${SEPARATOR}${ELEMENT}`, ELEMENT))}\\``;\n};\n\nconst predicateOf = Match.type<Mutability>().pipe(\n Match.discriminatorsExhaustive(\"kind\")({\n array: () => \"is a mutable array\",\n tuple: () => \"is a mutable tuple\",\n property: () => \"is writable\",\n index: () => \"has a writable index signature\",\n form: ({ name, readonlyName }) =>\n `is a \\`${name}\\`, which has the read-only form \\`${readonlyName}\\``,\n }),\n);\n\nconst describe = ({ path, mutability }: WritablePart): string =>\n `${subjectOf(path)} ${predicateOf(mutability)}`;\n\nconst visitorOf = (context: TypedContext, services: ParserServices): Visitor => {\n const partOf = writablePartOf(services.program.native);\n const check = ({ params }: FunctionLike): void => {\n for (const parameter of pipe(params, Arr.map(unwrapped))) {\n const part = pipe(\n annotatedType(services, parameter),\n Option.filter((type) => !isBrandedLiteralLike(type)),\n Option.flatMap(partOf),\n );\n if (Option.isSome(part)) {\n context.report({\n node: parameter,\n messageId: MESSAGE_ID,\n data: { part: describe(part.value) },\n });\n }\n }\n };\n return {\n ArrowFunctionExpression: check,\n FunctionDeclaration: check,\n FunctionExpression: check,\n TSCallSignatureDeclaration: check,\n TSConstructSignatureDeclaration: check,\n TSDeclareFunction: check,\n TSEmptyBodyFunctionExpression: check,\n TSFunctionType: check,\n TSMethodSignature: check,\n };\n};\n\nexport const readonlyParameters: Rule = typedRuleOf({\n meta: { type: \"suggestion\", messages: { [MESSAGE_ID]: MESSAGE } },\n visitorOf,\n});\n","import { Array as Arr, Option, Schema, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nconst MESSAGE =\n \"Select min and max in separate queries. SQLite uses an index for a lone min or max only, so one select with both reads every row in the range, and D1 bills each row read.\";\n\nconst AGGREGATES = [\"min\", \"max\"] as const;\n\ntype Aggregate = (typeof AGGREGATES)[number];\n\nconst AggregateCallSchema = Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: Schema.Struct({\n type: Schema.Literal(\"Identifier\"),\n name: Schema.Literals(AGGREGATES),\n }),\n});\n\nconst PropertySchema = Schema.Struct({\n type: Schema.Literal(\"Property\"),\n value: Schema.Unknown,\n});\n\nconst SelectMemberSchema = Schema.Struct({\n type: Schema.Literal(\"MemberExpression\"),\n computed: Schema.Literal(false),\n property: Schema.Struct({\n type: Schema.Literal(\"Identifier\"),\n name: Schema.Literal(\"select\"),\n }),\n});\n\nconst decodeSelect = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"CallExpression\"),\n callee: SelectMemberSchema,\n arguments: Schema.Array(Schema.Unknown),\n }),\n);\n\nconst decodeFields = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"ObjectExpression\"),\n properties: Schema.Array(Schema.Unknown),\n }),\n);\n\nconst decodeProperty = Schema.decodeUnknownOption(PropertySchema);\nconst decodeAggregate = Schema.decodeUnknownOption(AggregateCallSchema);\n\nconst aggregateNameOf = (field: unknown): Option.Option<Aggregate> =>\n pipe(\n decodeProperty(field),\n Option.flatMap((property) => decodeAggregate(property.value)),\n Option.map((call) => call.callee.name),\n );\n\nconst aggregatesOf = (fields: readonly unknown[]): readonly Aggregate[] =>\n pipe(fields, Arr.map(aggregateNameOf), Arr.getSomes);\n\nconst selectsBoth = (node: unknown): boolean =>\n pipe(\n decodeSelect(node),\n Option.flatMap((call) => Arr.head(call.arguments)),\n Option.flatMap(decodeFields),\n Option.map((fields) => aggregatesOf(fields.properties)),\n Option.exists((found) => Arr.contains(found, \"min\") && Arr.contains(found, \"max\")),\n );\n\nexport const separateMinMax: Rule = {\n meta: { type: \"problem\" },\n create: (context) => ({\n CallExpression: (node): void => {\n if (selectsBoth(node)) {\n context.report({ node, message: MESSAGE });\n }\n },\n }),\n};\n","import { Array as Arr, Option, Predicate, Schema, String as Str, pipe } from \"effect\";\nimport type { Context, ESTree } from \"vite-plus/lint/plugins\";\n\nexport const SAY = \"say\";\nexport const CUTS = \"cuts\";\n\nexport type Property = ESTree.ObjectProperty;\nexport type StringLiteral = ESTree.StringLiteral;\nexport type ObjectExpression = ESTree.ObjectExpression;\nexport type Range = [number, number];\n\nconst START = 0;\nconst END = 1;\nconst NEXT = 1;\n\nexport const keyOf = (property: ObjectExpression[\"properties\"][number]): Option.Option<string> => {\n if (property.type !== \"Property\" || property.computed) {\n return Option.none();\n }\n if (property.key.type === \"Identifier\") {\n return Option.some(property.key.name);\n }\n if (property.key.type === \"Literal\" && Predicate.isString(property.key.value)) {\n return Option.some(property.key.value);\n }\n return Option.none();\n};\n\nexport const propertyOf =\n (key: string) =>\n (object: ObjectExpression): Option.Option<Property> =>\n Arr.findFirst(\n object.properties,\n (property): property is Property =>\n property.type === \"Property\" && Option.contains(keyOf(property), key),\n );\n\nexport const propertiesOf = (object: ObjectExpression): readonly Property[] =>\n pipe(\n object.properties,\n Arr.filter((property): property is Property => property.type === \"Property\"),\n );\n\nexport const isStringLiteral = (node: unknown): node is StringLiteral =>\n Predicate.hasProperty(node, \"type\") &&\n node[\"type\"] === \"Literal\" &&\n Predicate.hasProperty(node, \"value\") &&\n Predicate.isString(node[\"value\"]);\n\nconst unwrapped = (node: ESTree.Node): ESTree.Node => {\n if (\n node.type === \"TSAsExpression\" ||\n node.type === \"TSSatisfiesExpression\" ||\n node.type === \"TSNonNullExpression\"\n ) {\n return unwrapped(node.expression);\n }\n return node;\n};\n\nexport const asObject = (node: ESTree.Node): Option.Option<ObjectExpression> =>\n Option.liftPredicate(\n unwrapped(node),\n (value): value is ObjectExpression => value.type === \"ObjectExpression\",\n );\n\nexport const asArray = (node: ESTree.Node): Option.Option<ESTree.ArrayExpression> =>\n Option.liftPredicate(\n unwrapped(node),\n (value): value is ESTree.ArrayExpression => value.type === \"ArrayExpression\",\n );\n\nexport const stringsOf = (node: ESTree.Node): readonly StringLiteral[] =>\n pipe(\n asArray(node),\n Option.map(({ elements }) => pipe(elements, Arr.filter(isStringLiteral))),\n Option.getOrElse(() => []),\n );\n\nexport const saidOf = (property: Property): readonly StringLiteral[] => {\n if (!Option.contains(keyOf(property), SAY)) {\n return [];\n }\n return stringsOf(property.value);\n};\n\nexport const quotedOf = (text: string): string =>\n pipe(\n text,\n Str.replaceAll(\"\\\\\", String.raw`\\\\`),\n Str.replaceAll('\"', String.raw`\\\"`),\n Str.replaceAll(\"\\n\", String.raw`\\n`),\n (escaped) => `\"${escaped}\"`,\n );\n\nexport const removedRange = ({\n object,\n property,\n}: Readonly<{ object: ObjectExpression; property: Property }>): Range => {\n const index = object.properties.indexOf(property);\n const next = Arr.get(object.properties, index + NEXT);\n if (Option.isSome(next)) {\n return [property.range[START], next.value.range[START]];\n }\n return pipe(\n Arr.get(object.properties, index - NEXT),\n Option.map((previous): Range => [previous.range[END], property.range[END]]),\n Option.getOrElse((): Range => [property.range[START], property.range[END]]),\n );\n};\n\ntype TopLevel = ESTree.Program[\"body\"][number];\n\nconst declaratorsOf = (statement: TopLevel): readonly ESTree.VariableDeclarator[] => {\n if (statement.type === \"VariableDeclaration\") {\n return statement.declarations;\n }\n if (statement.type === \"ExportNamedDeclaration\") {\n return pipe(\n Option.fromNullishOr(statement.declaration),\n Option.filter(\n (declaration): declaration is ESTree.VariableDeclaration =>\n declaration.type === \"VariableDeclaration\",\n ),\n Option.map(({ declarations }) => declarations),\n Option.getOrElse(() => []),\n );\n }\n return [];\n};\n\nconst declaredArray = (context: Context, name: string): Option.Option<ESTree.ArrayExpression> =>\n pipe(\n context.sourceCode.ast.body,\n Arr.flatMap(declaratorsOf),\n Arr.findFirst(({ id }) => id.type === \"Identifier\" && id.name === name),\n Option.flatMap(({ init }) => Option.fromNullishOr(init)),\n Option.flatMap(asArray),\n );\n\nconst objectsOf = ({ elements }: ESTree.ArrayExpression): readonly ObjectExpression[] =>\n pipe(\n elements,\n Arr.filter(Predicate.isNotNull),\n Arr.flatMap((element) => Option.toArray(asObject(element))),\n );\n\nconst cutArrayOf =\n (context: Context) =>\n ({ value }: Property): Option.Option<ESTree.ArrayExpression> => {\n if (value.type === \"Identifier\") {\n return declaredArray(context, value.name);\n }\n return asArray(value);\n };\n\nexport const cutsOf = ({\n context,\n script,\n}: Readonly<{ context: Context; script: ObjectExpression }>): readonly ObjectExpression[] =>\n pipe(\n propertyOf(CUTS)(script),\n Option.flatMap(cutArrayOf(context)),\n Option.map(objectsOf),\n Option.getOrElse(() => []),\n );\n\nexport const Texts = Schema.Record(Schema.String, Schema.String);\n\nexport const optionsWith =\n <Value>({ schema, fallback }: Readonly<{ schema: Schema.Decoder<Value>; fallback: Value }>) =>\n (options: readonly unknown[]): Value =>\n pipe(\n Arr.head(options),\n Option.flatMap(Schema.decodeUnknownOption(schema)),\n Option.getOrElse(() => fallback),\n );\n","import { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nimport type { ObjectExpression, StringLiteral } from \"./video-script-ast.ts\";\nimport { asObject, keyOf, propertiesOf, saidOf } from \"./video-script-ast.ts\";\n\nconst UNREAD = \"unread\";\nconst MESSAGES = {\n [UNREAD]:\n \"英字の語「{{word}}」の読みが readings にない。VOICEVOX は英字を1文字ずつ読むことがある\",\n} as const;\n\nconst READINGS = \"readings\";\nconst RUBY = /\\{[^}]*\\}/gu;\nconst WORD = /[A-Za-z][A-Za-z0-9+#.-]*/gu;\n\nconst isRead =\n (keys: readonly string[]) =>\n (word: string): boolean =>\n pipe(\n keys,\n Arr.some((key) => Str.includes(key)(word) || Str.includes(word)(key)),\n );\n\nconst wordsOf = (say: string): readonly string[] =>\n pipe(\n Str.replaceAll(RUBY, Str.empty)(say),\n Str.matchAll(WORD),\n Arr.fromIterable,\n Arr.map(([word]) => word),\n Arr.dedupe,\n );\n\nconst keysOf = ({ properties }: ObjectExpression): readonly string[] =>\n pipe(\n properties,\n Arr.flatMap((property) => Option.toArray(keyOf(property))),\n );\n\nexport const videoReadings: Rule = {\n meta: { type: \"problem\", messages: MESSAGES },\n create: (context) => {\n const keys: string[] = [];\n const said: StringLiteral[] = [];\n return {\n ObjectExpression: (object): void => {\n for (const node of propertiesOf(object)) {\n said.push(...saidOf(node));\n if (Option.contains(keyOf(node), READINGS)) {\n keys.push(...pipe(asObject(node.value), Option.toArray, Arr.flatMap(keysOf)));\n }\n }\n },\n \"Program:exit\": (): void => {\n for (const literal of said) {\n for (const word of pipe(\n wordsOf(literal.value),\n Arr.filter((candidate) => !isRead(keys)(candidate)),\n )) {\n context.report({ node: literal, messageId: UNREAD, data: { word } });\n }\n }\n },\n };\n },\n};\n","import { Array as Arr, Record as Rec, Schema, String as Str, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nimport type { StringLiteral } from \"./video-script-ast.ts\";\nimport { Texts, optionsWith, propertiesOf, quotedOf, saidOf } from \"./video-script-ast.ts\";\n\nconst FIX = \"fix\";\nconst BANNED = \"banned\";\nconst EMPHASIS = \"emphasis\";\n\nconst MESSAGES = {\n [FIX]:\n \"「{{say}}」は日本語と英数字の間に空白があるか、決まった言葉を言い換えている。「{{fixed}}」と書く\",\n [BANNED]: \"「{{say}}」に「{{word}}」がある。{{instead}}\",\n [EMPHASIS]: \"「{{say}}」の太字(**)が{{count}}か所ある。{{max}}か所までにする\",\n} as const;\n\nconst JAPANESE = String.raw`[\\p{Script=Han}\\p{Script=Hiragana}\\p{Script=Katakana}ー々、。!?」』)]`;\nconst LATIN = \"[A-Za-z0-9]\";\nconst SPACE = \"[  ]+\";\nconst AFTER_JAPANESE = new RegExp(`(?<head>${JAPANESE}[*}]*)${SPACE}(?<tail>[*{]*${LATIN})`, \"gu\");\nconst BEFORE_JAPANESE = new RegExp(`(?<head>${LATIN}[*}]*)${SPACE}(?<tail>[*{]*${JAPANESE})`, \"gu\");\nconst KEPT = \"$<head>$<tail>\";\nconst OUTSIDE_RUBY = String.raw`(?![^{]*\\})`;\nconst EMPHASIZED = /\\*\\*[^*]+\\*\\*/gu;\nconst SPECIAL = /[.*+?^${}()|[\\]\\\\]/gu;\nconst ESCAPED = String.raw`\\$&`;\nconst DEFAULT_MAX = 1;\n\nconst OptionsSchema = Schema.Struct({\n terms: Schema.optional(Texts),\n banned: Schema.optional(Texts),\n maxEmphasis: Schema.optional(Schema.Finite),\n});\n\nconst optionsOf = optionsWith({ schema: OptionsSchema, fallback: {} });\n\nconst unspacedOf = (say: string): string =>\n pipe(say, Str.replaceAll(AFTER_JAPANESE, KEPT), Str.replaceAll(BEFORE_JAPANESE, KEPT));\n\nconst outsideRuby = (word: string): RegExp =>\n new RegExp(`${Str.replaceAll(SPECIAL, ESCAPED)(word)}${OUTSIDE_RUBY}`, \"gu\");\n\nconst termedOf =\n (terms: Readonly<Record<string, string>>) =>\n (say: string): string =>\n Arr.reduce(Rec.toEntries(terms), say, (text, [vague, precise]) =>\n Str.replaceAll(outsideRuby(vague), precise)(text),\n );\n\nconst emphasisCount = (say: string): number =>\n Arr.fromIterable(Str.matchAll(EMPHASIZED)(say)).length;\n\nexport const videoSay: Rule = {\n meta: {\n type: \"suggestion\",\n fixable: \"code\",\n messages: MESSAGES,\n schema: [{ type: \"object\", additionalProperties: true }],\n },\n create: (context) => {\n const { terms = {}, banned = {}, maxEmphasis = DEFAULT_MAX } = optionsOf(context.options);\n const check = (literal: StringLiteral): void => {\n const say = literal.value;\n const fixed = termedOf(terms)(unspacedOf(say));\n if (fixed !== say) {\n context.report({\n node: literal,\n messageId: FIX,\n data: { say, fixed },\n fix: (fixer) => fixer.replaceText(literal, quotedOf(fixed)),\n });\n }\n for (const [word, instead] of Rec.toEntries(banned)) {\n if (Str.includes(word)(say)) {\n context.report({ node: literal, messageId: BANNED, data: { say, word, instead } });\n }\n }\n const count = emphasisCount(say);\n if (count > maxEmphasis) {\n context.report({\n node: literal,\n messageId: EMPHASIS,\n data: { say, count: String(count), max: String(maxEmphasis) },\n });\n }\n };\n return {\n ObjectExpression: (node): void => {\n for (const literal of pipe(propertiesOf(node), Arr.flatMap(saidOf))) {\n check(literal);\n }\n },\n };\n },\n};\n","import { Array as Arr, Option, Record as Rec, pipe } from \"effect\";\nimport type { Context, ESTree } from \"vite-plus/lint/plugins\";\n\nimport type { ObjectExpression, Property } from \"./video-script-ast.ts\";\nimport { asObject, propertyOf } from \"./video-script-ast.ts\";\n\nconst START = 0;\nconst NEXT = 1;\n\nexport interface ValuesCheck {\n readonly context: Context;\n readonly object: ObjectExpression;\n readonly values: Readonly<Record<string, string>>;\n readonly name: string;\n readonly before: Option.Option<ESTree.Node>;\n}\n\nexport const textOf =\n (context: Context) =>\n (node: ESTree.Node): string =>\n context.sourceCode.getText(node);\n\nconst valueTarget = (property: Property): ESTree.Node =>\n pipe(\n asObject(property.value),\n Option.flatMap(({ properties }) =>\n Arr.findFirst(\n properties,\n (part): part is ESTree.SpreadElement => part.type === \"SpreadElement\",\n ),\n ),\n Option.match({ onNone: () => property.value, onSome: ({ argument }) => argument }),\n );\n\nconst reportMissing = (\n { context, object, before }: ValuesCheck,\n {\n key,\n expected,\n data,\n }: Readonly<{ key: string; expected: string; data: Readonly<Record<string, string>> }>,\n): void => {\n context.report({\n node: object,\n messageId: \"value\",\n data,\n fix: (fixer) =>\n Option.match(before, {\n onNone: () =>\n fixer.insertTextAfterRange(\n [object.range[START], object.range[START] + NEXT],\n ` ${key}: ${expected},`,\n ),\n onSome: (node) => fixer.insertTextBefore(node, `${key}: ${expected},\\n `),\n }),\n });\n};\n\nconst checkValue =\n (check: ValuesCheck) =>\n ([key, expected]: readonly [string, string]): void => {\n const { context, object, name } = check;\n const data = { series: name, key, expected };\n const property = propertyOf(key)(object);\n if (Option.isNone(property)) {\n reportMissing(check, { key, expected, data });\n return;\n }\n const target = valueTarget(property.value);\n if (textOf(context)(target) !== expected) {\n context.report({\n node: target,\n messageId: \"value\",\n data,\n fix: (fixer) => fixer.replaceText(target, expected),\n });\n }\n };\n\nexport const checkValues = (check: ValuesCheck): void => {\n for (const entry of Rec.toEntries(check.values)) {\n checkValue(check)(entry);\n }\n};\n","import { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Context } from \"vite-plus/lint/plugins\";\n\nimport type { VideoIntro } from \"#/shared/config/index.ts\";\n\nimport type { ObjectExpression, StringLiteral } from \"./video-script-ast.ts\";\nimport {\n SAY,\n cutsOf,\n isStringLiteral,\n propertyOf,\n quotedOf,\n removedRange,\n stringsOf,\n} from \"./video-script-ast.ts\";\nimport { checkValues } from \"./video-values.ts\";\n\nexport type IntroRule = VideoIntro;\n\nexport interface IntroCheck {\n readonly context: Context;\n readonly script: ObjectExpression;\n readonly name: string;\n readonly rule: IntroRule;\n}\n\nconst ID = \"id\";\nconst AT = \"at\";\nconst INTRO = \"intro\";\nconst PART = \"|\";\nconst NEXT = 1;\n\nconst isIntro = (cut: ObjectExpression): boolean =>\n pipe(\n propertyOf(ID)(cut),\n Option.exists(({ value }) => isStringLiteral(value) && value.value === INTRO),\n );\n\nconst partedLines = (cut: ObjectExpression): readonly StringLiteral[] =>\n pipe(\n propertyOf(SAY)(cut),\n Option.map(({ value }) => stringsOf(value)),\n Option.getOrElse((): readonly StringLiteral[] => []),\n Arr.filter(({ value }) => Str.includes(PART)(value)),\n );\n\nconst checkBeats = ({ context, name }: IntroCheck, cut: ObjectExpression): void => {\n if (Option.isNone(propertyOf(AT)(cut)) || Arr.isReadonlyArrayEmpty(partedLines(cut))) {\n context.report({ node: cut, messageId: \"beats\", data: { series: name } });\n }\n};\n\nconst checkPlain = ({ context, name }: IntroCheck, cut: ObjectExpression): void => {\n const data = { series: name };\n for (const property of Option.toArray(propertyOf(AT)(cut))) {\n context.report({\n node: property,\n messageId: \"plainBeats\",\n data,\n fix: (fixer) => fixer.removeRange(removedRange({ object: cut, property })),\n });\n }\n for (const line of partedLines(cut)) {\n context.report({\n node: line,\n messageId: \"plainParts\",\n data,\n fix: (fixer) =>\n fixer.replaceText(line, quotedOf(Str.replaceAll(PART, Str.empty)(line.value))),\n });\n }\n};\n\nexport const checkIntro = (check: IntroCheck): void => {\n const { context, script, name, rule } = check;\n const intro = Arr.findFirst(cutsOf({ context, script }), isIntro);\n if (Option.isNone(intro)) {\n context.report({ node: script, messageId: \"noIntro\", data: { series: name } });\n return;\n }\n if (rule === \"beats\") {\n checkBeats(check, intro.value);\n return;\n }\n checkPlain(check, intro.value);\n};\n\nexport interface AfterIntroCheck {\n readonly context: Context;\n readonly script: ObjectExpression;\n readonly name: string;\n readonly values: Readonly<Record<string, string>>;\n}\n\nexport const checkIntroValues = ({ context, script, name, values }: AfterIntroCheck): void => {\n for (const cut of Option.toArray(Arr.findFirst(cutsOf({ context, script }), isIntro))) {\n checkValues({ context, object: cut, values, name, before: Option.none() });\n }\n};\n\nexport const checkAfterIntro = ({ context, script, name, values }: AfterIntroCheck): void => {\n const cuts = cutsOf({ context, script });\n const next = pipe(\n Arr.findFirstIndex(cuts, isIntro),\n Option.flatMap((index) => Arr.get(cuts, index + NEXT)),\n );\n for (const cut of Option.toArray(next)) {\n checkValues({ context, object: cut, values, name, before: Option.none() });\n }\n};\n","import { Array as Arr, Option, Record as Rec, Schema, pipe } from \"effect\";\nimport type { Context, ESTree, Rule } from \"vite-plus/lint/plugins\";\n\nimport { VIDEO_INTROS } from \"#/shared/config/index.ts\";\n\nimport { checkAfterIntro, checkIntro, checkIntroValues } from \"./video-intro.ts\";\nimport type { ObjectExpression } from \"./video-script-ast.ts\";\nimport {\n CUTS,\n Texts,\n cutsOf,\n isStringLiteral,\n keyOf,\n optionsWith,\n propertiesOf,\n propertyOf,\n removedRange,\n} from \"./video-script-ast.ts\";\nimport { checkValues, textOf } from \"./video-values.ts\";\n\nconst MESSAGES = {\n unknown: \"series「{{series}}」の決まりがない。{{known}} のどれかにする\",\n value: \"{{series}} の {{key}} は {{expected}} にする\",\n banned: \"{{key}} を使わない。{{reason}}\",\n voice: \"{{series}} に出ない話者 {{voice}} が話している\",\n opener: \"{{series}} の最初の台詞は {{voice}} が言う\",\n closer: \"{{series}} の最後の台詞は {{voice}} が言う\",\n noIntro: \"{{series}} は最初のカットを intro にする\",\n plainBeats: \"{{series}} のイントロは音ハメしない。at を外す\",\n plainParts: \"{{series}} のイントロは句に分けず、1つの台詞で読む\",\n beats: \"{{series}} のイントロは「|」で句に分け、at で各句の頭を拍に置く\",\n} as const;\n\nconst SERIES = \"series\";\nconst VOICE = \"voice\";\n\nconst SeriesSchema = Schema.Struct({\n values: Schema.optional(Texts),\n voices: Schema.String.pipe(Schema.Array, Schema.optional),\n opener: Schema.optional(Schema.String),\n closer: Schema.optional(Schema.String),\n intro: Schema.optional(Schema.Literals(VIDEO_INTROS)),\n introValues: Schema.optional(Texts),\n afterIntro: Schema.optional(Texts),\n});\n\ntype Series = typeof SeriesSchema.Type;\n\nconst OptionsSchema = Schema.Struct({\n series: Schema.Record(Schema.String, SeriesSchema),\n banned: Schema.optional(Texts),\n});\n\ntype Options = typeof OptionsSchema.Type;\n\nconst optionsOf = optionsWith({ schema: OptionsSchema, fallback: { series: {} } });\n\ninterface Check {\n readonly context: Context;\n readonly script: ObjectExpression;\n readonly name: string;\n readonly series: Series;\n}\n\nconst voiceOf = (context: Context, object: ObjectExpression): Option.Option<string> =>\n Option.map(propertyOf(VOICE)(object), ({ value }) => textOf(context)(value));\n\nconst speakerOf =\n ({ context, script }: Check) =>\n (cut: ObjectExpression): Option.Option<string> =>\n Option.orElse(voiceOf(context, cut), () => voiceOf(context, script));\n\nconst checkCast = (check: Check, cuts: readonly ObjectExpression[]): void => {\n const { context, name, series } = check;\n const voices = series.voices ?? [];\n if (Arr.isReadonlyArrayEmpty(voices)) {\n return;\n }\n for (const cut of cuts) {\n for (const voice of Option.toArray(speakerOf(check)(cut))) {\n if (!voices.includes(voice)) {\n context.report({ node: cut, messageId: \"voice\", data: { series: name, voice } });\n }\n }\n }\n};\n\nconst checkEnds = (check: Check, cuts: readonly ObjectExpression[]): void => {\n const { context, name, series } = check;\n const ends = [\n [\"opener\", series.opener, Arr.head(cuts)],\n [\"closer\", series.closer, Arr.last(cuts)],\n ] as const;\n for (const [messageId, voice, cut] of ends) {\n for (const [expected, end] of Option.toArray(Option.all([Option.fromNullishOr(voice), cut]))) {\n if (!Option.contains(speakerOf(check)(end), expected)) {\n context.report({ node: end, messageId, data: { series: name, voice: expected } });\n }\n }\n }\n};\n\nconst checkVoices = (check: Check): void => {\n const cuts = cutsOf({ context: check.context, script: check.script });\n checkCast(check, cuts);\n checkEnds(check, cuts);\n};\n\nconst checkBanned = (\n context: Context,\n {\n object,\n banned,\n }: Readonly<{ object: ObjectExpression; banned: Readonly<Record<string, string>> }>,\n): void => {\n for (const property of propertiesOf(object)) {\n for (const reason of Option.toArray(\n Option.flatMap(keyOf(property), (key) => Rec.get(banned, key)),\n )) {\n context.report({\n node: property,\n messageId: \"banned\",\n data: { key: textOf(context)(property.key), reason },\n fix: (fixer) => fixer.removeRange(removedRange({ object, property })),\n });\n }\n }\n};\n\nconst seriesNameOf = (script: ObjectExpression): Option.Option<ESTree.StringLiteral> =>\n pipe(\n propertyOf(SERIES)(script),\n Option.map(({ value }) => value),\n Option.filter(isStringLiteral),\n );\n\nconst checkSeries = (check: Check): void => {\n const { context, script, name, series } = check;\n checkValues({\n context,\n object: script,\n values: series.values ?? {},\n name,\n before: propertyOf(CUTS)(script),\n });\n checkIntroValues({ context, script, name, values: series.introValues ?? {} });\n checkAfterIntro({ context, script, name, values: series.afterIntro ?? {} });\n checkVoices(check);\n for (const rule of Option.toArray(Option.fromNullishOr(check.series.intro))) {\n checkIntro({ context: check.context, script: check.script, name: check.name, rule });\n }\n};\n\nconst checkScript = (\n context: Context,\n { script, options }: Readonly<{ script: ObjectExpression; options: Options }>,\n): void => {\n for (const literal of Option.toArray(seriesNameOf(script))) {\n const name = literal.value;\n const series = Rec.get(options.series, name);\n if (Option.isNone(series)) {\n context.report({\n node: literal,\n messageId: \"unknown\",\n data: { series: name, known: Arr.join(Rec.keys(options.series), \", \") },\n });\n return;\n }\n checkSeries({ context, script, name, series: series.value });\n }\n};\n\nexport const videoSeries: Rule = {\n meta: {\n type: \"problem\",\n fixable: \"code\",\n messages: MESSAGES,\n schema: [{ type: \"object\", additionalProperties: true }],\n },\n create: (context) => {\n const options = optionsOf(context.options);\n return {\n ObjectExpression: (object): void => {\n checkBanned(context, { object, banned: options.banned ?? {} });\n if (Option.isSome(propertyOf(CUTS)(object))) {\n checkScript(context, { script: object, options });\n }\n },\n };\n },\n};\n","import type { Rule } from \"vite-plus/lint/plugins\";\n\nimport { videoReadings } from \"./video-readings.ts\";\nimport { videoSay } from \"./video-say.ts\";\nimport { videoSeries } from \"./video-series.ts\";\n\nexport const VIDEO_RULES: Readonly<Record<string, Rule>> = {\n \"video-readings\": videoReadings,\n \"video-say\": videoSay,\n \"video-series\": videoSeries,\n};\n","import type { Rule } from \"vite-plus/lint/plugins\";\n\nimport { arrayFromAsync } from \"./array-from-async.ts\";\nimport { ecosystemReaders } from \"./ecosystem-readers.ts\";\nimport { explicitImportPath } from \"./explicit-import-path.ts\";\nimport { getOrInsert } from \"./get-or-insert.ts\";\nimport { inlineExports } from \"./inline-exports.ts\";\nimport { mcpToolLayer } from \"./mcp-tool-layer.ts\";\nimport { readonlyParameters } from \"./readonly-parameters.ts\";\nimport { separateMinMax } from \"./separate-min-max.ts\";\nimport { VIDEO_RULES } from \"./video-rules.ts\";\n\nexport const CODED_RULES: Readonly<Record<string, Rule>> = {\n \"array-from-async\": arrayFromAsync,\n \"ecosystem-readers\": ecosystemReaders,\n \"explicit-import-path\": explicitImportPath,\n \"get-or-insert\": getOrInsert,\n \"inline-exports\": inlineExports,\n \"mcp-tool-layer\": mcpToolLayer,\n \"readonly-parameters\": readonlyParameters,\n \"separate-min-max\": separateMinMax,\n ...VIDEO_RULES,\n};\n","import { toPosix } from \"@masseater.dev/path-kit\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Context, ESTree, Rule } from \"vite-plus/lint/plugins\";\n\nconst NAMESPACE = \"*\";\nconst DEFAULT = \"default\";\n\nexport interface ImportBan {\n readonly module: string;\n readonly names: Option.Option<readonly string[]>;\n readonly typesAllowed: boolean;\n}\n\nexport interface MemberBan {\n readonly object: string;\n readonly properties: readonly string[];\n}\n\nexport interface Intent {\n readonly message: string;\n readonly home: Option.Option<string>;\n readonly imports: readonly ImportBan[];\n readonly members: readonly MemberBan[];\n}\n\nconst importedName = (specifier: ESTree.ImportDeclarationSpecifier): string => {\n if (specifier.type === \"ImportDefaultSpecifier\") {\n return DEFAULT;\n }\n if (specifier.type === \"ImportNamespaceSpecifier\") {\n return NAMESPACE;\n }\n if (specifier.imported.type === \"Identifier\") {\n return specifier.imported.name;\n }\n return specifier.imported.value;\n};\n\nconst isTypeOnly = (\n node: ESTree.ImportDeclaration,\n specifier: ESTree.ImportDeclarationSpecifier,\n): boolean =>\n node.importKind === \"type\" ||\n (specifier.type === \"ImportSpecifier\" && specifier.importKind === \"type\");\n\nconst isBannedSpecifier =\n (node: ESTree.ImportDeclaration, ban: ImportBan, names: readonly string[]) =>\n (specifier: ESTree.ImportDeclarationSpecifier): boolean =>\n !(ban.typesAllowed && isTypeOnly(node, specifier)) &&\n Arr.contains([NAMESPACE, ...names], importedName(specifier));\n\nconst wholeImport = (node: ESTree.ImportDeclaration, ban: ImportBan): readonly ESTree.Node[] => {\n if (ban.typesAllowed && node.importKind === \"type\") {\n return [];\n }\n return [node];\n};\n\nconst bannedIn =\n (node: ESTree.ImportDeclaration) =>\n (ban: ImportBan): readonly ESTree.Node[] => {\n if (node.source.value !== ban.module) {\n return [];\n }\n return Option.match(ban.names, {\n onNone: () => wholeImport(node, ban),\n onSome: (names): readonly ESTree.Node[] =>\n pipe(node.specifiers, Arr.filter(isBannedSpecifier(node, ban, names))),\n });\n };\n\nconst propertyOf = (node: ESTree.MemberExpression): Option.Option<string> => {\n if (!node.computed && node.property.type === \"Identifier\") {\n return Option.some(node.property.name);\n }\n if (node.property.type === \"Literal\" && typeof node.property.value === \"string\") {\n return Option.some(node.property.value);\n }\n return Option.none();\n};\n\nconst isBannedMember =\n (node: ESTree.MemberExpression) =>\n (ban: MemberBan): boolean =>\n node.object.type === \"Identifier\" &&\n node.object.name === ban.object &&\n pipe(\n propertyOf(node),\n Option.exists((property) => Arr.contains(ban.properties, property)),\n );\n\nconst reportImports = (context: Context, intent: Intent, node: ESTree.ImportDeclaration): void => {\n const banned = pipe(intent.imports, Arr.flatMap(bannedIn(node)));\n for (const found of banned) {\n context.report({ node: found, message: intent.message });\n }\n};\n\nconst isHome = (intent: Intent, filename: string): boolean =>\n Option.exists(intent.home, (home) => Str.endsWith(home)(toPosix(filename)));\n\nexport const ruleOf = (intent: Intent): Rule => ({\n meta: { type: \"problem\" },\n create: (context) => {\n if (isHome(intent, context.filename)) {\n return {};\n }\n return {\n ImportDeclaration: (node): void => {\n reportImports(context, intent, node);\n },\n MemberExpression: (node): void => {\n if (pipe(intent.members, Arr.some(isBannedMember(node)))) {\n context.report({ node, message: intent.message });\n }\n },\n };\n },\n});\n","import { Option } from \"effect\";\n\nimport type { Intent } from \"./intent-rule.ts\";\n\nconst RUN_MESSAGE =\n \"Run Effects with run or runner from @r_masseater/masseater-utils/workers-tracing/effect, so their spans reach the Workers trace.\";\n\nconst RUN_FUNCTIONS: readonly string[] = [\n \"runPromise\",\n \"runPromiseExit\",\n \"runFork\",\n \"runCallback\",\n \"runSync\",\n \"runSyncExit\",\n \"runPromiseWith\",\n \"runPromiseExitWith\",\n \"runForkWith\",\n \"runCallbackWith\",\n \"runSyncWith\",\n \"runSyncExitWith\",\n];\n\nconst HAND_WRITTEN_SQL =\n \"Build queries with the Drizzle query builder, so that their columns and types come from the schema. Do not write SQL by hand with sql.\";\n\nexport const INTENTS: Readonly<Record<string, Intent>> = {\n \"ui-state-in-atoms\": {\n message:\n \"Keep UI state in effect-atom (Atom.make, useAtom, useAtomValue), so that state has one home outside the component tree. Do not use React state hooks or context.\",\n home: Option.none(),\n imports: [\n {\n module: \"react\",\n names: Option.some([\"useState\", \"useReducer\", \"createContext\", \"useContext\"]),\n typesAllowed: false,\n },\n ],\n members: [],\n },\n \"no-hand-written-sql\": {\n message: HAND_WRITTEN_SQL,\n home: Option.none(),\n imports: [\n { module: \"drizzle-orm\", names: Option.some([\"sql\"]), typesAllowed: false },\n { module: \"drizzle-orm/sql\", names: Option.none(), typesAllowed: false },\n ],\n members: [],\n },\n \"traced-elysia\": {\n message:\n \"Import Elysia from @r_masseater/masseater-utils/workers-tracing/elysia, so every handle call is a span.\",\n home: Option.none(),\n imports: [{ module: \"elysia\", names: Option.some([\"Elysia\", \"default\"]), typesAllowed: true }],\n members: [],\n },\n \"traced-effect-run\": {\n message: RUN_MESSAGE,\n home: Option.none(),\n imports: [\n { module: \"effect/Effect\", names: Option.some(RUN_FUNCTIONS), typesAllowed: false },\n { module: \"effect/ManagedRuntime\", names: Option.some([\"make\"]), typesAllowed: false },\n ],\n members: [\n { object: \"Effect\", properties: RUN_FUNCTIONS },\n { object: \"ManagedRuntime\", properties: [\"make\"] },\n ],\n },\n \"platform-node-by-module\": {\n message:\n 'Import names from a module path, such as import { layer } from \"@effect/platform-node/NodeServices\". The package root loads every module, the Redis client included, and adds about 250 ms to each start.',\n home: Option.none(),\n imports: [{ module: \"@effect/platform-node\", names: Option.none(), typesAllowed: true }],\n members: [],\n },\n \"main-through-node-main\": {\n message:\n 'Start a Node.js program with runMain from \"@r_masseater/masseater-utils/node-main\", so that it is traced and a failure prints one line instead of a stack trace.',\n home: Option.some(\"/src/features/run-main/model/run-main.ts\"),\n imports: [\n {\n module: \"@effect/platform-node/NodeRuntime\",\n names: Option.some([\"runMain\"]),\n typesAllowed: false,\n },\n {\n module: \"@effect/platform-node-shared/NodeRuntime\",\n names: Option.some([\"runMain\"]),\n typesAllowed: false,\n },\n ],\n members: [{ object: \"NodeRuntime\", properties: [\"runMain\"] }],\n },\n \"typed-calls-not-reflect\": {\n message:\n \"Read properties and call functions through typed access, or decode untyped values with Schema at the boundary. Do not go around the types with Reflect.\",\n home: Option.none(),\n imports: [],\n members: [{ object: \"Reflect\", properties: [\"get\", \"apply\"] }],\n },\n \"db-writes-in-writers\": {\n message:\n \"Write tables only from a *-writer.server.ts module, so that a table update and its revision go into the same batch. Call the writer here instead of writing through db.\",\n home: Option.none(),\n imports: [],\n members: [{ object: \"db\", properties: [\"insert\", \"update\", \"delete\", \"batch\", \"run\"] }],\n },\n};\n","import type { Restriction } from \"./selector-rule.ts\";\n\nconst UNGATED =\n \"モデルの呼び出しは AI Gateway を通す。通らない呼び出しには日ごとの費用の上限が掛からず、無料枠を超えた分がそのまま請求される\";\n\nconst MODEL_RUN =\n 'CallExpression[callee.property.name=\"run\"]:matches([callee.object.name=\"AI\"], [callee.object.property.name=\"AI\"])';\n\nconst AI_RUN_URL =\n \":matches(Literal[value=/ai.run/], TemplateLiteral:has(TemplateElement[value.raw=/ai.run/]))\";\n\nconst AI_RUN_REQUEST = `CallExpression:has(> ${AI_RUN_URL})`;\n\nconst GATEWAY = 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"]';\n\nexport const MODEL_CALL_RULES: Readonly<Record<string, Restriction>> = {\n \"attributed-model-call\": {\n message:\n \"モデルの呼び出しは AI Gateway を通し、呼び出し元を metadata に載せる。載せないと、費用やエラーを後から呼び出し元で引けない\",\n selectors: [\n `${MODEL_RUN}[arguments.length<3]`,\n 'CallExpression[callee.name=\"runWorkersAi\"] > ObjectExpression > Property[key.name=\"call\"] > ArrowFunctionExpression[params.length=0]',\n 'CallExpression[callee.name=\"createAI\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"metadata\"]))',\n 'ObjectExpression:has(Property[key.value=\"cf-aig-gateway-id\"]):not(:has(Property[key.value=\"cf-aig-metadata\"]))',\n ],\n },\n \"gated-model-call\": {\n message: `${UNGATED}。AI.run の第 3 引数には、runWorkersAi の call が受け取る options をそのまま渡す`,\n selectors: [`${MODEL_RUN} > .arguments:nth-child(3):not(Identifier[name=\"options\"])`],\n },\n \"gated-model-request\": {\n message: `${UNGATED}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n selectors: [\n `${AI_RUN_REQUEST} > ObjectExpression.arguments:not(:has(Property[key.name=\"headers\"]))`,\n `${AI_RUN_REQUEST} > ObjectExpression.arguments > Property[key.name=\"headers\"] > ObjectExpression:not(:has(Property[key.value=\"cf-aig-gateway-id\"]))`,\n ],\n },\n \"workers-ai-through-runner\": {\n message:\n \"Workers AI は @r_masseater/masseater-utils/workers-tracing/workers-ai の runWorkersAi の中で呼ぶ。外で呼ぶと、容量不足のエラーが再試行されず、途中で切れた答えもログに残らない\",\n selectors: [`${MODEL_RUN}:not(CallExpression[callee.name=\"runWorkersAi\"] *)`],\n },\n \"ai-gateway-logs\": {\n message:\n \"AI Gateway には collectLogs: true を付ける。付けないと、モデルの呼び出しが後から引けない\",\n selectors: [\n `${GATEWAY} > ObjectExpression.arguments:not(:has(Property[key.name=\"collectLogs\"][value.value=true]))`,\n ],\n },\n \"ai-gateway-spend-limit\": {\n message:\n \"AI Gateway には spendLimits を enabled: true で付け、日ごとの費用の上限を掛ける。付けないと、従量課金のモデルの呼び出しが上限なく請求される\",\n selectors: [\n `${GATEWAY} > ObjectExpression.arguments:not(:has(Property[key.name=\"spendLimits\"] > ObjectExpression > Property[key.name=\"enabled\"][value.value=true]))`,\n ],\n },\n \"ai-gateway-cache\": {\n message:\n \"AI Gateway には cacheTtl を付け、同じ問いの答えをキャッシュする。付けないと、同じ問いにも毎回課金される\",\n selectors: [`${GATEWAY} > ObjectExpression.arguments:not(:has(Property[key.name=\"cacheTtl\"]))`],\n },\n};\n","import type { Restriction } from \"./selector-rule.ts\";\n\nconst LOGPUSH = 'Property[key.name=\"logpush\"]:not([value.value=false])';\n\nconst CPU_LIMIT = 'Property[key.name=\"limits\"]:has(Property[key.name=\"cpuMs\"])';\n\nexport const RESOURCE_RULES: Readonly<Record<string, Restriction>> = {\n \"worker-logpush\": {\n message:\n \"Worker には logpush: true を付ける。付けないと、その Worker のログが Logpush に流れない\",\n selectors: [\n `CallExpression[callee.object.name=\"Workers\"][callee.property.name=\"Worker\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n `CallExpression[callee.object.name=\"Website\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n ],\n },\n \"worker-cpu-limit\": {\n message:\n \"コードを動かす Worker には limits.cpuMs を付け、本番の CPU 時間の最大値をわずかに上回る値にする。付けないと、1 回の暴走が上限の CPU 時間まで請求される\",\n selectors: [\n `CallExpression[callee.object.name=/^(Workers|Website)$/] > ObjectExpression.arguments:has(Property[key.name=\"main\"]):not(:has(${CPU_LIMIT}))`,\n `CallExpression[callee.object.name=\"Website\"]:not([callee.property.name=\"StaticSite\"]) > ObjectExpression.arguments:not(:has(${CPU_LIMIT}))`,\n ],\n },\n \"protected-storage\": {\n message:\n \"D1 と R2 は作り直すと中身が消えるので、alchemy の RemovalPolicy.protect() を .pipe で付けて置き換えと削除を止める\",\n selectors: [\n 'CallExpression[callee.object.name=/^(D1|R2)$/][callee.property.name=/^(Database|Bucket)$/]:not(CallExpression[callee.property.name=\"pipe\"][arguments.0.callee.object.name=\"RemovalPolicy\"] > MemberExpression.callee > CallExpression.object)',\n ],\n },\n \"stack-named-by-app\": {\n message: \"スタック名には app-name.ts の APP_NAME を渡す\",\n selectors: ['CallExpression[callee.name=\"Stack\"]:not([arguments.0.name=\"APP_NAME\"])'],\n },\n \"stack-checks-app-prefix\": {\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n selectors: [\n 'Program:not(:has(YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n 'CallExpression[callee.name=\"Stack\"] > .arguments:nth-child(3):not(:has(FunctionExpression > BlockStatement > ExpressionStatement:nth-last-child(2) > YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n ],\n },\n};\n","import { Array as Arr, Record as Rec, pipe } from \"effect\";\nimport type { ESTree, Rule } from \"vite-plus/lint/plugins\";\n\nexport interface Restriction {\n readonly message: string;\n readonly selectors: readonly string[];\n}\n\nexport const selectorRule = (restriction: Restriction): Rule => ({\n meta: { type: \"problem\" },\n create: (context) =>\n pipe(\n Arr.dedupe(restriction.selectors),\n Arr.map((selector) => [selector, selector] as const),\n Rec.fromEntries,\n Rec.map(() => (node: ESTree.Node): void => {\n context.report({ node, message: restriction.message });\n }),\n ),\n});\n","import type { Restriction } from \"./selector-rule.ts\";\n\nexport const TEST_HONESTY_RULES: Readonly<Record<string, Restriction>> = {\n \"no-test-doubles\": {\n message: \"依存の振る舞いを差し替えない。Effect の Layer を差し替えるか、本物の実装を使う\",\n selectors: [\n 'CallExpression[callee.object.name=\"vi\"][callee.property.name=/^(mock|doMock)$/]',\n 'CallExpression[callee.object.name=\"vi\"][callee.property.name=\"stubGlobal\"]',\n ],\n },\n \"no-flake-masking\": {\n message: \"再試行や flakyTest で不安定なテストを隠さない。待つ対象のイベントを await して直す\",\n selectors: [\n 'Property[key.name=\"retry\"]',\n 'MemberExpression[property.name=\"retry\"]',\n 'MemberExpression[property.name=\"flakyTest\"]',\n ],\n },\n};\n","import { Record as Rec, pipe } from \"effect\";\nimport type { Plugin } from \"vite-plus/lint/plugins\";\n\nimport { CODED_RULES } from \"./coded-rules.ts\";\nimport { ruleOf } from \"./intent-rule.ts\";\nimport { INTENTS } from \"./intents.ts\";\nimport { MODEL_CALL_RULES } from \"./model-call-rules.ts\";\nimport { RESOURCE_RULES } from \"./resource-rules.ts\";\nimport { selectorRule } from \"./selector-rule.ts\";\nimport { TEST_HONESTY_RULES } from \"./test-honesty-rules.ts\";\n\nexport const mschLintPlugin: Plugin & { readonly meta: { readonly name: string } } = {\n meta: { name: \"msch-lint\" },\n rules: {\n ...CODED_RULES,\n ...pipe(INTENTS, Rec.map(ruleOf)),\n ...pipe(\n { ...RESOURCE_RULES, ...MODEL_CALL_RULES, ...TEST_HONESTY_RULES },\n Rec.map(selectorRule),\n ),\n },\n};\n"],"mappings":";;;;;;;AAeA,MAAMA,UAAQ;AACd,MAAMC,QAAM;AACZ,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,MAAMC,QAAM;AAEZ,MAAM,cAAc,OAAO,MAAM,CAAC,OAAO,QAAQ,OAAO,MAAM,CAAC;AAC/D,MAAM,eAAe,OAAO,OAAO,EAAE,OAAO,YAAY,CAAC;AAIzD,MAAM,eAAe,OAAO,oBAAoB,YAAY;AAE5D,MAAM,mBAAmB,OAAO,OAAO;CAAE,MAAM,OAAO,QAAQ,YAAY;CAAG,MAAM,OAAO;AAAO,CAAC;AAElG,MAAM,eAAe,OAAO,OAAO;CACjC,MAAM,OAAO,QAAQ,kBAAkB;CACvC,UAAU,OAAO,QAAQ,KAAK;CAC9B,QAAQ;CACR,UAAU;AACZ,CAAC;AAED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