@r_masseater/msch 0.60.2 → 0.61.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.
Files changed (35) hide show
  1. package/README.md +1 -0
  2. package/dist/{app-DcgzLzb0.mjs → app-BwjhFdKD.mjs} +2 -2
  3. package/dist/{app-DcgzLzb0.mjs.map → app-BwjhFdKD.mjs.map} +1 -1
  4. package/dist/cargo-inputs.mjs +1 -1
  5. package/dist/changed.mjs +1 -1
  6. package/dist/cli.mjs +426 -589
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/exits.mjs +1 -1
  9. package/dist/fix.d.mts +1 -0
  10. package/dist/fix.mjs +96 -0
  11. package/dist/fix.mjs.map +1 -0
  12. package/dist/lint-rules.mjs +3 -5
  13. package/dist/lint-rules.mjs.map +1 -1
  14. package/dist/oxlint.mjs +1 -1
  15. package/dist/pack-settings-FN4-vi6J.mjs +225 -0
  16. package/dist/pack-settings-FN4-vi6J.mjs.map +1 -0
  17. package/dist/{pass-records-BCT1Ls9c.mjs → pass-records-CFIrQmB5.mjs} +2 -2
  18. package/dist/{pass-records-BCT1Ls9c.mjs.map → pass-records-CFIrQmB5.mjs.map} +1 -1
  19. package/dist/{problem-BoHYLMQT.mjs → problem-D2HKNIVq.mjs} +2 -2
  20. package/dist/{problem-BoHYLMQT.mjs.map → problem-D2HKNIVq.mjs.map} +1 -1
  21. package/dist/publish.mjs +73 -64
  22. package/dist/publish.mjs.map +1 -1
  23. package/dist/{published-D87PrlyG.mjs → published-BIexKvdJ.mjs} +2 -2
  24. package/dist/{published-D87PrlyG.mjs.map → published-BIexKvdJ.mjs.map} +1 -1
  25. package/dist/{syntax-CTiXR0EJ.mjs → syntax-C0ddqOHc.mjs} +4 -3
  26. package/dist/syntax-C0ddqOHc.mjs.map +1 -0
  27. package/dist/text-position-DrvZ7k2Y.mjs +17 -0
  28. package/dist/text-position-DrvZ7k2Y.mjs.map +1 -0
  29. package/dist/{upstream-exits-DitN-yYH.mjs → upstream-exits-DgkAyuu-.mjs} +3 -15
  30. package/dist/upstream-exits-DgkAyuu-.mjs.map +1 -0
  31. package/dist/workspace-settings.mjs +1 -1
  32. package/package.json +3 -2
  33. package/skills/msch-checks/SKILL.md +10 -0
  34. package/dist/syntax-CTiXR0EJ.mjs.map +0 -1
  35. package/dist/upstream-exits-DitN-yYH.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"lint-rules.mjs","names":["START","END","ONE","RangeSchema","RangedSchema","IdentifierSchema","textOf","Str","Arr","childrenOf","MESSAGE","ONE","Arr","Arr","Rec","MESSAGE_ID","MESSAGE","Str","Arr","visitorOf","MESSAGE","DeclaratorSchema","Arr","DEFAULT_NAME","isTypeOnly","Arr","declarationOf","START","END","NEWLINE","Str","Bool","Arr","NAMESPACE_NAME","START","END","Bool","Arr","isTypeOnly","Str","Arr","MESSAGE","Arr","sourceOf","SEPARATOR","MESSAGE","Str","Arr","Arr","Arr","Str","Arr","Str","Arr","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-resolve.ts","../src/features/define-lint-rules/model/inline-exports-text.ts","../src/features/define-lint-rules/model/inline-exports-plan.ts","../src/features/define-lint-rules/model/inline-exports-source.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/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 from @pnpm/workspace.workspace-manifest-reader, findWorkspaceProjects from @pnpm/workspace.projects-reader or updateWorkspaceManifest from @pnpm/workspace.workspace-manifest-writer\",\n },\n {\n name: /^pnpm-lock\\.yaml$/u,\n format: \"yaml\",\n reader: \"readWantedLockfile from @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, Option, pipe } from \"effect\";\n\nimport type {\n Declaration,\n ExportList,\n Import,\n ImportBinding,\n Specifier,\n Statement,\n} from \"./inline-exports-source.ts\";\n\nexport interface DeclarationResolution {\n readonly kind: \"declaration\";\n readonly statements: readonly Declaration[];\n}\n\nexport interface ImportResolution {\n readonly kind: \"import\";\n readonly statement: Import;\n readonly binding: ImportBinding;\n}\n\nexport interface DefaultResolution {\n readonly kind: \"default\";\n readonly name: string;\n}\n\nexport type Resolution = DeclarationResolution | ImportResolution | DefaultResolution;\n\nexport interface Resolved {\n readonly specifier: Specifier;\n readonly resolution: Option.Option<Resolution>;\n}\n\nconst DEFAULT_NAME = \"default\";\nconst CLASS_DECLARATION = \"ClassDeclaration\";\nconst TYPE_DECLARATIONS: ReadonlySet<string> = new Set([\n \"TSTypeAliasDeclaration\",\n \"TSInterfaceDeclaration\",\n]);\n\nexport const isTypeOnly =\n (list: ExportList) =>\n (specifier: Specifier): boolean =>\n list.typeOnly || specifier.typeOnly;\n\nconst exportsAsItself =\n (list: ExportList) =>\n (name: string): boolean =>\n pipe(\n list.specifiers,\n Arr.some(\n (specifier) => Option.contains(specifier.local, name) && specifier.exported === name,\n ),\n );\n\nconst declarationOf =\n (list: ExportList, specifier: Specifier) =>\n (statements: readonly Declaration[]): Option.Option<Resolution> => {\n const whole = pipe(\n statements,\n Arr.every((statement) => pipe(statement.names, Arr.every(exportsAsItself(list)))),\n );\n const keepsKind =\n !isTypeOnly(list)(specifier) ||\n pipe(\n statements,\n Arr.every((statement) => TYPE_DECLARATIONS.has(statement.type)),\n );\n if (!whole || !keepsKind) {\n return Option.none();\n }\n return Option.some({ kind: \"declaration\", statements });\n };\n\nconst declarationsNamed = (list: ExportList, name: string): readonly Declaration[] =>\n pipe(\n list.body,\n Arr.filter(\n (statement): statement is Declaration =>\n statement.kind === \"declaration\" && pipe(statement.names, Arr.contains(name)),\n ),\n );\n\nconst importIn =\n (name: string) =>\n (statement: Statement): Option.Option<Resolution> => {\n if (statement.kind !== \"import\") {\n return Option.none();\n }\n return pipe(\n statement.bindings,\n Arr.findFirst((binding) => binding.local === name),\n Option.map((binding): Resolution => ({ kind: \"import\", statement, binding })),\n );\n };\n\nexport const isTypeOnlyClass =\n (list: ExportList) =>\n (specifier: Specifier): boolean =>\n isTypeOnly(list)(specifier) &&\n pipe(\n specifier.local,\n Option.exists((local) => {\n const statements = declarationsNamed(list, local);\n return (\n Arr.isReadonlyArrayNonEmpty(statements) &&\n pipe(\n statements,\n Arr.every((statement) => statement.type === CLASS_DECLARATION),\n )\n );\n }),\n );\n\nconst resolutionOf =\n (list: ExportList) =>\n (specifier: Specifier): Option.Option<Resolution> =>\n pipe(\n specifier.local,\n Option.flatMap((local): Option.Option<Resolution> => {\n if (specifier.exported === DEFAULT_NAME) {\n return Option.some({ kind: \"default\", name: local });\n }\n if (local !== specifier.exported) {\n return Option.none();\n }\n const statements = declarationsNamed(list, local);\n if (Arr.isReadonlyArrayNonEmpty(statements)) {\n return declarationOf(list, specifier)(statements);\n }\n return pipe(list.body, Arr.findFirst(importIn(local)));\n }),\n );\n\nexport const kindOf =\n <Kind extends Resolution[\"kind\"]>(kind: Kind) =>\n (resolved: Resolved): readonly Extract<Resolution, { readonly kind: Kind }>[] =>\n pipe(\n resolved.resolution,\n Option.filter(\n (found): found is Extract<Resolution, { readonly kind: Kind }> => found.kind === kind,\n ),\n Option.toArray,\n );\n\nexport const restOf = (resolved: readonly Resolved[]): readonly Specifier[] =>\n pipe(\n resolved,\n Arr.filter((entry) => Option.isNone(entry.resolution)),\n Arr.map((entry) => entry.specifier),\n );\n\nexport const resolvedOf = (list: ExportList): readonly Resolved[] =>\n pipe(\n list.specifiers,\n Arr.map((specifier) => ({ specifier, resolution: resolutionOf(list)(specifier) })),\n );\n","import { Array as Arr, Boolean as Bool, Option, String as Str, pipe } from \"effect\";\n\nimport type { Range } from \"./inline-exports-source.ts\";\n\nexport interface Source {\n readonly text: string;\n readonly comments: readonly Range[];\n readonly usedOutside: readonly string[];\n}\n\nconst START = 0;\nconst END = 1;\nconst NEXT = 1;\nconst NEWLINE = \"\\n\";\n\nexport const textOf =\n (source: Source) =>\n (range: Range): string =>\n pipe(source.text, Str.slice(range[START], range[END]));\n\nconst lineStartOf = (source: Source, offset: number): number =>\n pipe(\n source.text,\n Str.slice(START, offset),\n Str.lastIndexOf(NEWLINE),\n Option.match({ onNone: () => START, onSome: (index) => index + NEXT }),\n );\n\nexport const indentOf =\n (source: Source) =>\n (offset: number): string =>\n textOf(source)([lineStartOf(source, offset), offset]);\n\nexport const lineRangeOf =\n (source: Source) =>\n (range: Range): Range => {\n const indented = Str.isEmpty(Str.trim(indentOf(source)(range[START])));\n const endsLine = pipe(source.text, Str.charAt(range[END]), Option.contains(NEWLINE));\n return [\n Bool.match(indented, {\n onFalse: () => range[START],\n onTrue: () => lineStartOf(source, range[START]),\n }),\n Bool.match(endsLine, { onFalse: () => range[END], onTrue: () => range[END] + NEXT }),\n ];\n };\n\nexport const commentsBefore =\n (source: Source) =>\n (start: number): readonly Range[] =>\n pipe(\n source.comments,\n Arr.findLast((comment) => comment[END] <= start),\n Option.filter((comment) => Str.isEmpty(Str.trim(textOf(source)([comment[END], start])))),\n Option.match({\n onNone: (): readonly Range[] => [],\n onSome: (comment) => [...commentsBefore(source)(comment[START]), comment],\n }),\n );\n\nexport const leadingTextOf =\n (source: Source) =>\n (start: number): string =>\n pipe(commentsBefore(source)(start), Arr.map(textOf(source)), Arr.join(NEWLINE));\n","import { Array as Arr, Boolean as Bool, Option, String as Str, pipe } from \"effect\";\n\nimport { isTypeOnly, kindOf, restOf, resolvedOf } from \"./inline-exports-resolve.ts\";\nimport type { Resolved } from \"./inline-exports-resolve.ts\";\nimport type {\n Declaration,\n ExportList,\n Import,\n ImportBinding,\n Range,\n} from \"./inline-exports-source.ts\";\nimport {\n commentsBefore,\n indentOf,\n leadingTextOf,\n lineRangeOf,\n textOf,\n} from \"./inline-exports-text.ts\";\nimport type { Source } from \"./inline-exports-text.ts\";\n\nexport interface Edit {\n readonly range: Range;\n readonly text: string;\n}\n\ninterface Reexport {\n readonly statement: Import;\n readonly binding: ImportBinding;\n readonly typeOnly: boolean;\n}\n\ninterface Group {\n readonly statement: Import;\n readonly bindings: readonly ImportBinding[];\n readonly typeOnly: boolean;\n}\n\nconst NAMESPACE_NAME = \"*\";\nconst START = 0;\nconst END = 1;\nconst SINGLE = 1;\nconst NEWLINE = \"\\n\";\nconst EXPORT = \"export \";\nconst KINDS = [false, true] as const;\n\nconst keywordOf = (typeOnly: boolean): string =>\n Bool.match(typeOnly, { onFalse: () => \"export\", onTrue: () => \"export type\" });\n\nconst reexportsOf = (list: ExportList, resolved: readonly Resolved[]): readonly Reexport[] =>\n pipe(\n resolved,\n Arr.flatMap((entry) =>\n pipe(\n kindOf(\"import\")(entry),\n Arr.map((found) => ({\n statement: found.statement,\n binding: found.binding,\n typeOnly: isTypeOnly(list)(entry.specifier) || found.binding.typeOnly,\n })),\n ),\n ),\n );\n\nconst statementsOf = (reexports: readonly Reexport[]): readonly Import[] =>\n pipe(\n reexports,\n Arr.map((entry) => entry.statement),\n Arr.dedupe,\n );\n\nconst groupOf =\n (reexports: readonly Reexport[], statement: Import) =>\n (typeOnly: boolean): readonly Group[] => {\n const bindings = pipe(\n reexports,\n Arr.filter((entry) => entry.statement === statement && entry.typeOnly === typeOnly),\n Arr.map((entry) => entry.binding),\n );\n if (Arr.isReadonlyArrayEmpty(bindings)) {\n return [];\n }\n return [{ statement, bindings, typeOnly }];\n };\n\nconst splitNamespaces = (group: Group): readonly Group[] => {\n const mixed =\n pipe(\n group.bindings,\n Arr.some((binding) => binding.imported === NAMESPACE_NAME),\n ) && group.bindings.length > SINGLE;\n if (!mixed) {\n return [group];\n }\n return pipe(\n group.bindings,\n Arr.map((binding) => ({ ...group, bindings: [binding] })),\n );\n};\n\nconst groupsOf = (reexports: readonly Reexport[]): readonly Group[] =>\n pipe(\n statementsOf(reexports),\n Arr.flatMap((statement) => pipe(KINDS, Arr.flatMap(groupOf(reexports, statement)))),\n Arr.flatMap(splitNamespaces),\n );\n\nconst renamedOf = (binding: ImportBinding): string =>\n Bool.match(binding.imported === binding.local, {\n onFalse: () => `${binding.imported} as ${binding.local}`,\n onTrue: () => binding.imported,\n });\n\nconst reexportTextOf =\n (source: Source) =>\n (group: Group): string => {\n const from = textOf(source)(group.statement.from);\n const keyword = keywordOf(group.typeOnly);\n return pipe(\n group.bindings,\n Arr.findFirst((binding) => binding.imported === NAMESPACE_NAME),\n Option.match({\n onSome: (namespace) => `${keyword} * as ${namespace.local} from ${from};`,\n onNone: () =>\n `${keyword} { ${pipe(group.bindings, Arr.map(renamedOf), Arr.join(\", \"))} } from ${from};`,\n }),\n );\n };\n\nconst replacementOf = (source: Source, list: ExportList, resolved: readonly Resolved[]): string => {\n const rest = restOf(resolved);\n const names = pipe(\n rest,\n Arr.map((specifier) => textOf(source)(specifier.range)),\n Arr.join(\", \"),\n );\n const remaining = Bool.match(Arr.isReadonlyArrayEmpty(rest), {\n onFalse: () => [`${keywordOf(list.typeOnly)} { ${names} };`],\n onTrue: (): readonly string[] => [],\n });\n const defaults = pipe(\n resolved,\n Arr.flatMap(kindOf(\"default\")),\n Arr.map((found) => `export default ${found.name};`),\n );\n const reexports = pipe(groupsOf(reexportsOf(list, resolved)), Arr.map(reexportTextOf(source)));\n return pipe([...remaining, ...defaults, ...reexports], Arr.join(NEWLINE));\n};\n\nconst removedOf = (source: Source, reexports: readonly Reexport[]): readonly Import[] =>\n pipe(\n statementsOf(reexports),\n Arr.filter((statement) =>\n pipe(\n statement.bindings,\n Arr.every(\n (binding) =>\n pipe(\n reexports,\n Arr.some((entry) => entry.statement === statement && entry.binding === binding),\n ) && !pipe(source.usedOutside, Arr.contains(binding.local)),\n ),\n ),\n ),\n );\n\nconst prefixOf =\n (source: Source, comments: string) =>\n (statement: Declaration): string => {\n const start = statement.range[START];\n if (Str.isEmpty(comments) || pipe(leadingTextOf(source)(start), Str.includes(comments))) {\n return EXPORT;\n }\n return `${comments}${NEWLINE}${indentOf(source)(start)}${EXPORT}`;\n };\n\nconst listEditOf = (source: Source, list: ExportList, text: string): Edit => {\n if (!Str.isEmpty(text)) {\n return { range: list.range, text };\n }\n const start = pipe(\n commentsBefore(source)(list.range[START]),\n Arr.head,\n Option.match({ onNone: () => list.range[START], onSome: (first) => first[START] }),\n );\n return { range: lineRangeOf(source)([start, list.range[END]]), text: \"\" };\n};\n\nexport const editsOf =\n (source: Source) =>\n (list: ExportList): Option.Option<readonly Edit[]> => {\n const resolved = resolvedOf(list);\n if (restOf(resolved).length === list.specifiers.length) {\n return Option.none();\n }\n const prefix = prefixOf(source, leadingTextOf(source)(list.range[START]));\n const declarations = pipe(\n resolved,\n Arr.flatMap(kindOf(\"declaration\")),\n Arr.flatMap((found) => found.statements),\n Arr.dedupe,\n Arr.map((statement): Edit => ({\n range: [statement.range[START], statement.range[START]],\n text: prefix(statement),\n })),\n );\n const removals = pipe(\n removedOf(source, reexportsOf(list, resolved)),\n Arr.map((statement) => ({ range: lineRangeOf(source)(statement.range), text: \"\" })),\n );\n return Option.some([\n ...declarations,\n ...removals,\n listEditOf(source, list, replacementOf(source, list, resolved)),\n ]);\n };\n","import { Array as Arr, Option, Schema, pipe } from \"effect\";\n\nexport type Range = readonly [number, number];\n\nexport interface Declaration {\n readonly kind: \"declaration\";\n readonly type: string;\n readonly range: Range;\n readonly names: readonly string[];\n}\n\nexport interface ImportBinding {\n readonly local: string;\n readonly imported: string;\n readonly typeOnly: boolean;\n}\n\nexport interface Import {\n readonly kind: \"import\";\n readonly range: Range;\n readonly from: Range;\n readonly bindings: readonly ImportBinding[];\n}\n\nexport type Statement = Declaration | Import;\n\nexport interface Specifier {\n readonly range: Range;\n readonly local: Option.Option<string>;\n readonly exported: string;\n readonly typeOnly: boolean;\n}\n\nexport interface ExportList {\n readonly range: Range;\n readonly typeOnly: boolean;\n readonly specifiers: readonly Specifier[];\n readonly body: readonly Statement[];\n}\n\nconst TYPE_KIND = \"type\";\nconst DEFAULT_NAME = \"default\";\nconst NAMESPACE_NAME = \"*\";\n\nconst RangeSchema = Schema.Tuple([Schema.Finite, Schema.Finite]);\nconst KindSchema = Schema.optionalKey(Schema.String);\nconst IdentifierSchema = Schema.Struct({ type: Schema.Literal(\"Identifier\"), name: Schema.String });\nconst StringSchema = Schema.Struct({ type: Schema.Literal(\"Literal\"), value: Schema.String });\nconst NameSchema = Schema.Union([IdentifierSchema, StringSchema]);\n\nconst PatternSchema = Schema.Union([\n IdentifierSchema,\n Schema.Struct({\n type: Schema.Literal(\"ObjectPattern\"),\n properties: Schema.Array(Schema.Unknown),\n }),\n Schema.Struct({ type: Schema.Literal(\"ArrayPattern\"), elements: Schema.Array(Schema.Unknown) }),\n Schema.Struct({ type: Schema.Literal(\"Property\"), value: Schema.Unknown }),\n Schema.Struct({ type: Schema.Literal(\"AssignmentPattern\"), left: Schema.Unknown }),\n Schema.Struct({ type: Schema.Literal(\"RestElement\"), argument: Schema.Unknown }),\n]);\nconst decodePattern = Schema.decodeUnknownOption(PatternSchema);\n\nconst BindingSchema = Schema.Union([\n Schema.Struct({\n type: Schema.Literal(\"ImportSpecifier\"),\n local: IdentifierSchema,\n imported: NameSchema,\n importKind: KindSchema,\n }),\n Schema.Struct({\n type: Schema.Literals([\"ImportDefaultSpecifier\", \"ImportNamespaceSpecifier\"]),\n local: IdentifierSchema,\n }),\n]);\n\nconst RangedSchema = Schema.Struct({ range: RangeSchema });\nconst DeclaratorSchema = Schema.Struct({ id: Schema.Unknown });\nconst ExportSpecifierSchema = Schema.Struct({\n range: RangeSchema,\n local: NameSchema,\n exported: NameSchema,\n exportKind: KindSchema,\n});\nconst ParentSchema = Schema.Struct({ body: Schema.Array(Schema.Unknown) });\nconst QuotedSchema = Schema.fromJsonString(Schema.String);\n\nconst decodeImport = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"ImportDeclaration\"),\n range: RangeSchema,\n source: RangedSchema,\n importKind: KindSchema,\n specifiers: Schema.Array(BindingSchema),\n }),\n);\nconst decodeVariable = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"VariableDeclaration\"),\n range: RangeSchema,\n declarations: Schema.Array(DeclaratorSchema),\n }),\n);\nconst decodeNamed = Schema.decodeUnknownOption(\n Schema.Struct({ type: Schema.String, range: RangeSchema, id: IdentifierSchema }),\n);\nconst decodeList = Schema.decodeUnknownOption(\n Schema.Struct({\n range: RangeSchema,\n source: Schema.Null,\n declaration: Schema.Null,\n exportKind: KindSchema,\n specifiers: Schema.Array(ExportSpecifierSchema),\n parent: ParentSchema,\n }),\n);\n\ntype Pattern = typeof PatternSchema.Type;\ntype SinglePattern = Extract<\n Pattern,\n { readonly type: \"Property\" | \"AssignmentPattern\" | \"RestElement\" }\n>;\ntype Binding = typeof BindingSchema.Type;\ntype Name = typeof NameSchema.Type;\n\nconst nameOf = (name: Name): string => {\n if (name.type === \"Literal\") {\n return name.value;\n }\n return name.name;\n};\n\nconst identifierOf = (name: Name): Option.Option<string> => {\n if (name.type === \"Literal\") {\n return Option.none();\n }\n return Option.some(name.name);\n};\n\nconst childOf = (pattern: SinglePattern): unknown => {\n if (pattern.type === \"Property\") {\n return pattern.value;\n }\n if (pattern.type === \"AssignmentPattern\") {\n return pattern.left;\n }\n return pattern.argument;\n};\n\nconst childrenOf = (pattern: Pattern): readonly unknown[] => {\n if (pattern.type === \"ObjectPattern\") {\n return pattern.properties;\n }\n if (pattern.type === \"ArrayPattern\") {\n return pattern.elements;\n }\n if (pattern.type === \"Identifier\") {\n return [];\n }\n return [childOf(pattern)];\n};\n\nconst bindingNames = (node: unknown): readonly string[] =>\n pipe(\n decodePattern(node),\n Option.match({\n onNone: () => [],\n onSome: (pattern) => {\n if (pattern.type === \"Identifier\") {\n return [pattern.name];\n }\n return pipe(childrenOf(pattern), Arr.flatMap(bindingNames));\n },\n }),\n );\n\nconst importedOf = (binding: Binding): string => {\n if (binding.type === \"ImportSpecifier\") {\n if (binding.imported.type === \"Literal\") {\n const { value } = binding.imported;\n return pipe(\n Schema.encodeOption(QuotedSchema)(value),\n Option.getOrElse(() => value),\n );\n }\n return binding.imported.name;\n }\n if (binding.type === \"ImportDefaultSpecifier\") {\n return DEFAULT_NAME;\n }\n return NAMESPACE_NAME;\n};\n\nconst typeOnlyOf = (binding: Binding): boolean =>\n binding.type === \"ImportSpecifier\" && binding.importKind === TYPE_KIND;\n\nconst importOf = (node: unknown): Option.Option<Statement> =>\n pipe(\n decodeImport(node),\n Option.map((statement): Statement => ({\n kind: \"import\",\n range: statement.range,\n from: statement.source.range,\n bindings: pipe(\n statement.specifiers,\n Arr.map((binding) => ({\n local: binding.local.name,\n imported: importedOf(binding),\n typeOnly: statement.importKind === TYPE_KIND || typeOnlyOf(binding),\n })),\n ),\n })),\n );\n\nconst declarationOf = (node: unknown): Option.Option<Statement> =>\n pipe(\n decodeVariable(node),\n Option.map((statement): Statement => ({\n kind: \"declaration\",\n type: statement.type,\n range: statement.range,\n names: pipe(\n statement.declarations,\n Arr.flatMap((declarator) => bindingNames(declarator.id)),\n ),\n })),\n Option.orElse(() =>\n pipe(\n decodeNamed(node),\n Option.map((statement): Statement => ({\n kind: \"declaration\",\n type: statement.type,\n range: statement.range,\n names: [statement.id.name],\n })),\n ),\n ),\n );\n\nconst statementOf = (node: unknown): Option.Option<Statement> =>\n pipe(\n importOf(node),\n Option.orElse(() => declarationOf(node)),\n );\n\nexport const exportListOf = (node: unknown): Option.Option<ExportList> =>\n pipe(\n decodeList(node),\n Option.filter((list) => Arr.isReadonlyArrayNonEmpty(list.specifiers)),\n Option.map((list) => ({\n range: list.range,\n typeOnly: list.exportKind === TYPE_KIND,\n specifiers: pipe(\n list.specifiers,\n Arr.map((specifier) => ({\n range: specifier.range,\n local: identifierOf(specifier.local),\n exported: nameOf(specifier.exported),\n typeOnly: specifier.exportKind === TYPE_KIND,\n })),\n ),\n body: pipe(list.parent.body, Arr.map(statementOf), Arr.getSomes),\n })),\n );\n","import { Array as Arr, Option, pipe } from \"effect\";\nimport type { Context, ESTree, Rule } from \"vite-plus/lint/plugins\";\n\nimport { editsOf } from \"./inline-exports-plan.ts\";\nimport { isTypeOnlyClass } from \"./inline-exports-resolve.ts\";\nimport { exportListOf } from \"./inline-exports-source.ts\";\nimport type { ExportList, Range } from \"./inline-exports-source.ts\";\nimport type { Source } from \"./inline-exports-text.ts\";\n\nconst MESSAGE =\n \"export は宣言に付ける(export const・export function など)。ファイルの末尾で export { … } にまとめない。\";\nconst START = 0;\nconst END = 1;\n\nconst outside =\n (list: Range) =>\n (range: Range): boolean =>\n range[START] < list[START] || range[END] > list[END];\n\nconst usedOutside = (context: Context, list: ExportList): readonly string[] =>\n pipe(\n context.sourceCode.scopeManager.scopes,\n Arr.flatMap((scope) => scope.variables),\n Arr.filter((variable) =>\n pipe(\n variable.references,\n Arr.some((reference) => outside(list.range)(reference.identifier.range)),\n ),\n ),\n Arr.map((variable) => variable.name),\n );\n\nconst sourceOf = (context: Context, list: ExportList): Source => ({\n text: context.sourceCode.text,\n comments: pipe(\n context.sourceCode.getAllComments(),\n Arr.map((comment) => comment.range),\n ),\n usedOutside: usedOutside(context, list),\n});\n\nconst reportList = (\n context: Context,\n node: ESTree.ExportNamedDeclaration,\n list: ExportList,\n): void => {\n pipe(\n editsOf(sourceOf(context, list))(list),\n Option.match({\n onNone: () => {\n context.report({ node, message: MESSAGE });\n },\n onSome: (edits) => {\n context.report({\n node,\n message: MESSAGE,\n fix: (fixer) =>\n pipe(\n edits,\n Arr.map((edit) =>\n fixer.replaceTextRange([edit.range[START], edit.range[END]], edit.text),\n ),\n ),\n });\n },\n }),\n );\n};\n\nexport const inlineExports: Rule = {\n meta: { type: \"suggestion\", fixable: \"code\" },\n create: (context) => ({\n ExportNamedDeclaration: (node): void => {\n const list = exportListOf(node);\n if (\n Option.isSome(list) &&\n !pipe(list.value.specifiers, Arr.every(isTypeOnlyClass(list.value)))\n ) {\n reportList(context, node, list.value);\n }\n },\n }),\n};\n","import { Array as Arr, Option, String as Str, pipe } from \"effect\";\nimport type { Rule } from \"vite-plus/lint/plugins\";\n\nconst SOURCE = \"/src/\";\nconst SEPARATOR = \"/\";\nconst WINDOWS_SEPARATOR = \"\\\\\";\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.flatMap((index) =>\n pipe(Str.slice(index + SOURCE.length)(path), Str.split(SEPARATOR), Arr.head),\n ),\n );\n\nconst layerOf = (filename: string): Option.Option<string> =>\n layerIn(Str.replaceAll(WINDOWS_SEPARATOR, SEPARATOR)(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 \"typescript/sync\";\nimport type { NodeHandle, Project, Symbol as TypeSymbol } from \"typescript/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 \"typescript/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 \"typescript/ast\";\nimport { isTypeNode } from \"typescript/ast/is\";\nimport type { Type } from \"typescript/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 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\";\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};\n","import { Array as Arr, Option, 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 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\nexport const ruleOf = (intent: Intent): Rule => ({\n meta: { type: \"problem\" },\n create: (context) => ({\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","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/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 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 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/workers-tracing/elysia, so every handle call is a span.\",\n imports: [{ module: \"elysia\", names: Option.some([\"Elysia\", \"default\"]), typesAllowed: true }],\n members: [],\n },\n \"traced-effect-run\": {\n message: RUN_MESSAGE,\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 imports: [{ module: \"@effect/platform-node\", names: Option.none(), typesAllowed: true }],\n members: [],\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 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 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 meta: { readonly name: string } } = {\n meta: { name: \"msch-lint\" },\n rules: {\n ...CODED_RULES,\n ...pipe(INTENTS, Rec.map(ruleOf)),\n },\n};\n"],"mappings":";;;;;;AAeA,MAAMA,UAAQ;AACd,MAAMC,QAAM;AACZ,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,MAAMC,QAAM;AAEZ,MAAMC,gBAAc,OAAO,MAAM,CAAC,OAAO,QAAQ,OAAO,MAAM,CAAC;AAC/D,MAAMC,iBAAe,OAAO,OAAO,EAAE,OAAOD,cAAY,CAAC;AAIzD,MAAM,eAAe,OAAO,oBAAoBC,cAAY;AAE5D,MAAMC,qBAAmB,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,QAAQD;CACR,UAAUC;AACZ,CAAC;AAED,MAAM,mBAAmB,OAAO,OAAO;CACrC,MAAM,OAAO,QAAQ,gBAAgB;CACrC,QAAQ;CACR,WAAW,OAAO,MAAMD,cAAY;AACtC,CAAC;AAED,MAAM,mBAAmB,OAAO,oBAAoB,gBAAgB;AAEpE,MAAM,aAAa,OAAO,oBACxB,OAAO,OAAO;CACZ,MAAM,OAAO,QAAQ,gBAAgB;CACrC,QAAQA;CACR,WAAW,OAAO,MAAM,OAAO,OAAO;AACxC,CAAC,CACH;AAEA,MAAM,cAAc,OAAO,oBACzB,OAAO,OAAO;CAAE,MAAM,OAAO,QAAQ,gBAAgB;CAAG,M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,CAAC;EACV,SAAS,CAAC;GAAE,QAAQ;GAAM,YAAY;IAAC;IAAU;IAAU;IAAU;IAAS;GAAK;EAAE,CAAC;CACxF;AACF;;AC1EA,MAAa,iBAAwE;CACnF,MAAM,EAAE,MAAM,YAAY;CAC1B,OAAO;EACL,GAAG;EACH,GAAG,KAAK,SAASC,OAAI,IAAI,MAAM,CAAC;CAClC;AACF"}
1
+ {"version":3,"file":"lint-rules.mjs","names":["START","END","ONE","RangeSchema","RangedSchema","IdentifierSchema","textOf","Str","Arr","childrenOf","MESSAGE","ONE","Arr","Arr","Rec","MESSAGE_ID","MESSAGE","Str","Arr","visitorOf","MESSAGE","DeclaratorSchema","Arr","DEFAULT_NAME","isTypeOnly","Arr","declarationOf","START","END","NEWLINE","Str","Bool","Arr","NAMESPACE_NAME","START","END","Bool","Arr","isTypeOnly","Str","Arr","MESSAGE","Arr","sourceOf","MESSAGE","Str","Arr","Arr","Arr","Str","Arr","Str","Arr","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-resolve.ts","../src/features/define-lint-rules/model/inline-exports-text.ts","../src/features/define-lint-rules/model/inline-exports-plan.ts","../src/features/define-lint-rules/model/inline-exports-source.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/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 from @pnpm/workspace.workspace-manifest-reader, findWorkspaceProjects from @pnpm/workspace.projects-reader or updateWorkspaceManifest from @pnpm/workspace.workspace-manifest-writer\",\n },\n {\n name: /^pnpm-lock\\.yaml$/u,\n format: \"yaml\",\n reader: \"readWantedLockfile from @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, Option, pipe } from \"effect\";\n\nimport type {\n Declaration,\n ExportList,\n Import,\n ImportBinding,\n Specifier,\n Statement,\n} from \"./inline-exports-source.ts\";\n\nexport interface DeclarationResolution {\n readonly kind: \"declaration\";\n readonly statements: readonly Declaration[];\n}\n\nexport interface ImportResolution {\n readonly kind: \"import\";\n readonly statement: Import;\n readonly binding: ImportBinding;\n}\n\nexport interface DefaultResolution {\n readonly kind: \"default\";\n readonly name: string;\n}\n\nexport type Resolution = DeclarationResolution | ImportResolution | DefaultResolution;\n\nexport interface Resolved {\n readonly specifier: Specifier;\n readonly resolution: Option.Option<Resolution>;\n}\n\nconst DEFAULT_NAME = \"default\";\nconst CLASS_DECLARATION = \"ClassDeclaration\";\nconst TYPE_DECLARATIONS: ReadonlySet<string> = new Set([\n \"TSTypeAliasDeclaration\",\n \"TSInterfaceDeclaration\",\n]);\n\nexport const isTypeOnly =\n (list: ExportList) =>\n (specifier: Specifier): boolean =>\n list.typeOnly || specifier.typeOnly;\n\nconst exportsAsItself =\n (list: ExportList) =>\n (name: string): boolean =>\n pipe(\n list.specifiers,\n Arr.some(\n (specifier) => Option.contains(specifier.local, name) && specifier.exported === name,\n ),\n );\n\nconst declarationOf =\n (list: ExportList, specifier: Specifier) =>\n (statements: readonly Declaration[]): Option.Option<Resolution> => {\n const whole = pipe(\n statements,\n Arr.every((statement) => pipe(statement.names, Arr.every(exportsAsItself(list)))),\n );\n const keepsKind =\n !isTypeOnly(list)(specifier) ||\n pipe(\n statements,\n Arr.every((statement) => TYPE_DECLARATIONS.has(statement.type)),\n );\n if (!whole || !keepsKind) {\n return Option.none();\n }\n return Option.some({ kind: \"declaration\", statements });\n };\n\nconst declarationsNamed = (list: ExportList, name: string): readonly Declaration[] =>\n pipe(\n list.body,\n Arr.filter(\n (statement): statement is Declaration =>\n statement.kind === \"declaration\" && pipe(statement.names, Arr.contains(name)),\n ),\n );\n\nconst importIn =\n (name: string) =>\n (statement: Statement): Option.Option<Resolution> => {\n if (statement.kind !== \"import\") {\n return Option.none();\n }\n return pipe(\n statement.bindings,\n Arr.findFirst((binding) => binding.local === name),\n Option.map((binding): Resolution => ({ kind: \"import\", statement, binding })),\n );\n };\n\nexport const isTypeOnlyClass =\n (list: ExportList) =>\n (specifier: Specifier): boolean =>\n isTypeOnly(list)(specifier) &&\n pipe(\n specifier.local,\n Option.exists((local) => {\n const statements = declarationsNamed(list, local);\n return (\n Arr.isReadonlyArrayNonEmpty(statements) &&\n pipe(\n statements,\n Arr.every((statement) => statement.type === CLASS_DECLARATION),\n )\n );\n }),\n );\n\nconst resolutionOf =\n (list: ExportList) =>\n (specifier: Specifier): Option.Option<Resolution> =>\n pipe(\n specifier.local,\n Option.flatMap((local): Option.Option<Resolution> => {\n if (specifier.exported === DEFAULT_NAME) {\n return Option.some({ kind: \"default\", name: local });\n }\n if (local !== specifier.exported) {\n return Option.none();\n }\n const statements = declarationsNamed(list, local);\n if (Arr.isReadonlyArrayNonEmpty(statements)) {\n return declarationOf(list, specifier)(statements);\n }\n return pipe(list.body, Arr.findFirst(importIn(local)));\n }),\n );\n\nexport const kindOf =\n <Kind extends Resolution[\"kind\"]>(kind: Kind) =>\n (resolved: Resolved): readonly Extract<Resolution, { readonly kind: Kind }>[] =>\n pipe(\n resolved.resolution,\n Option.filter(\n (found): found is Extract<Resolution, { readonly kind: Kind }> => found.kind === kind,\n ),\n Option.toArray,\n );\n\nexport const restOf = (resolved: readonly Resolved[]): readonly Specifier[] =>\n pipe(\n resolved,\n Arr.filter((entry) => Option.isNone(entry.resolution)),\n Arr.map((entry) => entry.specifier),\n );\n\nexport const resolvedOf = (list: ExportList): readonly Resolved[] =>\n pipe(\n list.specifiers,\n Arr.map((specifier) => ({ specifier, resolution: resolutionOf(list)(specifier) })),\n );\n","import { Array as Arr, Boolean as Bool, Option, String as Str, pipe } from \"effect\";\n\nimport type { Range } from \"./inline-exports-source.ts\";\n\nexport interface Source {\n readonly text: string;\n readonly comments: readonly Range[];\n readonly usedOutside: readonly string[];\n}\n\nconst START = 0;\nconst END = 1;\nconst NEXT = 1;\nconst NEWLINE = \"\\n\";\n\nexport const textOf =\n (source: Source) =>\n (range: Range): string =>\n pipe(source.text, Str.slice(range[START], range[END]));\n\nconst lineStartOf = (source: Source, offset: number): number =>\n pipe(\n source.text,\n Str.slice(START, offset),\n Str.lastIndexOf(NEWLINE),\n Option.match({ onNone: () => START, onSome: (index) => index + NEXT }),\n );\n\nexport const indentOf =\n (source: Source) =>\n (offset: number): string =>\n textOf(source)([lineStartOf(source, offset), offset]);\n\nexport const lineRangeOf =\n (source: Source) =>\n (range: Range): Range => {\n const indented = Str.isEmpty(Str.trim(indentOf(source)(range[START])));\n const endsLine = pipe(source.text, Str.charAt(range[END]), Option.contains(NEWLINE));\n return [\n Bool.match(indented, {\n onFalse: () => range[START],\n onTrue: () => lineStartOf(source, range[START]),\n }),\n Bool.match(endsLine, { onFalse: () => range[END], onTrue: () => range[END] + NEXT }),\n ];\n };\n\nexport const commentsBefore =\n (source: Source) =>\n (start: number): readonly Range[] =>\n pipe(\n source.comments,\n Arr.findLast((comment) => comment[END] <= start),\n Option.filter((comment) => Str.isEmpty(Str.trim(textOf(source)([comment[END], start])))),\n Option.match({\n onNone: (): readonly Range[] => [],\n onSome: (comment) => [...commentsBefore(source)(comment[START]), comment],\n }),\n );\n\nexport const leadingTextOf =\n (source: Source) =>\n (start: number): string =>\n pipe(commentsBefore(source)(start), Arr.map(textOf(source)), Arr.join(NEWLINE));\n","import { Array as Arr, Boolean as Bool, Option, String as Str, pipe } from \"effect\";\n\nimport { isTypeOnly, kindOf, restOf, resolvedOf } from \"./inline-exports-resolve.ts\";\nimport type { Resolved } from \"./inline-exports-resolve.ts\";\nimport type {\n Declaration,\n ExportList,\n Import,\n ImportBinding,\n Range,\n} from \"./inline-exports-source.ts\";\nimport {\n commentsBefore,\n indentOf,\n leadingTextOf,\n lineRangeOf,\n textOf,\n} from \"./inline-exports-text.ts\";\nimport type { Source } from \"./inline-exports-text.ts\";\n\nexport interface Edit {\n readonly range: Range;\n readonly text: string;\n}\n\ninterface Reexport {\n readonly statement: Import;\n readonly binding: ImportBinding;\n readonly typeOnly: boolean;\n}\n\ninterface Group {\n readonly statement: Import;\n readonly bindings: readonly ImportBinding[];\n readonly typeOnly: boolean;\n}\n\nconst NAMESPACE_NAME = \"*\";\nconst START = 0;\nconst END = 1;\nconst SINGLE = 1;\nconst NEWLINE = \"\\n\";\nconst EXPORT = \"export \";\nconst KINDS = [false, true] as const;\n\nconst keywordOf = (typeOnly: boolean): string =>\n Bool.match(typeOnly, { onFalse: () => \"export\", onTrue: () => \"export type\" });\n\nconst reexportsOf = (list: ExportList, resolved: readonly Resolved[]): readonly Reexport[] =>\n pipe(\n resolved,\n Arr.flatMap((entry) =>\n pipe(\n kindOf(\"import\")(entry),\n Arr.map((found) => ({\n statement: found.statement,\n binding: found.binding,\n typeOnly: isTypeOnly(list)(entry.specifier) || found.binding.typeOnly,\n })),\n ),\n ),\n );\n\nconst statementsOf = (reexports: readonly Reexport[]): readonly Import[] =>\n pipe(\n reexports,\n Arr.map((entry) => entry.statement),\n Arr.dedupe,\n );\n\nconst groupOf =\n (reexports: readonly Reexport[], statement: Import) =>\n (typeOnly: boolean): readonly Group[] => {\n const bindings = pipe(\n reexports,\n Arr.filter((entry) => entry.statement === statement && entry.typeOnly === typeOnly),\n Arr.map((entry) => entry.binding),\n );\n if (Arr.isReadonlyArrayEmpty(bindings)) {\n return [];\n }\n return [{ statement, bindings, typeOnly }];\n };\n\nconst splitNamespaces = (group: Group): readonly Group[] => {\n const mixed =\n pipe(\n group.bindings,\n Arr.some((binding) => binding.imported === NAMESPACE_NAME),\n ) && group.bindings.length > SINGLE;\n if (!mixed) {\n return [group];\n }\n return pipe(\n group.bindings,\n Arr.map((binding) => ({ ...group, bindings: [binding] })),\n );\n};\n\nconst groupsOf = (reexports: readonly Reexport[]): readonly Group[] =>\n pipe(\n statementsOf(reexports),\n Arr.flatMap((statement) => pipe(KINDS, Arr.flatMap(groupOf(reexports, statement)))),\n Arr.flatMap(splitNamespaces),\n );\n\nconst renamedOf = (binding: ImportBinding): string =>\n Bool.match(binding.imported === binding.local, {\n onFalse: () => `${binding.imported} as ${binding.local}`,\n onTrue: () => binding.imported,\n });\n\nconst reexportTextOf =\n (source: Source) =>\n (group: Group): string => {\n const from = textOf(source)(group.statement.from);\n const keyword = keywordOf(group.typeOnly);\n return pipe(\n group.bindings,\n Arr.findFirst((binding) => binding.imported === NAMESPACE_NAME),\n Option.match({\n onSome: (namespace) => `${keyword} * as ${namespace.local} from ${from};`,\n onNone: () =>\n `${keyword} { ${pipe(group.bindings, Arr.map(renamedOf), Arr.join(\", \"))} } from ${from};`,\n }),\n );\n };\n\nconst replacementOf = (source: Source, list: ExportList, resolved: readonly Resolved[]): string => {\n const rest = restOf(resolved);\n const names = pipe(\n rest,\n Arr.map((specifier) => textOf(source)(specifier.range)),\n Arr.join(\", \"),\n );\n const remaining = Bool.match(Arr.isReadonlyArrayEmpty(rest), {\n onFalse: () => [`${keywordOf(list.typeOnly)} { ${names} };`],\n onTrue: (): readonly string[] => [],\n });\n const defaults = pipe(\n resolved,\n Arr.flatMap(kindOf(\"default\")),\n Arr.map((found) => `export default ${found.name};`),\n );\n const reexports = pipe(groupsOf(reexportsOf(list, resolved)), Arr.map(reexportTextOf(source)));\n return pipe([...remaining, ...defaults, ...reexports], Arr.join(NEWLINE));\n};\n\nconst removedOf = (source: Source, reexports: readonly Reexport[]): readonly Import[] =>\n pipe(\n statementsOf(reexports),\n Arr.filter((statement) =>\n pipe(\n statement.bindings,\n Arr.every(\n (binding) =>\n pipe(\n reexports,\n Arr.some((entry) => entry.statement === statement && entry.binding === binding),\n ) && !pipe(source.usedOutside, Arr.contains(binding.local)),\n ),\n ),\n ),\n );\n\nconst prefixOf =\n (source: Source, comments: string) =>\n (statement: Declaration): string => {\n const start = statement.range[START];\n if (Str.isEmpty(comments) || pipe(leadingTextOf(source)(start), Str.includes(comments))) {\n return EXPORT;\n }\n return `${comments}${NEWLINE}${indentOf(source)(start)}${EXPORT}`;\n };\n\nconst listEditOf = (source: Source, list: ExportList, text: string): Edit => {\n if (!Str.isEmpty(text)) {\n return { range: list.range, text };\n }\n const start = pipe(\n commentsBefore(source)(list.range[START]),\n Arr.head,\n Option.match({ onNone: () => list.range[START], onSome: (first) => first[START] }),\n );\n return { range: lineRangeOf(source)([start, list.range[END]]), text: \"\" };\n};\n\nexport const editsOf =\n (source: Source) =>\n (list: ExportList): Option.Option<readonly Edit[]> => {\n const resolved = resolvedOf(list);\n if (restOf(resolved).length === list.specifiers.length) {\n return Option.none();\n }\n const prefix = prefixOf(source, leadingTextOf(source)(list.range[START]));\n const declarations = pipe(\n resolved,\n Arr.flatMap(kindOf(\"declaration\")),\n Arr.flatMap((found) => found.statements),\n Arr.dedupe,\n Arr.map((statement): Edit => ({\n range: [statement.range[START], statement.range[START]],\n text: prefix(statement),\n })),\n );\n const removals = pipe(\n removedOf(source, reexportsOf(list, resolved)),\n Arr.map((statement) => ({ range: lineRangeOf(source)(statement.range), text: \"\" })),\n );\n return Option.some([\n ...declarations,\n ...removals,\n listEditOf(source, list, replacementOf(source, list, resolved)),\n ]);\n };\n","import { Array as Arr, Option, Schema, pipe } from \"effect\";\n\nexport type Range = readonly [number, number];\n\nexport interface Declaration {\n readonly kind: \"declaration\";\n readonly type: string;\n readonly range: Range;\n readonly names: readonly string[];\n}\n\nexport interface ImportBinding {\n readonly local: string;\n readonly imported: string;\n readonly typeOnly: boolean;\n}\n\nexport interface Import {\n readonly kind: \"import\";\n readonly range: Range;\n readonly from: Range;\n readonly bindings: readonly ImportBinding[];\n}\n\nexport type Statement = Declaration | Import;\n\nexport interface Specifier {\n readonly range: Range;\n readonly local: Option.Option<string>;\n readonly exported: string;\n readonly typeOnly: boolean;\n}\n\nexport interface ExportList {\n readonly range: Range;\n readonly typeOnly: boolean;\n readonly specifiers: readonly Specifier[];\n readonly body: readonly Statement[];\n}\n\nconst TYPE_KIND = \"type\";\nconst DEFAULT_NAME = \"default\";\nconst NAMESPACE_NAME = \"*\";\n\nconst RangeSchema = Schema.Tuple([Schema.Finite, Schema.Finite]);\nconst KindSchema = Schema.optionalKey(Schema.String);\nconst IdentifierSchema = Schema.Struct({ type: Schema.Literal(\"Identifier\"), name: Schema.String });\nconst StringSchema = Schema.Struct({ type: Schema.Literal(\"Literal\"), value: Schema.String });\nconst NameSchema = Schema.Union([IdentifierSchema, StringSchema]);\n\nconst PatternSchema = Schema.Union([\n IdentifierSchema,\n Schema.Struct({\n type: Schema.Literal(\"ObjectPattern\"),\n properties: Schema.Array(Schema.Unknown),\n }),\n Schema.Struct({ type: Schema.Literal(\"ArrayPattern\"), elements: Schema.Array(Schema.Unknown) }),\n Schema.Struct({ type: Schema.Literal(\"Property\"), value: Schema.Unknown }),\n Schema.Struct({ type: Schema.Literal(\"AssignmentPattern\"), left: Schema.Unknown }),\n Schema.Struct({ type: Schema.Literal(\"RestElement\"), argument: Schema.Unknown }),\n]);\nconst decodePattern = Schema.decodeUnknownOption(PatternSchema);\n\nconst BindingSchema = Schema.Union([\n Schema.Struct({\n type: Schema.Literal(\"ImportSpecifier\"),\n local: IdentifierSchema,\n imported: NameSchema,\n importKind: KindSchema,\n }),\n Schema.Struct({\n type: Schema.Literals([\"ImportDefaultSpecifier\", \"ImportNamespaceSpecifier\"]),\n local: IdentifierSchema,\n }),\n]);\n\nconst RangedSchema = Schema.Struct({ range: RangeSchema });\nconst DeclaratorSchema = Schema.Struct({ id: Schema.Unknown });\nconst ExportSpecifierSchema = Schema.Struct({\n range: RangeSchema,\n local: NameSchema,\n exported: NameSchema,\n exportKind: KindSchema,\n});\nconst ParentSchema = Schema.Struct({ body: Schema.Array(Schema.Unknown) });\nconst QuotedSchema = Schema.fromJsonString(Schema.String);\n\nconst decodeImport = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"ImportDeclaration\"),\n range: RangeSchema,\n source: RangedSchema,\n importKind: KindSchema,\n specifiers: Schema.Array(BindingSchema),\n }),\n);\nconst decodeVariable = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"VariableDeclaration\"),\n range: RangeSchema,\n declarations: Schema.Array(DeclaratorSchema),\n }),\n);\nconst decodeNamed = Schema.decodeUnknownOption(\n Schema.Struct({ type: Schema.String, range: RangeSchema, id: IdentifierSchema }),\n);\nconst decodeList = Schema.decodeUnknownOption(\n Schema.Struct({\n range: RangeSchema,\n source: Schema.Null,\n declaration: Schema.Null,\n exportKind: KindSchema,\n specifiers: Schema.Array(ExportSpecifierSchema),\n parent: ParentSchema,\n }),\n);\n\ntype Pattern = typeof PatternSchema.Type;\ntype SinglePattern = Extract<\n Pattern,\n { readonly type: \"Property\" | \"AssignmentPattern\" | \"RestElement\" }\n>;\ntype Binding = typeof BindingSchema.Type;\ntype Name = typeof NameSchema.Type;\n\nconst nameOf = (name: Name): string => {\n if (name.type === \"Literal\") {\n return name.value;\n }\n return name.name;\n};\n\nconst identifierOf = (name: Name): Option.Option<string> => {\n if (name.type === \"Literal\") {\n return Option.none();\n }\n return Option.some(name.name);\n};\n\nconst childOf = (pattern: SinglePattern): unknown => {\n if (pattern.type === \"Property\") {\n return pattern.value;\n }\n if (pattern.type === \"AssignmentPattern\") {\n return pattern.left;\n }\n return pattern.argument;\n};\n\nconst childrenOf = (pattern: Pattern): readonly unknown[] => {\n if (pattern.type === \"ObjectPattern\") {\n return pattern.properties;\n }\n if (pattern.type === \"ArrayPattern\") {\n return pattern.elements;\n }\n if (pattern.type === \"Identifier\") {\n return [];\n }\n return [childOf(pattern)];\n};\n\nconst bindingNames = (node: unknown): readonly string[] =>\n pipe(\n decodePattern(node),\n Option.match({\n onNone: () => [],\n onSome: (pattern) => {\n if (pattern.type === \"Identifier\") {\n return [pattern.name];\n }\n return pipe(childrenOf(pattern), Arr.flatMap(bindingNames));\n },\n }),\n );\n\nconst importedOf = (binding: Binding): string => {\n if (binding.type === \"ImportSpecifier\") {\n if (binding.imported.type === \"Literal\") {\n const { value } = binding.imported;\n return pipe(\n Schema.encodeOption(QuotedSchema)(value),\n Option.getOrElse(() => value),\n );\n }\n return binding.imported.name;\n }\n if (binding.type === \"ImportDefaultSpecifier\") {\n return DEFAULT_NAME;\n }\n return NAMESPACE_NAME;\n};\n\nconst typeOnlyOf = (binding: Binding): boolean =>\n binding.type === \"ImportSpecifier\" && binding.importKind === TYPE_KIND;\n\nconst importOf = (node: unknown): Option.Option<Statement> =>\n pipe(\n decodeImport(node),\n Option.map((statement): Statement => ({\n kind: \"import\",\n range: statement.range,\n from: statement.source.range,\n bindings: pipe(\n statement.specifiers,\n Arr.map((binding) => ({\n local: binding.local.name,\n imported: importedOf(binding),\n typeOnly: statement.importKind === TYPE_KIND || typeOnlyOf(binding),\n })),\n ),\n })),\n );\n\nconst declarationOf = (node: unknown): Option.Option<Statement> =>\n pipe(\n decodeVariable(node),\n Option.map((statement): Statement => ({\n kind: \"declaration\",\n type: statement.type,\n range: statement.range,\n names: pipe(\n statement.declarations,\n Arr.flatMap((declarator) => bindingNames(declarator.id)),\n ),\n })),\n Option.orElse(() =>\n pipe(\n decodeNamed(node),\n Option.map((statement): Statement => ({\n kind: \"declaration\",\n type: statement.type,\n range: statement.range,\n names: [statement.id.name],\n })),\n ),\n ),\n );\n\nconst statementOf = (node: unknown): Option.Option<Statement> =>\n pipe(\n importOf(node),\n Option.orElse(() => declarationOf(node)),\n );\n\nexport const exportListOf = (node: unknown): Option.Option<ExportList> =>\n pipe(\n decodeList(node),\n Option.filter((list) => Arr.isReadonlyArrayNonEmpty(list.specifiers)),\n Option.map((list) => ({\n range: list.range,\n typeOnly: list.exportKind === TYPE_KIND,\n specifiers: pipe(\n list.specifiers,\n Arr.map((specifier) => ({\n range: specifier.range,\n local: identifierOf(specifier.local),\n exported: nameOf(specifier.exported),\n typeOnly: specifier.exportKind === TYPE_KIND,\n })),\n ),\n body: pipe(list.parent.body, Arr.map(statementOf), Arr.getSomes),\n })),\n );\n","import { Array as Arr, Option, pipe } from \"effect\";\nimport type { Context, ESTree, Rule } from \"vite-plus/lint/plugins\";\n\nimport { editsOf } from \"./inline-exports-plan.ts\";\nimport { isTypeOnlyClass } from \"./inline-exports-resolve.ts\";\nimport { exportListOf } from \"./inline-exports-source.ts\";\nimport type { ExportList, Range } from \"./inline-exports-source.ts\";\nimport type { Source } from \"./inline-exports-text.ts\";\n\nconst MESSAGE =\n \"export は宣言に付ける(export const・export function など)。ファイルの末尾で export { … } にまとめない。\";\nconst START = 0;\nconst END = 1;\n\nconst outside =\n (list: Range) =>\n (range: Range): boolean =>\n range[START] < list[START] || range[END] > list[END];\n\nconst usedOutside = (context: Context, list: ExportList): readonly string[] =>\n pipe(\n context.sourceCode.scopeManager.scopes,\n Arr.flatMap((scope) => scope.variables),\n Arr.filter((variable) =>\n pipe(\n variable.references,\n Arr.some((reference) => outside(list.range)(reference.identifier.range)),\n ),\n ),\n Arr.map((variable) => variable.name),\n );\n\nconst sourceOf = (context: Context, list: ExportList): Source => ({\n text: context.sourceCode.text,\n comments: pipe(\n context.sourceCode.getAllComments(),\n Arr.map((comment) => comment.range),\n ),\n usedOutside: usedOutside(context, list),\n});\n\nconst reportList = (\n context: Context,\n node: ESTree.ExportNamedDeclaration,\n list: ExportList,\n): void => {\n pipe(\n editsOf(sourceOf(context, list))(list),\n Option.match({\n onNone: () => {\n context.report({ node, message: MESSAGE });\n },\n onSome: (edits) => {\n context.report({\n node,\n message: MESSAGE,\n fix: (fixer) =>\n pipe(\n edits,\n Arr.map((edit) =>\n fixer.replaceTextRange([edit.range[START], edit.range[END]], edit.text),\n ),\n ),\n });\n },\n }),\n );\n};\n\nexport const inlineExports: Rule = {\n meta: { type: \"suggestion\", fixable: \"code\" },\n create: (context) => ({\n ExportNamedDeclaration: (node): void => {\n const list = exportListOf(node);\n if (\n Option.isSome(list) &&\n !pipe(list.value.specifiers, Arr.every(isTypeOnlyClass(list.value)))\n ) {\n reportList(context, node, list.value);\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 \"typescript/sync\";\nimport type { NodeHandle, Project, Symbol as TypeSymbol } from \"typescript/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 \"typescript/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 \"typescript/ast\";\nimport { isTypeNode } from \"typescript/ast/is\";\nimport type { Type } from \"typescript/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 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\";\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};\n","import { Array as Arr, Option, 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 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\nexport const ruleOf = (intent: Intent): Rule => ({\n meta: { type: \"problem\" },\n create: (context) => ({\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","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/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 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 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/workers-tracing/elysia, so every handle call is a span.\",\n imports: [{ module: \"elysia\", names: Option.some([\"Elysia\", \"default\"]), typesAllowed: true }],\n members: [],\n },\n \"traced-effect-run\": {\n message: RUN_MESSAGE,\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 imports: [{ module: \"@effect/platform-node\", names: Option.none(), typesAllowed: true }],\n members: [],\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 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 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 meta: { readonly name: string } } = {\n meta: { name: \"msch-lint\" },\n rules: {\n ...CODED_RULES,\n ...pipe(INTENTS, Rec.map(ruleOf)),\n },\n};\n"],"mappings":";;;;;;AAeA,MAAMA,UAAQ;AACd,MAAMC,QAAM;AACZ,MAAM,MAAM;AACZ,MAAM,QAAQ;AACd,MAAMC,QAAM;AAEZ,MAAMC,gBAAc,OAAO,MAAM,CAAC,OAAO,QAAQ,OAAO,MAAM,CAAC;AAC/D,MAAMC,iBAAe,OAAO,OAAO,EAAE,OAAOD,cAAY,CAAC;AAIzD,MAAM,eAAe,OAAO,oBAAoBC,cAAY;AAE5D,MAAMC,qBAAmB,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,QAAQD;CACR,UAAUC;AACZ,CAAC;AAED,MAAM,mBAAmB,OAAO,OAAO;CACrC,MAAM,OAAO,QAAQ,gBAAgB;CACrC,QAAQ;CACR,WAAW,OAAO,MAAMD,cAAY;AACtC,CAAC;AAED,MAAM,mBAAmB,OAAO,oBAAoB,gBAAgB;AAEpE,MAAM,aAAa,OAAO,oBACxB,OAAO,OAAO;CACZ,MAAM,OAAO,QAAQ,gBAAgB;CACrC,QAAQA;CACR,WAAW,OAAO,MAAM,OAAO,OAAO;AACxC,CAAC,CACH;AAEA,MAAM,cAAc,OAAO,oBACzB,OAAO,OAAO;CAAE,MAAM,OAAO,QAAQ,gBAAgB;CAAG,MAAM,OAAO,MAAM,OAAO,OAAO;AAAE,CAAC,CAC9F;AAEA,MAAM,4BAA4B,OAAO,oBACvC,OAAO,OAAO;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;EACH,GAAG,KAAK,SAASC,OAAI,IAAI,MAAM,CAAC;CAClC;AACF"}
package/dist/oxlint.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as describeFinding, t as ProblemList } from "./problem-BoHYLMQT.mjs";
1
+ import { n as describeFinding, t as ProblemList } from "./problem-D2HKNIVq.mjs";
2
2
  import { t as JSON_FLAG } from "./cli-contract-D7btWrEu.mjs";
3
3
  import { i as nodeServicesLayer } from "./repository-files-B5sRbxlz.mjs";
4
4
  import { Array, Effect, Layer, Schema, Stream, pipe } from "effect";