@r_masseater/msch 0.23.0 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/{cli-contract-BViRo52q.mjs → cli-contract-B5ilWPaY.mjs} +7 -4
- package/dist/cli-contract-B5ilWPaY.mjs.map +1 -0
- package/dist/cli.mjs +91 -35
- package/dist/cli.mjs.map +1 -1
- package/dist/decision-rules.mjs +2 -2
- package/dist/decision-rules.mjs.map +1 -1
- package/dist/{inline-exports.d.mts → lint-rules.d.mts} +1 -1
- package/dist/{inline-exports.mjs → lint-rules.mjs} +162 -21
- package/dist/lint-rules.mjs.map +1 -0
- package/dist/lint.d.mts +5 -28
- package/dist/lint.mjs +199 -222
- package/dist/lint.mjs.map +1 -1
- package/dist/oxlint.mjs +1 -1
- package/dist/{workspace-CMPDXFWk.mjs → workspace-BPoE5oW1.mjs} +9 -9
- package/dist/{workspace-CMPDXFWk.mjs.map → workspace-BPoE5oW1.mjs.map} +1 -1
- package/dist/workspace-settings.mjs +1 -1
- package/package.json +5 -5
- package/skills/msch-checks/SKILL.md +1 -1
- package/dist/cli-contract-BViRo52q.mjs.map +0 -1
- package/dist/inline-exports.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli-contract-BViRo52q.mjs","names":["Arr","Str","Arr"],"sources":["../src/shared/lib/syntax.ts","../src/shared/lib/problem.ts","../src/shared/lib/cli-contract.ts"],"sourcesContent":["import { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport {\n isEnumDeclaration,\n isExportDeclaration,\n isIdentifier,\n isImportDeclaration,\n isInterfaceDeclaration,\n isStringLiteral,\n isTypeAliasDeclaration,\n SyntaxKind,\n} from \"./compiler.ts\";\nimport type {\n Checker,\n Declaration,\n EnumDeclaration,\n InterfaceDeclaration,\n Node,\n Program,\n SourceFile,\n TypeSymbol,\n Type,\n TypeAliasDeclaration,\n} from \"./compiler.ts\";\nimport { NODE_MODULES } from \"./repository-files.ts\";\n\nconst NODE_MODULES_SEGMENT = `/${NODE_MODULES}/`;\n\nexport const POSITION_BASE = 1;\n\nexport const uniqueByReference = <Item>(items: readonly Item[]): readonly Item[] =>\n Arr.dedupeWith(items, (left, right) => left === right);\n\nexport const childrenOf = (node: Node): readonly Node[] => {\n const children: Node[] = [];\n node.forEachChild((child) => {\n children.push(child);\n });\n return children;\n};\n\nconst SCOPE_PREFIX = \"@\";\nconst SCOPED_SEGMENTS = 2;\nconst UNSCOPED_SEGMENTS = 1;\n\nexport const packageOf = (fileName: string): string => {\n const afterModules = pipe(\n fileName,\n Str.lastIndexOf(NODE_MODULES_SEGMENT),\n Option.match({\n onNone: () => fileName,\n onSome: (index) => Str.slice(index + NODE_MODULES_SEGMENT.length)(fileName),\n }),\n );\n const segments = Str.split(\"/\")(afterModules);\n if (Str.startsWith(SCOPE_PREFIX)(afterModules)) {\n return pipe(Arr.take(segments, SCOPED_SEGMENTS), Arr.join(\"/\"));\n }\n return pipe(Arr.take(segments, UNSCOPED_SEGMENTS), Arr.join(\"/\"));\n};\n\nexport const descendantsOf = (node: Node): readonly Node[] =>\n pipe(\n childrenOf(node),\n Arr.flatMap((child) => Arr.prepend(descendantsOf(child), child)),\n );\n\nconst isExternalFile =\n (program: Program) =>\n (sourceFile: SourceFile): boolean =>\n Str.includes(NODE_MODULES_SEGMENT)(sourceFile.fileName) ||\n program.isSourceFileFromExternalLibrary(sourceFile);\n\nexport const isExternalDeclaration =\n (program: Program) =>\n (declaration: Node): boolean =>\n isExternalFile(program)(declaration.getSourceFile());\n\nconst ALIAS_KINDS: ReadonlySet<SyntaxKind> = new Set([\n SyntaxKind.ImportSpecifier,\n SyntaxKind.ImportClause,\n SyntaxKind.NamespaceImport,\n SyntaxKind.ExportSpecifier,\n SyntaxKind.ImportEqualsDeclaration,\n SyntaxKind.ExportAssignment,\n]);\n\nexport const declarationsOf = (symbol: TypeSymbol): readonly Declaration[] =>\n pipe(\n symbol.declarations,\n Arr.flatMap((handle) => Option.toArray(Option.fromUndefinedOr(handle.resolve()))),\n );\n\nconst isAliasDeclaration = (declaration: Node): boolean => ALIAS_KINDS.has(declaration.kind);\n\nexport const resolvedSymbol =\n (checker: Checker) =>\n (symbol: TypeSymbol): TypeSymbol => {\n if (\n !pipe(\n declarationsOf(symbol),\n Arr.some((declaration) => isAliasDeclaration(declaration)),\n )\n ) {\n return symbol;\n }\n return checker.getAliasedSymbol(symbol);\n };\n\nexport const symbolAt =\n (checker: Checker) =>\n (node: Node): Option.Option<TypeSymbol> =>\n Option.fromUndefinedOr(checker.getSymbolAtLocation(node)).pipe(\n Option.map(resolvedSymbol(checker)),\n );\n\nexport const referencedSymbols =\n (checker: Checker) =>\n (node: Node): readonly TypeSymbol[] => {\n const identifiers = pipe(\n Arr.prepend(descendantsOf(node), node),\n Arr.filter((candidate) => isIdentifier(candidate)),\n );\n const symbols = pipe(\n checker.getSymbolAtLocation(identifiers),\n Arr.flatMap((symbol) => Option.toArray(Option.fromUndefinedOr(symbol))),\n Arr.map(resolvedSymbol(checker)),\n );\n return uniqueByReference(symbols);\n };\n\nexport const lineOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).line + POSITION_BASE;\n};\n\nexport const columnOf = (node: Node): number => {\n const sourceFile = node.getSourceFile();\n return (\n sourceFile.getLineAndCharacterOfPosition(node.getStart(sourceFile)).character + POSITION_BASE\n );\n};\n\nexport const contains =\n (outer: Node) =>\n (inner: Node): boolean =>\n outer.getSourceFile().fileName === inner.getSourceFile().fileName &&\n outer.getStart() <= inner.getStart() &&\n inner.getEnd() <= outer.getEnd();\n\nexport const isTypeDeclaration = (\n declaration: Node,\n): declaration is TypeAliasDeclaration | InterfaceDeclaration | EnumDeclaration =>\n isTypeAliasDeclaration(declaration) ||\n isInterfaceDeclaration(declaration) ||\n isEnumDeclaration(declaration);\n\nexport const isGenericDeclaration = (declaration: Node): boolean =>\n (isTypeAliasDeclaration(declaration) || isInterfaceDeclaration(declaration)) &&\n Arr.isReadonlyArrayNonEmpty(declaration.typeParameters ?? []);\n\nexport const propertyNamesOf =\n (checker: Checker) =>\n (type: Type): readonly string[] =>\n pipe(\n checker.getPropertiesOfType(type),\n Arr.map((property) => property.name),\n );\n\nconst moduleSpecifierOf = (statement: Node): Option.Option<string> => {\n if (!isImportDeclaration(statement) && !isExportDeclaration(statement)) {\n return Option.none();\n }\n return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(\n Option.filter((specifier) => isStringLiteral(specifier)),\n Option.map((specifier) => specifier.text),\n );\n};\n\nexport const importedModulesOf = (sourceFile: SourceFile): readonly string[] =>\n pipe(\n sourceFile.statements,\n Arr.map((statement) => moduleSpecifierOf(statement)),\n Arr.getSomes,\n );\n","import { Array as Arr, Order, Schema, pipe } from \"effect\";\n\nimport type { Node } from \"./compiler.ts\";\nimport { columnOf, lineOf } from \"./syntax.ts\";\n\nconst RuleNameSchema = Schema.Literals([\n \"owner-annotation\",\n \"duplicate-value-set\",\n \"owner-value-set\",\n \"owner-extension\",\n \"owned-literal\",\n \"library-value-set\",\n \"library-shape\",\n \"unused-override\",\n \"removable-override\",\n \"hidden-unicode\",\n \"python-file\",\n \"python-command\",\n \"docker-file\",\n \"docker-command\",\n \"git-subpath-dependency\",\n \"unneeded-file\",\n \"unneeded-setup\",\n \"cargo-outside-pnpm\",\n \"nested-docs\",\n \"root-readme\",\n \"agent-docs-length\",\n \"root-docs\",\n \"shell-script\",\n \"workflow-script\",\n \"workflow-queue\",\n \"stack-dependency\",\n \"install-size\",\n \"unverified-crate\",\n \"hidden-verify\",\n \"root-workspace-path\",\n \"shared-uncached-task\",\n \"workflow-path\",\n \"command-outside-bin\",\n \"unrun-command\",\n \"scripts-directory\",\n \"listed-entry\",\n \"workflow-path-filter\",\n \"workflow-package\",\n \"colocated-test\",\n \"comment\",\n \"applied-package\",\n \"package-script\",\n \"package-manager-command\",\n \"skipped-gate\",\n \"filter-task\",\n \"vite-plus-block\",\n \"node-version\",\n \"replaced-tool\",\n \"missing-hook\",\n \"dangling-link\",\n \"alchemy-patch\",\n \"skill-file\",\n \"unlocked-skill\",\n \"pass-through-wrapper\",\n]);\n\nexport type RuleName = typeof RuleNameSchema.Type;\n\nconst ProblemSchema = Schema.Struct({\n file: Schema.String,\n line: Schema.Int,\n column: Schema.Int,\n rule: RuleNameSchema,\n message: Schema.String,\n});\n\nexport type Problem = typeof ProblemSchema.Type;\n\nexport const ProblemList = Schema.Array(ProblemSchema);\n\nexport const CANDIDATE_LIMIT = 3;\n\nexport interface Finding {\n readonly rule: RuleName;\n readonly message: string;\n}\n\nexport const problemAt =\n ({ rule, message }: Finding) =>\n (node: Node): Problem => ({\n file: node.getSourceFile().fileName,\n line: lineOf(node),\n column: columnOf(node),\n rule,\n message,\n });\n\nconst problemOrder: Order.Order<Problem> = Order.combineAll([\n Order.mapInput(Order.String, (problem: Problem) => problem.file),\n Order.mapInput(Order.Number, (problem: Problem) => problem.line),\n Order.mapInput(Order.Number, (problem: Problem) => problem.column),\n Order.mapInput(Order.String, (problem: Problem) => problem.rule),\n Order.mapInput(Order.String, (problem: Problem) => problem.message),\n]);\n\nconst problemKey = (problem: Problem): string =>\n pipe(\n [problem.file, String(problem.line), String(problem.column), problem.rule, problem.message],\n Arr.join(\"\\0\"),\n );\n\nexport const sortProblems = (problems: readonly Problem[]): readonly Problem[] =>\n Arr.sort(\n Arr.dedupeWith(problems, (left, right) => problemKey(left) === problemKey(right)),\n problemOrder,\n );\n\nexport const describeFinding = (problem: Problem): string => `[${problem.rule}] ${problem.message}`;\n\nexport const formatProblem =\n (relative: (file: string) => string) =>\n (problem: Problem): string =>\n `${relative(problem.file)}:${String(problem.line)}:${String(problem.column)} ${describeFinding(problem)}`;\n","export const JSON_FLAG = \"--json\";\n"],"mappings":";;;;;;AA0BA,MAAM,uBAAuB,IAAI,aAAa;AAI9C,MAAa,qBAA2B,UACtCA,MAAI,WAAW,Q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;CAC/D,MAAM,SAAS,MAAM,SAAS,YAAqB,QAAQ,MAAM;CACjE,MAAM,SAAS,MAAM,SAAS,YAAqB,QAAQ,IAAI;CAC/D,MAAM,SAAS,MAAM,SAAS,YAAqB,QAAQ,OAAO;AACpE,CAAC;AAED,MAAM,cAAc,YAClB,KACE;CAAC,QAAQ;CAAM,OAAO,QAAQ,IAAI;CAAG,OAAO,QAAQ,MAAM;CAAG,QAAQ;CAAM,QAAQ;AAAO,GAC1FE,MAAI,KAAK,IAAI,CACf;AAEF,MAAa,gBAAgB,aAC3BA,MAAI,KACFA,MAAI,WAAW,WAAW,MAAM,UAAU,WAAW,IAAI,MAAM,WAAW,KAAK,CAAC,GAChF,YACF;AAEF,MAAa,mBAAmB,YAA6B,IAAI,QAAQ,KAAK,IAAI,QAAQ;AAE1F,MAAa,iBACV,cACA,YACC,GAAG,SAAS,QAAQ,IAAI,EAAE,GAAG,OAAO,QAAQ,IAAI,EAAE,GAAG,OAAO,QAAQ,MAAM,EAAE,GAAG,gBAAgB,OAAO;;ACtH1G,MAAa,YAAY"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inline-exports.mjs","names":["DEFAULT_NAME","Arr","declarationOf","START","END","NEWLINE","Str","Bool","Arr","NAMESPACE_NAME","START","END","Bool","Arr","Str","Arr","Arr"],"sources":["../src/features/inline-exports/model/inline-exports-resolve.ts","../src/features/inline-exports/model/inline-exports-text.ts","../src/features/inline-exports/model/inline-exports-plan.ts","../src/features/inline-exports/model/inline-exports-source.ts","../src/features/inline-exports/model/inline-exports.ts"],"sourcesContent":["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, Plugin, 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\nconst 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\nexport const mschLintPlugin: Plugin & { readonly meta: { readonly name: string } } = {\n meta: { name: \"msch-lint\" },\n rules: { \"inline-exports\": inlineExports },\n};\n"],"mappings":";;AAkCA,MAAMA,iBAAe;AACrB,MAAM,oBAAoB;AAC1B,MAAM,oCAAyC,IAAI,IAAI,CACrD,0BACA,wBACF,CAAC;AAED,MAAa,cACV,UACA,cACC,KAAK,YAAY,U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