@r_masseater/msch 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +1028 -824
- package/dist/cli.mjs.map +1 -1
- package/dist/{comment-directives-DApQXgQf.mjs → comment-directives-TN0dNEbg.mjs} +2 -2
- package/dist/comment-directives-TN0dNEbg.mjs.map +1 -0
- package/dist/decision-rules.mjs +1 -1
- package/dist/decision-rules.mjs.map +1 -1
- package/dist/inline-exports.d.mts +8 -0
- package/dist/inline-exports.mjs +370 -0
- package/dist/inline-exports.mjs.map +1 -0
- package/dist/lint.d.mts +22 -14
- package/dist/lint.mjs +30 -9
- package/dist/lint.mjs.map +1 -1
- package/dist/oxlint.mjs +3 -3
- package/dist/oxlint.mjs.map +1 -1
- package/dist/{cli-contract-ChzTJ0Na.mjs → problem-BeBSq75T.mjs} +11 -7
- package/dist/problem-BeBSq75T.mjs.map +1 -0
- package/dist/repository-files-CfhXZQrO.mjs +55 -0
- package/dist/repository-files-CfhXZQrO.mjs.map +1 -0
- package/dist/{workspace-tasks-CRL-gm__.mjs → workspace-jN1GGTGn.mjs} +196 -39
- package/dist/workspace-jN1GGTGn.mjs.map +1 -0
- package/dist/workspace-settings.d.mts +2 -2
- package/dist/workspace-settings.mjs +5 -17
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +10 -3
- package/src/{vite.d.ts → app/vite.d.ts} +7 -17
- package/dist/cli-contract-ChzTJ0Na.mjs.map +0 -1
- package/dist/comment-directives-DApQXgQf.mjs.map +0 -1
- package/dist/dependencies-x3j9tLcR.mjs +0 -186
- package/dist/dependencies-x3j9tLcR.mjs.map +0 -1
- package/dist/workspace-tasks-CRL-gm__.mjs.map +0 -1
package/dist/lint.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import decision_rules_default from "./decision-rules.mjs";
|
|
2
|
-
import { t as COMMENT_DIRECTIVES } from "./comment-directives-
|
|
2
|
+
import { t as COMMENT_DIRECTIVES } from "./comment-directives-TN0dNEbg.mjs";
|
|
3
3
|
import { Array, Record, String, Struct, pipe } from "effect";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import tanstackQuery from "@r_masseater/oxlint-typed-rules/tanstack-query";
|
|
@@ -10,7 +10,7 @@ import { presets } from "@effect/tsgo/oxlint-presets";
|
|
|
10
10
|
import htmlReact from "@html-eslint/eslint-plugin-react";
|
|
11
11
|
import eslintReact from "@r_masseater/oxlint-typed-rules/react";
|
|
12
12
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
13
|
-
// src/lint/lint-overrides.config.ts
|
|
13
|
+
// src/features/lint-preset/config/lint-overrides.config.ts
|
|
14
14
|
const alchemyOverride = {
|
|
15
15
|
files: ["**/alchemy.run.ts"],
|
|
16
16
|
rules: { "eslint-js/no-restricted-syntax": [
|
|
@@ -37,7 +37,7 @@ const scriptsOverride = {
|
|
|
37
37
|
"effecttsgo/node-builtin-import": "off"
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
// src/lint/lint.config.ts
|
|
40
|
+
// src/features/lint-preset/config/lint.config.ts
|
|
41
41
|
const REACT_STATE_HOOKS = [
|
|
42
42
|
"useState",
|
|
43
43
|
"useReducer",
|
|
@@ -252,7 +252,7 @@ const shadcnRestyleContracts = [{
|
|
|
252
252
|
"mb-*"
|
|
253
253
|
]
|
|
254
254
|
}];
|
|
255
|
-
// src/lint/readonly-binary.config.ts
|
|
255
|
+
// src/features/lint-preset/config/readonly-binary.config.ts
|
|
256
256
|
const BINARY_DATA = [
|
|
257
257
|
"ArrayBuffer",
|
|
258
258
|
"DataView",
|
|
@@ -262,7 +262,7 @@ const BINARY_DATA = [
|
|
|
262
262
|
"Uint8Array",
|
|
263
263
|
"Uint32Array"
|
|
264
264
|
];
|
|
265
|
-
// src/lint/readonly-browser.config.ts
|
|
265
|
+
// src/features/lint-preset/config/readonly-browser.config.ts
|
|
266
266
|
const WEBGPU_HANDLES = [
|
|
267
267
|
"GPUDevice",
|
|
268
268
|
"GPUCanvasContext",
|
|
@@ -287,13 +287,17 @@ const BROWSER_HANDLES = [
|
|
|
287
287
|
"ImageBitmap",
|
|
288
288
|
...WEBGPU_HANDLES
|
|
289
289
|
];
|
|
290
|
-
// src/lint/readonly-lint-tools.config.ts
|
|
290
|
+
// src/features/lint-preset/config/readonly-lint-tools.config.ts
|
|
291
291
|
const lintToolReadonlyAllow = [
|
|
292
292
|
{
|
|
293
293
|
from: "package",
|
|
294
294
|
package: "@oxlint/plugins",
|
|
295
295
|
name: [
|
|
296
296
|
"Context",
|
|
297
|
+
"ExportNamedDeclaration",
|
|
298
|
+
"ExportSpecifier",
|
|
299
|
+
"Statement",
|
|
300
|
+
"Fixer",
|
|
297
301
|
"Location",
|
|
298
302
|
"Node",
|
|
299
303
|
"Range",
|
|
@@ -372,7 +376,7 @@ const lintToolReadonlyAllow = [
|
|
|
372
376
|
]
|
|
373
377
|
}
|
|
374
378
|
];
|
|
375
|
-
// src/lint/readonly-types.config.ts
|
|
379
|
+
// src/features/lint-preset/config/readonly-types.config.ts
|
|
376
380
|
const readonlyParameterAllow = [
|
|
377
381
|
{
|
|
378
382
|
from: "lib",
|
|
@@ -809,7 +813,7 @@ const readonlyParameterAllow = [
|
|
|
809
813
|
]
|
|
810
814
|
}
|
|
811
815
|
];
|
|
812
|
-
// src/lint/preset.ts
|
|
816
|
+
// src/features/lint-preset/config/preset.ts
|
|
813
817
|
const resolved = (specifier) => fileURLToPath(import.meta.resolve(specifier));
|
|
814
818
|
const DECISION_TIMEOUT_MS = 5e4;
|
|
815
819
|
const typedRules = "@r_masseater/oxlint-typed-rules";
|
|
@@ -890,6 +894,10 @@ const lint = {
|
|
|
890
894
|
{
|
|
891
895
|
name: decisionPluginName,
|
|
892
896
|
specifier: resolved("@r_masseater/msch/decision-rules")
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
name: "msch-lint",
|
|
900
|
+
specifier: resolved("@r_masseater/msch/inline-exports")
|
|
893
901
|
}
|
|
894
902
|
],
|
|
895
903
|
rules: {
|
|
@@ -927,6 +935,9 @@ const lint = {
|
|
|
927
935
|
"eslint/sort-keys": "off",
|
|
928
936
|
"import/no-named-export": "off",
|
|
929
937
|
"import/prefer-default-export": "off",
|
|
938
|
+
"import/group-exports": "off",
|
|
939
|
+
"import/exports-last": "off",
|
|
940
|
+
"msch-lint/inline-exports": "error",
|
|
930
941
|
"react/react-in-jsx-scope": "off",
|
|
931
942
|
"eslint/no-undef": "off",
|
|
932
943
|
"typescript/promise-function-async": "off",
|
|
@@ -938,6 +949,16 @@ const lint = {
|
|
|
938
949
|
"eslint/one-var": ["error", "never"],
|
|
939
950
|
"eslint/id-length": ["error", { exceptions: ["x", "y"] }],
|
|
940
951
|
"jsdoc/check-tag-names": ["error", { definedTags: ["msch"] }],
|
|
952
|
+
"jsdoc/require-param": ["error", { exemptedBy: [
|
|
953
|
+
"inheritdoc",
|
|
954
|
+
"internal",
|
|
955
|
+
"msch"
|
|
956
|
+
] }],
|
|
957
|
+
"jsdoc/require-returns": ["error", { exemptedBy: [
|
|
958
|
+
"inheritdoc",
|
|
959
|
+
"internal",
|
|
960
|
+
"msch"
|
|
961
|
+
] }],
|
|
941
962
|
"eslint/no-restricted-imports": ["error", restrictedImports],
|
|
942
963
|
"typescript/prefer-readonly-parameter-types": ["error", {
|
|
943
964
|
ignoreInferredTypes: true,
|
|
@@ -986,7 +1007,7 @@ const lint = {
|
|
|
986
1007
|
reportUnusedDisableDirectives: "error"
|
|
987
1008
|
}
|
|
988
1009
|
};
|
|
989
|
-
// src/lint/fsd-rules.ts
|
|
1010
|
+
// src/features/lint-preset/config/fsd-rules.ts
|
|
990
1011
|
const fsdRules = {
|
|
991
1012
|
"fsd/insignificant-slice": "off",
|
|
992
1013
|
"fsd/no-cross-imports": "error",
|
package/dist/lint.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.mjs","names":["Arr","Rec","Str","effectPresets","decisionPlugin","shadcn","decisionPlugin"],"sources":["../src/lint/lint-overrides.config.ts","../src/lint/lint.config.ts","../src/lint/readonly-binary.config.ts","../src/lint/readonly-browser.config.ts","../src/lint/readonly-lint-tools.config.ts","../src/lint/readonly-types.config.ts","../src/lint/preset.ts","../src/lint/fsd-rules.ts"],"sourcesContent":["const alchemyOverride: {\n files: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/alchemy.run.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n {\n selector: 'CallExpression[callee.name=\"Stack\"]:not([arguments.0.name=\"APP_NAME\"])',\n message: \"スタック名には app-name.ts の APP_NAME を渡す\",\n },\n {\n selector:\n 'Program:not(:has(YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n {\n selector:\n 'CallExpression[callee.name=\"Stack\"] > .arguments:nth-child(3):not(:has(FunctionExpression > BlockStatement > ExpressionStatement:nth-last-child(2) > YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n ],\n },\n};\n\nconst scriptsOverride: {\n files: string[];\n rules: Readonly<Record<string, \"off\">>;\n} = {\n files: [\"scripts/**\"],\n rules: {\n \"node/no-process-env\": \"off\",\n \"node/no-sync\": \"off\",\n \"effecttsgo/node-builtin-import\": \"off\",\n },\n};\n\nexport { alchemyOverride, scriptsOverride };\n","import { presets as effectPresets } from \"@effect/tsgo/oxlint-presets\";\nimport htmlReact from \"@html-eslint/eslint-plugin-react\";\nimport eslintReact from \"@r_masseater/oxlint-typed-rules/react\";\nimport { Array as Arr, Record as Rec, String as Str, Struct, pipe } from \"effect\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\n\nimport decisionPlugin from \"./decision-rules.ts\";\n\nconst REACT_STATE_HOOKS: readonly string[] = [\n \"useState\",\n \"useReducer\",\n \"createContext\",\n \"useContext\",\n];\nconst HAND_WRITTEN_SQL = \"SQL を手書きせず Drizzle のクエリビルダーを使う\";\nconst UI_STATE = \"UI 状態は effect-atom だけで扱う\";\n\nconst INSTRUMENTATION = \"計装は Effect のトレーシングだけで扱う\";\nconst INFRASTRUCTURE = \"インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない\";\n\nconst requiredStack: Readonly<Record<string, readonly string[]>> = {\n [UI_STATE]: [\n \"zustand\",\n \"jotai\",\n \"valtio\",\n \"recoil\",\n \"mobx\",\n \"mobx-*\",\n \"redux\",\n \"@reduxjs/*\",\n \"react-redux\",\n \"xstate\",\n \"@xstate/*\",\n \"nanostores\",\n \"@nanostores/*\",\n \"@preact/signals*\",\n ],\n \"サーバー状態は TanStack Query と Eden だけで扱う\": [\n \"swr\",\n \"react-query\",\n \"@apollo/*\",\n \"urql\",\n \"@urql/*\",\n \"axios\",\n \"ky\",\n \"ofetch\",\n \"got\",\n \"node-fetch\",\n \"graphql-request\",\n \"@trpc/*\",\n ],\n \"ルーティングとサーバーは TanStack Start と Elysia だけで扱う\": [\n \"react-router\",\n \"react-router-dom\",\n \"next\",\n \"@remix-run/*\",\n \"wouter\",\n \"express\",\n \"hono\",\n \"fastify\",\n \"koa\",\n \"@nestjs/*\",\n ],\n \"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する\": [\n \"prisma\",\n \"@prisma/*\",\n \"typeorm\",\n \"sequelize\",\n \"kysely\",\n \"knex\",\n \"@mikro-orm/*\",\n \"better-sqlite3\",\n \"pg\",\n \"mysql2\",\n ],\n \"認証は better-auth だけで扱う\": [\n \"next-auth\",\n \"@auth/*\",\n \"lucia\",\n \"passport\",\n \"passport-*\",\n \"@clerk/*\",\n \"firebase/auth\",\n \"@supabase/*\",\n ],\n \"UI は shadcn/ui と Tailwind CSS だけで組む\": [\n \"@mui/*\",\n \"antd\",\n \"@chakra-ui/*\",\n \"@mantine/*\",\n \"styled-components\",\n \"@emotion/*\",\n \"bootstrap\",\n \"react-bootstrap\",\n ],\n \"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う\": [\n \"zod\",\n \"yup\",\n \"joi\",\n \"valibot\",\n \"arktype\",\n \"io-ts\",\n \"superstruct\",\n \"moment\",\n \"dayjs\",\n \"date-fns\",\n \"luxon\",\n \"winston\",\n \"pino\",\n \"bunyan\",\n \"loglevel\",\n \"lodash\",\n \"lodash-es\",\n \"ramda\",\n \"rxjs\",\n \"fp-ts\",\n \"neverthrow\",\n \"ts-results\",\n \"purify-ts\",\n ],\n \"フィーチャーフラグは OpenFeature だけで扱う\": [\n \"launchdarkly-*\",\n \"@launchdarkly/*\",\n \"@growthbook/*\",\n \"unleash-client\",\n \"flagsmith\",\n \"@vercel/flags\",\n ],\n [INSTRUMENTATION]: [\"@opentelemetry/*\", \"dd-trace\", \"newrelic\"],\n [INFRASTRUCTURE]: [\n \"wrangler\",\n \"miniflare\",\n \"@cloudflare/vite-plugin\",\n \"@vercel/*\",\n \"@netlify/*\",\n \"aws-cdk\",\n \"aws-cdk-lib\",\n \"@pulumi/*\",\n \"cdktf\",\n ],\n};\n\nconst requiredStackEntries = Arr.flatMap(Rec.toEntries(requiredStack), ([message, modules]) =>\n pipe(\n modules,\n Arr.map((module) => ({ message, module })),\n ),\n);\n\nconst requiredStackPaths: readonly Readonly<{ name: string; message: string }>[] = Arr.map(\n pipe(\n requiredStackEntries,\n Arr.filter(({ module }) => !Str.includes(\"*\")(module)),\n ),\n ({ message, module }) => ({ name: module, message }),\n);\n\nconst requiredStackPatterns: readonly Readonly<{ group: readonly string[]; message: string }>[] =\n pipe(\n requiredStackEntries,\n Arr.map(({ message, module }) => {\n if (Str.includes(\"*\")(module)) {\n return { group: [module, `${module}/**`], message };\n }\n return { group: [`${module}/**`], message };\n }),\n );\n\nconst restrictedImports = {\n paths: [\n {\n name: \"react\",\n importNames: [...REACT_STATE_HOOKS],\n message: UI_STATE,\n },\n { name: \"drizzle-orm\", importNames: [\"sql\"], message: HAND_WRITTEN_SQL },\n { name: \"drizzle-orm/sql\", message: HAND_WRITTEN_SQL },\n ...requiredStackPaths,\n ],\n patterns: [...requiredStackPatterns],\n};\n\nconst generated = [\n \"**/routeTree.gen.ts\",\n \"**/generated/**\",\n \"**/drizzle/**/snapshot.json\",\n \".claude/skills/**\",\n \".intent/**\",\n \"AGENTS.md\",\n \"skills-lock.json\",\n \".github/release-please/*manifest.json\",\n \"**/*.d.rpp.ts\",\n \"**/src-tauri/gen/**\",\n];\n\nconst asErrors = (names: readonly string[]): Readonly<Record<string, \"error\">> =>\n Rec.fromEntries(\n pipe(\n names,\n Arr.map((name) => [name, \"error\"] as const),\n ),\n );\n\nconst allRulesOf = ({\n prefix,\n rules,\n}: Readonly<{ prefix: string; rules: Readonly<Record<string, unknown>> }>): Readonly<\n Record<string, \"error\">\n> =>\n asErrors(\n pipe(\n Rec.keys(rules),\n Arr.map((rule) => `${prefix}/${rule}`),\n ),\n );\n\nconst reactHooksRuleNames = pipe(\n Struct.keys(reactHooks.configs[\"recommended-latest\"].rules),\n Arr.map(Str.replace(\"react-hooks/\", \"react-hooks-js/\")),\n);\n\nconst reactHooksRules = asErrors(reactHooksRuleNames);\n\nconst eslintReactRuleNames = pipe(\n Rec.keys(eslintReact.configs[\"strict-typescript\"].rules ?? {}),\n Arr.filter(\n (name) => !(Str.replace(\"@eslint-react/\", \"react-hooks-js/\")(name) in reactHooksRules),\n ),\n);\n\nconst effectRuleNames = pipe(\n Rec.values(effectPresets),\n Arr.flatMap((preset) => Struct.keys(preset.rules ?? {})),\n);\n\nconst pluginRules: Readonly<Record<string, \"error\">> = {\n ...asErrors(Rec.keys(htmlReact.configs.all.rules ?? {})),\n ...reactHooksRules,\n ...asErrors(eslintReactRuleNames),\n ...asErrors(effectRuleNames),\n};\n\nconst decisionPluginName = decisionPlugin.meta.name;\n\nconst decisionRules = allRulesOf({ prefix: decisionPluginName, rules: decisionPlugin.rules });\n\nconst decisionTestRules = pipe(\n decisionRules,\n Rec.map(() => \"off\" as const),\n);\n\nconst shadcnRestyleContracts = [\n { pattern: \"^Table(Head|Cell)$\", allow: [\"text-alignment\", \"fvn-spacing\"] },\n { pattern: \"^TableCaption$\", allow: [\"caption\", \"text-alignment\", \"mt-*\", \"mb-*\"] },\n];\n\nexport { COMMENT_DIRECTIVES } from \"./comment-directives.ts\";\nexport {\n INFRASTRUCTURE,\n INSTRUMENTATION,\n shadcnRestyleContracts,\n allRulesOf,\n decisionPluginName,\n decisionRules,\n decisionTestRules,\n generated,\n pluginRules,\n requiredStack,\n restrictedImports,\n};\n","const BINARY_DATA: readonly string[] = [\n \"ArrayBuffer\",\n \"DataView\",\n \"Float32Array\",\n \"Float64Array\",\n \"Int32Array\",\n \"Uint8Array\",\n \"Uint32Array\",\n];\n\nexport { BINARY_DATA };\n","const WEBGPU_HANDLES: readonly string[] = [\n \"GPUDevice\",\n \"GPUCanvasContext\",\n \"GPUTexture\",\n \"GPUBuffer\",\n \"GPUBindGroup\",\n \"GPUBindGroupLayout\",\n \"GPUPipelineLayout\",\n \"GPURenderPipeline\",\n \"GPUSampler\",\n];\n\nconst BROWSER_HANDLES: readonly string[] = [\n \"HTMLCanvasElement\",\n \"HTMLImageElement\",\n \"HTMLAnchorElement\",\n \"CanvasRenderingContext2D\",\n \"PointerEvent\",\n \"WheelEvent\",\n \"KeyboardEvent\",\n \"MouseEvent\",\n \"AbortSignal\",\n \"ImageBitmap\",\n ...WEBGPU_HANDLES,\n];\n\nexport { BROWSER_HANDLES, WEBGPU_HANDLES };\n","const lintToolReadonlyAllow = [\n {\n from: \"package\" as const,\n package: \"@oxlint/plugins\",\n name: [\n \"Context\",\n \"Location\",\n \"Node\",\n \"Range\",\n \"Rule\",\n \"RuleMeta\",\n \"SourceCode\",\n \"VisitorWithHooks\",\n ],\n },\n {\n from: \"package\" as const,\n package: \"oxlint\",\n name: [\n \"DummyRule\",\n \"DummyRuleMap\",\n \"InvalidTestCase\",\n \"OxlintOverride\",\n \"Rule\",\n \"TestCases\",\n \"ValidTestCase\",\n ],\n },\n { from: \"package\" as const, package: \"@commitlint/types\", name: [\"QualifiedConfig\"] },\n {\n from: \"package\" as const,\n package: \"@textlint/config-loader\",\n name: [\"TextlintLoadPackagesFromRawConfigResult\"],\n },\n { from: \"package\" as const, package: \"markdownlint\", name: [\"LintError\"] },\n {\n from: \"package\" as const,\n package: \"steiger\",\n name: [\"ConfigObject\", \"GlobalIgnore\", \"Plugin\"],\n },\n {\n from: \"file\" as const,\n path: \"upstream/attw-core/lib/checkPackage.d.ts\",\n name: [\"CheckPackageOptions\"],\n },\n {\n from: \"package\" as const,\n package: \"@r_masseater/vite-plus-adopt\",\n name: [\"CheckPackageOptions\"],\n },\n {\n from: \"file\" as const,\n path: \"src/types.ts\",\n name: [\"CommitlintConfig\", \"MarkdownlintConfig\", \"TextlintConfig\", \"ToolSections\"],\n },\n {\n from: \"file\" as const,\n name: [\n \"BoundSymbol\",\n \"CompatSymbol\",\n \"CompatType\",\n \"FileBinding\",\n \"SymbolTable\",\n \"TypedContext\",\n ],\n },\n];\n\nexport { lintToolReadonlyAllow };\n","import { BINARY_DATA } from \"./readonly-binary.config.ts\";\nimport { BROWSER_HANDLES, WEBGPU_HANDLES } from \"./readonly-browser.config.ts\";\nimport { lintToolReadonlyAllow } from \"./readonly-lint-tools.config.ts\";\n\nconst readonlyParameterAllow = [\n {\n from: \"lib\" as const,\n name: [\n \"HTMLElement\",\n \"HTMLDivElement\",\n \"Worker\",\n \"ReadableStream\",\n \"Request\",\n \"Response\",\n ...BINARY_DATA,\n \"RegExp\",\n \"RegExpExecArray\",\n \"RegExpMatchArray\",\n \"Date\",\n \"SpeechRecognitionResult\",\n \"CryptoKey\",\n ...BROWSER_HANDLES,\n ],\n },\n { from: \"package\" as const, package: \"@webgpu/types\", name: [...WEBGPU_HANDLES] },\n { from: \"package\" as const, package: \"@vscode/tree-sitter-wasm\", name: \"Language\" },\n { from: \"package\" as const, package: \"domhandler\", name: [\"AnyNode\", \"Text\", \"Element\"] },\n {\n from: \"package\" as const,\n package: \"@cloudflare/workers-types\",\n name: [\n \"AnalyticsEngineDataset\",\n \"Container\",\n \"DurableObjectState\",\n \"DurableObjectStorage\",\n \"CryptoKey\",\n \"KVNamespace\",\n \"R2Bucket\",\n \"SecretsStoreSecret\",\n \"TailEvent\",\n \"Onset\",\n \"Log\",\n \"Exception\",\n \"Attribute\",\n \"SpanUpdateInfo\",\n \"FetchResponseInfo\",\n \"Span\",\n ],\n },\n { from: \"package\" as const, package: \"@alchemy.run/cloudflare\", name: [\"Store\", \"WorkerProps\"] },\n {\n from: \"package\" as const,\n package: \"@bufbuild/protobuf\",\n name: [\"DescMessage\", \"JsonObject\", \"JsonValue\", \"Message\"],\n },\n { from: \"package\" as const, package: \"lighthouse\", name: [\"FlowResult\", \"Step\", \"UserFlow\"] },\n { from: \"package\" as const, package: \"vitest\", name: \"TestProject\" },\n {\n from: \"package\" as const,\n package: \"puppeteer-core\",\n name: [\"Browser\", \"ElementHandle\", \"Page\"],\n },\n { from: \"package\" as const, package: \"miniflare\", name: \"Miniflare\" },\n { from: \"package\" as const, package: \"elysia\", name: \"ElysiaConfig\" },\n { from: \"package\" as const, package: \"@types/node\", name: [\"Request\", \"Response\"] },\n { from: \"package\" as const, package: \"@better-auth/drizzle-adapter\", name: \"DB\" },\n { from: \"package\" as const, package: \"@tanstack/query-core\", name: \"QueryClient\" },\n {\n from: \"package\" as const,\n package: \"@codemirror/view\",\n name: [\"Decoration\", \"EditorView\", \"GutterMarker\", \"ViewUpdate\", \"WidgetType\"],\n },\n {\n from: \"package\" as const,\n package: \"@codemirror/state\",\n name: [\"ChangeDesc\", \"EditorState\", \"Extension\", \"StateEffect\", \"Text\", \"Transaction\"],\n },\n { from: \"package\" as const, package: \"@codemirror/lint\", name: \"Diagnostic\" },\n { from: \"package\" as const, package: \"comlink\", name: \"Remote\" },\n {\n from: \"package\" as const,\n package: \"typescript\",\n name: [\n \"API\",\n \"ArrayLiteralExpression\",\n \"BinaryExpression\",\n \"BindingElement\",\n \"CallExpression\",\n \"Checker\",\n \"ClassDeclaration\",\n \"CompilerHost\",\n \"CompilerOptions\",\n \"CompletionEntry\",\n \"ConfigFileResponse\",\n \"Declaration\",\n \"DeclarationBase\",\n \"DiagnosticResponse\",\n \"ElementAccessExpression\",\n \"EnumDeclaration\",\n \"ExportAssignment\",\n \"ExportDeclaration\",\n \"ExportSpecifier\",\n \"Expression\",\n \"ExpressionBase\",\n \"InterfaceDeclaration\",\n \"JSDocCallbackTag\",\n \"JSDocTagBase\",\n \"JSDocTypedefTag\",\n \"ModuleDeclaration\",\n \"Node\",\n \"NodeHandle\",\n \"NumericLiteral\",\n \"ParameterDeclaration\",\n \"ParseConfigFileHost\",\n \"ParsedCommandLine\",\n \"Program\",\n \"Project\",\n \"PropertyAccessExpression\",\n \"PropertyDeclaration\",\n \"PropertySignature\",\n \"Signature\",\n \"SignatureDeclaration\",\n \"Snapshot\",\n \"SourceFile\",\n \"StringLiteral\",\n \"Symbol\",\n \"Type\",\n \"TypeAliasDeclaration\",\n \"TypeChecker\",\n \"TypeFlags\",\n \"TypeNode\",\n \"TypeNodeBase\",\n \"UnionTypeNode\",\n \"VariableDeclaration\",\n \"VariableDeclarationList\",\n \"WasmTransport\",\n ],\n },\n { from: \"package\" as const, package: \"@codemirror/autocomplete\", name: \"CompletionContext\" },\n ...lintToolReadonlyAllow,\n {\n from: \"package\" as const,\n package: \"react\",\n name: [\n \"ReactNode\",\n \"ButtonHTMLAttributes\",\n \"ChangeEvent\",\n \"ClassAttributes\",\n \"FocusEvent\",\n \"KeyboardEvent\",\n \"SubmitEvent\",\n ],\n },\n { from: \"package\" as const, package: \"clsx\", name: \"ClassValue\" },\n {\n from: \"package\" as const,\n package: \"@anthropic-ai/claude-agent-sdk\",\n name: [\"SDKMessage\", \"SDKResultMessage\"],\n },\n {\n from: \"package\" as const,\n package: \"@types/dom-speech-recognition\",\n name: [\"SpeechRecognition\", \"SpeechRecognitionEvent\", \"SpeechRecognitionResult\"],\n },\n { from: \"package\" as const, package: \"@modelcontextprotocol/server\", name: \"McpServer\" },\n {\n from: \"package\" as const,\n package: \"@modelcontextprotocol/client\",\n name: [\"CallToolResult\", \"Client\", \"ContentBlock\"],\n },\n { from: \"package\" as const, package: \"discord.js\", name: [\"Client\", \"Guild\"] },\n {\n from: \"package\" as const,\n package: \"@discordjs/voice\",\n name: [\"AudioPlayer\", \"VoiceConnection\"],\n },\n { from: \"package\" as const, package: \"mdast\", name: [\"Root\", \"RootContent\", \"Yaml\"] },\n { from: \"package\" as const, package: \"@types/mdast\", name: [\"Code\", \"Nodes\"] },\n { from: \"package\" as const, package: \"@types/hast\", name: [\"Element\", \"RootContent\"] },\n { from: \"package\" as const, package: \"ical.js\", name: \"Component\" },\n {\n from: \"package\" as const,\n package: \"@jupyterlab/nbformat\",\n name: [\n \"ICell\",\n \"IDisplayData\",\n \"IExecuteResult\",\n \"INotebookContent\",\n \"IOutput\",\n \"MultilineString\",\n ],\n },\n { from: \"package\" as const, package: \"unpdf\", name: \"PDFDocumentProxy\" },\n { from: \"package\" as const, package: \"@kenjiuno/msgreader\", name: \"FieldsData\" },\n {\n from: \"package\" as const,\n package: \"parse5\",\n name: [\n \"Document\",\n \"DocumentFragment\",\n \"DocumentType\",\n \"Element\",\n \"Template\",\n \"CommentNode\",\n \"TextNode\",\n ],\n },\n { from: \"package\" as const, package: \"postal-mime\", name: [\"Address\", \"Email\"] },\n { from: \"package\" as const, package: \"fflate\", name: [\"Unzipped\"] },\n {\n from: \"package\" as const,\n package: \"@openrouter/sdk\",\n name: [\"DecisionsChoiceAnswer\", \"DecisionsNoulAnswer\", \"DecisionsScoreAnswer\", \"Unknown\"],\n },\n { from: \"package\" as const, package: \"recharts\", name: \"TooltipPayloadEntry\" },\n { from: \"package\" as const, package: \"vfile\", name: \"VFile\" },\n { from: \"package\" as const, package: \"modern-tar\", name: \"ParsedTarEntry\" },\n { from: \"package\" as const, package: \"@zip.js/zip.js\", name: [\"Entry\", \"FileEntry\"] },\n {\n from: \"package\" as const,\n package: \"three\",\n name: [\n \"LoadingManager\",\n \"Object3D\",\n \"WebGLRenderer\",\n \"PerspectiveCamera\",\n \"Scene\",\n \"Sphere\",\n \"BufferAttribute\",\n \"Material\",\n \"Mesh\",\n ],\n },\n {\n from: \"package\" as const,\n package: \"@huggingface/transformers\",\n name: [\"RawImage\", \"PretrainedConfig\", \"PreTrainedModel\", \"Processor\"],\n },\n {\n from: \"package\" as const,\n package: \"effect\",\n name: [\n \"Atom\",\n \"Cause\",\n \"Context\",\n \"Deferred\",\n \"Duration\",\n \"Effect\",\n \"Exit\",\n \"Fiber\",\n \"HashMap\",\n \"HashSet\",\n \"HttpClient\",\n \"HttpClientRequest\",\n \"HttpClientResponse\",\n \"HttpServerRequest\",\n \"HttpServerResponse\",\n \"Json\",\n \"JsonArray\",\n \"JsonObject\",\n \"Layer\",\n \"Logger\",\n \"NativeSpan\",\n \"Option\",\n \"Redacted\",\n \"Ref\",\n \"Stream\",\n \"Utc\",\n \"Writable\",\n ],\n },\n];\n\nexport { readonlyParameterAllow };\n","import { fileURLToPath } from \"node:url\";\n\nimport tanstackQuery from \"@r_masseater/oxlint-typed-rules/tanstack-query\";\nimport tanstackRouter from \"@r_masseater/oxlint-typed-rules/tanstack-router\";\nimport { plugin as shadcn } from \"@shadcn/lint\";\nimport baselineJs from \"eslint-plugin-baseline-js\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport decisionPlugin from \"./decision-rules.ts\";\nimport { alchemyOverride, scriptsOverride } from \"./lint-overrides.config.ts\";\nimport {\n COMMENT_DIRECTIVES,\n allRulesOf,\n decisionPluginName,\n generated,\n pluginRules,\n restrictedImports,\n shadcnRestyleContracts,\n} from \"./lint.config.ts\";\nimport { readonlyParameterAllow } from \"./readonly-types.config.ts\";\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\n\nconst resolved = (specifier: string): string => fileURLToPath(import.meta.resolve(specifier));\n\nconst DECISION_TIMEOUT_MS = 50_000;\n\nconst typedRules = \"@r_masseater/oxlint-typed-rules\";\n\nconst jsPlugins = [\n { name: \"vite-plus\", specifier: resolved(\"vite-plus/oxlint-plugin\") },\n { name: \"tanstack-query\", specifier: resolved(`${typedRules}/tanstack-query`) },\n { name: \"tanstack-router\", specifier: resolved(`${typedRules}/tanstack-router`) },\n { name: \"tanstack-start\", specifier: resolved(`${typedRules}/tanstack-start`) },\n { name: \"drizzle\", specifier: resolved(`${typedRules}/drizzle`) },\n { name: \"react-hooks-js\", specifier: resolved(\"eslint-plugin-react-hooks\") },\n { name: \"@eslint-react\", specifier: resolved(`${typedRules}/react`) },\n { name: \"shadcn\", specifier: resolved(\"@shadcn/lint\") },\n { name: \"no-comments\", specifier: resolved(\"eslint-plugin-no-comments\") },\n { name: \"baseline-js\", specifier: resolved(\"eslint-plugin-baseline-js\") },\n { name: \"@html-eslint/react\", specifier: resolved(\"@html-eslint/eslint-plugin-react\") },\n { name: \"eslint-js\", specifier: resolved(\"oxlint-plugin-eslint\") },\n { name: decisionPluginName, specifier: resolved(\"@r_masseater/msch/decision-rules\") },\n];\n\nconst rules = {\n \"vite-plus/prefer-vite-plus-imports\": \"error\",\n \"tanstack-start/no-async-client-component\": \"error\",\n \"tanstack-start/no-client-code-in-server-component\": \"error\",\n \"no-comments/disallowComments\": [\"error\", { allow: COMMENT_DIRECTIVES }],\n ...allRulesOf({ prefix: \"tanstack-query\", rules: tanstackQuery.rules }),\n ...allRulesOf({ prefix: \"tanstack-router\", rules: tanstackRouter.rules }),\n \"drizzle/enforce-delete-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n \"drizzle/enforce-update-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n ...allRulesOf({ prefix: \"shadcn\", rules: shadcn.rules }),\n \"shadcn/no-restyle\": [\"error\", { contracts: shadcnRestyleContracts }],\n ...allRulesOf({ prefix: \"baseline-js\", rules: baselineJs.rules }),\n ...baselineJs.configs.recommended().rules,\n \"baseline-js/use-baseline\": [\n \"error\",\n {\n available: \"widely\",\n includeWebApis: { preset: \"auto\" },\n includeJsBuiltins: { preset: \"auto\" },\n },\n ],\n ...pluginRules,\n \"eslint/sort-imports\": \"off\",\n \"eslint/sort-keys\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"react/react-in-jsx-scope\": \"off\",\n \"eslint/no-undef\": \"off\",\n \"typescript/promise-function-async\": \"off\",\n \"react/forbid-component-props\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"node/no-top-level-await\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"eslint/new-cap\": [\"error\", { capIsNew: false }],\n \"eslint/one-var\": [\"error\", \"never\"],\n \"eslint/id-length\": [\"error\", { exceptions: [\"x\", \"y\"] }],\n \"jsdoc/check-tag-names\": [\"error\", { definedTags: [\"msch\"] }],\n \"eslint/no-restricted-imports\": [\"error\", restrictedImports],\n \"typescript/prefer-readonly-parameter-types\": [\n \"error\",\n { ignoreInferredTypes: true, allow: readonlyParameterAllow },\n ],\n \"eslint/no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"react/function-component-definition\": [\n \"error\",\n { namedComponents: \"arrow-function\", unnamedComponents: \"arrow-function\" },\n ],\n \"typescript/no-empty-interface\": [\"error\", { allowSingleExtends: true }],\n \"typescript/no-empty-object-type\": [\"error\", { allowInterfaces: \"with-single-extends\" }],\n \"react/jsx-filename-extension\": [\"error\", { extensions: [\".tsx\"] }],\n \"react/only-export-components\": [\"error\", { allowExportNames: [\"Route\"] }],\n} satisfies LintConfig[\"rules\"];\n\nconst overrides = [\n alchemyOverride,\n {\n files: [\"**/*.config.ts\", \"**/alchemy.*.ts\", \"**/*.worker.ts\", \"**/decision-rules.ts\"],\n rules: { \"import/no-default-export\": \"off\" },\n },\n scriptsOverride,\n {\n files: [\"**/vite.config.ts\"],\n rules: {\n \"eslint/max-lines\": \"off\",\n \"eslint/max-lines-per-function\": \"off\",\n \"baseline-js/use-baseline\": \"off\",\n },\n },\n] satisfies LintConfig[\"overrides\"];\n\nconst lint = {\n ignorePatterns: generated,\n plugins: [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"react\",\n \"react-perf\",\n \"jsx-a11y\",\n \"jsdoc\",\n \"promise\",\n \"node\",\n \"effecttsgo\",\n ],\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n restriction: \"error\",\n nursery: \"error\",\n },\n jsPlugins,\n rules,\n overrides,\n settings: {\n [decisionPlugin.meta.name]: {\n model: \"cloudflare/@cf/qwen/qwen3.8-27b\",\n timeoutMs: DECISION_TIMEOUT_MS,\n ci: \"skip\",\n },\n },\n options: {\n typeAware: true,\n typeCheck: true,\n denyWarnings: true,\n reportUnusedDisableDirectives: \"error\",\n },\n} satisfies LintConfig;\n\nexport { lint };\n","const fsdRules = {\n \"fsd/insignificant-slice\": \"off\",\n \"fsd/no-cross-imports\": \"error\",\n \"fsd/no-higher-level-imports\": \"error\",\n \"fsd/no-wildcard-exports\": \"error\",\n} as const;\n\nexport { fsdRules };\n"],"mappings":";;;;;;;;;;;;;AAAA,MAAM,kBAGF;CACF,OAAO,CAAC,mBAAmB;CAC3B,OAAO,EACL,kCAAkC;EAChC;EACA;GACE,UAAU;GACV,SAAS;EACX;EACA;GACE,UACE;GACF,SACE;EACJ;EACA;GACE,UACE;GACF,SACE;EACJ;CACF,EACF;AACF;AAEA,MAAM,kBAGF;CACF,OAAO,CAAC,YAAY;CACpB,OAAO;EACL,uBAAuB;EACvB,gBAAgB;EAChB,kCAAkC;CACpC;AACF;;AC9BA,MAAM,oBAAuC;CAC3C;CACA;CACA;CACA;AACF;AACA,MAAM,mBAAmB;AACzB,MAAM,WAAW;AAEjB,MAAM,kBAAkB;AACxB,MAAM,iBAAiB;AAEvB,MAAM,gBAA6D;EAChE,WAAW;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8CAA8C;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4CAA4C;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yBAAyB;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,qCAAqC;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,gCAAgC;EAC9B;EACA;EACA;EACA;EACA;EACA;CACF;EACC,kBAAkB;EAAC;EAAoB;EAAY;CAAU;EAC7D,iBAAiB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;AAEA,MAAM,uBAAuBA,MAAI,QAAQC,OAAI,UAAU,aAAa,IAAI,CAAC,SAAS,aAChF,KACE,SACAD,MAAI,KAAK,YAAY;CAAE;CAAS;AAAO,EAAE,CAC3C,CACF;AAEA,MAAM,qBAA6EA,MAAI,IACrF,KACE,sBACAA,MAAI,QAAQ,EAAE,aAAa,CAACE,OAAI,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,CACvD,IACC,EAAE,SAAS,cAAc;CAAE,MAAM;CAAQ;AAAQ,EACpD;AAEA,MAAM,wBACJ,KACE,sBACAF,MAAI,KAAK,EAAE,SAAS,aAAa;CAC/B,IAAIE,OAAI,SAAS,GAAG,CAAC,CAAC,MAAM,GAC1B,OAAO;EAAE,OAAO,CAAC,QAAQ,GAAG,OAAO,IAAI;EAAG;CAAQ;CAEpD,OAAO;EAAE,OAAO,C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AO;IAAC;IAAkB;IAAmB;IAAkB;GAAsB;GACrF,OAAO,EAAE,4BAA4B,MAAM;EAC7C;EACA;EACA;GACE,OAAO,CAAC,mBAAmB;GAC3B,OAAO;IACL,oBAAoB;IACpB,iCAAiC;IACjC,4BAA4B;GAC9B;EACF;CA8BQ;CACR,UAAU,GACPC,uBAAe,KAAK,OAAO;EAC1B,OAAO;EACP,WAAW;EACX,IAAI;CACN,EACF;CACA,SAAS;EACP,WAAW;EACX,WAAW;EACX,cAAc;EACd,+BAA+B;CACjC;AACF;;AC5JA,MAAM,WAAW;CACf,2BAA2B;CAC3B,wBAAwB;CACxB,+BAA+B;CAC/B,2BAA2B;AAC7B"}
|
|
1
|
+
{"version":3,"file":"lint.mjs","names":["Arr","Rec","Str","effectPresets","decisionPlugin","shadcn","decisionPlugin"],"sources":["../src/features/lint-preset/config/lint-overrides.config.ts","../src/features/lint-preset/config/lint.config.ts","../src/features/lint-preset/config/readonly-binary.config.ts","../src/features/lint-preset/config/readonly-browser.config.ts","../src/features/lint-preset/config/readonly-lint-tools.config.ts","../src/features/lint-preset/config/readonly-types.config.ts","../src/features/lint-preset/config/preset.ts","../src/features/lint-preset/config/fsd-rules.ts"],"sourcesContent":["export const alchemyOverride: {\n files: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/alchemy.run.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n {\n selector: 'CallExpression[callee.name=\"Stack\"]:not([arguments.0.name=\"APP_NAME\"])',\n message: \"スタック名には app-name.ts の APP_NAME を渡す\",\n },\n {\n selector:\n 'Program:not(:has(YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n {\n selector:\n 'CallExpression[callee.name=\"Stack\"] > .arguments:nth-child(3):not(:has(FunctionExpression > BlockStatement > ExpressionStatement:nth-last-child(2) > YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n ],\n },\n};\n\nexport const scriptsOverride: {\n files: string[];\n rules: Readonly<Record<string, \"off\">>;\n} = {\n files: [\"scripts/**\"],\n rules: {\n \"node/no-process-env\": \"off\",\n \"node/no-sync\": \"off\",\n \"effecttsgo/node-builtin-import\": \"off\",\n },\n};\n","import { presets as effectPresets } from \"@effect/tsgo/oxlint-presets\";\nimport htmlReact from \"@html-eslint/eslint-plugin-react\";\nimport eslintReact from \"@r_masseater/oxlint-typed-rules/react\";\nimport { Array as Arr, Record as Rec, String as Str, Struct, pipe } from \"effect\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\n\nimport decisionPlugin from \"./decision-rules.ts\";\n\nconst REACT_STATE_HOOKS: readonly string[] = [\n \"useState\",\n \"useReducer\",\n \"createContext\",\n \"useContext\",\n];\nconst HAND_WRITTEN_SQL = \"SQL を手書きせず Drizzle のクエリビルダーを使う\";\nconst UI_STATE = \"UI 状態は effect-atom だけで扱う\";\n\nexport const INSTRUMENTATION = \"計装は Effect のトレーシングだけで扱う\";\nexport const INFRASTRUCTURE =\n \"インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない\";\n\nexport const requiredStack: Readonly<Record<string, readonly string[]>> = {\n [UI_STATE]: [\n \"zustand\",\n \"jotai\",\n \"valtio\",\n \"recoil\",\n \"mobx\",\n \"mobx-*\",\n \"redux\",\n \"@reduxjs/*\",\n \"react-redux\",\n \"xstate\",\n \"@xstate/*\",\n \"nanostores\",\n \"@nanostores/*\",\n \"@preact/signals*\",\n ],\n \"サーバー状態は TanStack Query と Eden だけで扱う\": [\n \"swr\",\n \"react-query\",\n \"@apollo/*\",\n \"urql\",\n \"@urql/*\",\n \"axios\",\n \"ky\",\n \"ofetch\",\n \"got\",\n \"node-fetch\",\n \"graphql-request\",\n \"@trpc/*\",\n ],\n \"ルーティングとサーバーは TanStack Start と Elysia だけで扱う\": [\n \"react-router\",\n \"react-router-dom\",\n \"next\",\n \"@remix-run/*\",\n \"wouter\",\n \"express\",\n \"hono\",\n \"fastify\",\n \"koa\",\n \"@nestjs/*\",\n ],\n \"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する\": [\n \"prisma\",\n \"@prisma/*\",\n \"typeorm\",\n \"sequelize\",\n \"kysely\",\n \"knex\",\n \"@mikro-orm/*\",\n \"better-sqlite3\",\n \"pg\",\n \"mysql2\",\n ],\n \"認証は better-auth だけで扱う\": [\n \"next-auth\",\n \"@auth/*\",\n \"lucia\",\n \"passport\",\n \"passport-*\",\n \"@clerk/*\",\n \"firebase/auth\",\n \"@supabase/*\",\n ],\n \"UI は shadcn/ui と Tailwind CSS だけで組む\": [\n \"@mui/*\",\n \"antd\",\n \"@chakra-ui/*\",\n \"@mantine/*\",\n \"styled-components\",\n \"@emotion/*\",\n \"bootstrap\",\n \"react-bootstrap\",\n ],\n \"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う\": [\n \"zod\",\n \"yup\",\n \"joi\",\n \"valibot\",\n \"arktype\",\n \"io-ts\",\n \"superstruct\",\n \"moment\",\n \"dayjs\",\n \"date-fns\",\n \"luxon\",\n \"winston\",\n \"pino\",\n \"bunyan\",\n \"loglevel\",\n \"lodash\",\n \"lodash-es\",\n \"ramda\",\n \"rxjs\",\n \"fp-ts\",\n \"neverthrow\",\n \"ts-results\",\n \"purify-ts\",\n ],\n \"フィーチャーフラグは OpenFeature だけで扱う\": [\n \"launchdarkly-*\",\n \"@launchdarkly/*\",\n \"@growthbook/*\",\n \"unleash-client\",\n \"flagsmith\",\n \"@vercel/flags\",\n ],\n [INSTRUMENTATION]: [\"@opentelemetry/*\", \"dd-trace\", \"newrelic\"],\n [INFRASTRUCTURE]: [\n \"wrangler\",\n \"miniflare\",\n \"@cloudflare/vite-plugin\",\n \"@vercel/*\",\n \"@netlify/*\",\n \"aws-cdk\",\n \"aws-cdk-lib\",\n \"@pulumi/*\",\n \"cdktf\",\n ],\n};\n\nconst requiredStackEntries = Arr.flatMap(Rec.toEntries(requiredStack), ([message, modules]) =>\n pipe(\n modules,\n Arr.map((module) => ({ message, module })),\n ),\n);\n\nconst requiredStackPaths: readonly Readonly<{ name: string; message: string }>[] = Arr.map(\n pipe(\n requiredStackEntries,\n Arr.filter(({ module }) => !Str.includes(\"*\")(module)),\n ),\n ({ message, module }) => ({ name: module, message }),\n);\n\nconst requiredStackPatterns: readonly Readonly<{ group: readonly string[]; message: string }>[] =\n pipe(\n requiredStackEntries,\n Arr.map(({ message, module }) => {\n if (Str.includes(\"*\")(module)) {\n return { group: [module, `${module}/**`], message };\n }\n return { group: [`${module}/**`], message };\n }),\n );\n\nexport const restrictedImports = {\n paths: [\n {\n name: \"react\",\n importNames: [...REACT_STATE_HOOKS],\n message: UI_STATE,\n },\n { name: \"drizzle-orm\", importNames: [\"sql\"], message: HAND_WRITTEN_SQL },\n { name: \"drizzle-orm/sql\", message: HAND_WRITTEN_SQL },\n ...requiredStackPaths,\n ],\n patterns: [...requiredStackPatterns],\n};\n\nexport const generated = [\n \"**/routeTree.gen.ts\",\n \"**/generated/**\",\n \"**/drizzle/**/snapshot.json\",\n \".claude/skills/**\",\n \".intent/**\",\n \"AGENTS.md\",\n \"skills-lock.json\",\n \".github/release-please/*manifest.json\",\n \"**/*.d.rpp.ts\",\n \"**/src-tauri/gen/**\",\n];\n\nconst asErrors = (names: readonly string[]): Readonly<Record<string, \"error\">> =>\n Rec.fromEntries(\n pipe(\n names,\n Arr.map((name) => [name, \"error\"] as const),\n ),\n );\n\nexport const allRulesOf = ({\n prefix,\n rules,\n}: Readonly<{ prefix: string; rules: Readonly<Record<string, unknown>> }>): Readonly<\n Record<string, \"error\">\n> =>\n asErrors(\n pipe(\n Rec.keys(rules),\n Arr.map((rule) => `${prefix}/${rule}`),\n ),\n );\n\nconst reactHooksRuleNames = pipe(\n Struct.keys(reactHooks.configs[\"recommended-latest\"].rules),\n Arr.map(Str.replace(\"react-hooks/\", \"react-hooks-js/\")),\n);\n\nconst reactHooksRules = asErrors(reactHooksRuleNames);\n\nconst eslintReactRuleNames = pipe(\n Rec.keys(eslintReact.configs[\"strict-typescript\"].rules ?? {}),\n Arr.filter(\n (name) => !(Str.replace(\"@eslint-react/\", \"react-hooks-js/\")(name) in reactHooksRules),\n ),\n);\n\nconst effectRuleNames = pipe(\n Rec.values(effectPresets),\n Arr.flatMap((preset) => Struct.keys(preset.rules ?? {})),\n);\n\nexport const pluginRules: Readonly<Record<string, \"error\">> = {\n ...asErrors(Rec.keys(htmlReact.configs.all.rules ?? {})),\n ...reactHooksRules,\n ...asErrors(eslintReactRuleNames),\n ...asErrors(effectRuleNames),\n};\n\nexport const decisionPluginName = decisionPlugin.meta.name;\n\nexport const decisionRules = allRulesOf({\n prefix: decisionPluginName,\n rules: decisionPlugin.rules,\n});\n\nexport const decisionTestRules = pipe(\n decisionRules,\n Rec.map(() => \"off\" as const),\n);\n\nexport const shadcnRestyleContracts = [\n { pattern: \"^Table(Head|Cell)$\", allow: [\"text-alignment\", \"fvn-spacing\"] },\n { pattern: \"^TableCaption$\", allow: [\"caption\", \"text-alignment\", \"mt-*\", \"mb-*\"] },\n];\n\nexport { COMMENT_DIRECTIVES } from \"#/shared/lib/comment-directives.ts\";\n","export const BINARY_DATA: readonly string[] = [\n \"ArrayBuffer\",\n \"DataView\",\n \"Float32Array\",\n \"Float64Array\",\n \"Int32Array\",\n \"Uint8Array\",\n \"Uint32Array\",\n];\n","export const WEBGPU_HANDLES: readonly string[] = [\n \"GPUDevice\",\n \"GPUCanvasContext\",\n \"GPUTexture\",\n \"GPUBuffer\",\n \"GPUBindGroup\",\n \"GPUBindGroupLayout\",\n \"GPUPipelineLayout\",\n \"GPURenderPipeline\",\n \"GPUSampler\",\n];\n\nexport const BROWSER_HANDLES: readonly string[] = [\n \"HTMLCanvasElement\",\n \"HTMLImageElement\",\n \"HTMLAnchorElement\",\n \"CanvasRenderingContext2D\",\n \"PointerEvent\",\n \"WheelEvent\",\n \"KeyboardEvent\",\n \"MouseEvent\",\n \"AbortSignal\",\n \"ImageBitmap\",\n ...WEBGPU_HANDLES,\n];\n","export const lintToolReadonlyAllow = [\n {\n from: \"package\" as const,\n package: \"@oxlint/plugins\",\n name: [\n \"Context\",\n \"ExportNamedDeclaration\",\n \"ExportSpecifier\",\n \"Statement\",\n \"Fixer\",\n \"Location\",\n \"Node\",\n \"Range\",\n \"Rule\",\n \"RuleMeta\",\n \"SourceCode\",\n \"VisitorWithHooks\",\n ],\n },\n {\n from: \"package\" as const,\n package: \"oxlint\",\n name: [\n \"DummyRule\",\n \"DummyRuleMap\",\n \"InvalidTestCase\",\n \"OxlintOverride\",\n \"Rule\",\n \"TestCases\",\n \"ValidTestCase\",\n ],\n },\n { from: \"package\" as const, package: \"@commitlint/types\", name: [\"QualifiedConfig\"] },\n {\n from: \"package\" as const,\n package: \"@textlint/config-loader\",\n name: [\"TextlintLoadPackagesFromRawConfigResult\"],\n },\n { from: \"package\" as const, package: \"markdownlint\", name: [\"LintError\"] },\n {\n from: \"package\" as const,\n package: \"steiger\",\n name: [\"ConfigObject\", \"GlobalIgnore\", \"Plugin\"],\n },\n {\n from: \"file\" as const,\n path: \"upstream/attw-core/lib/checkPackage.d.ts\",\n name: [\"CheckPackageOptions\"],\n },\n {\n from: \"package\" as const,\n package: \"@r_masseater/vite-plus-adopt\",\n name: [\"CheckPackageOptions\"],\n },\n {\n from: \"file\" as const,\n path: \"src/types.ts\",\n name: [\"CommitlintConfig\", \"MarkdownlintConfig\", \"TextlintConfig\", \"ToolSections\"],\n },\n {\n from: \"file\" as const,\n name: [\n \"BoundSymbol\",\n \"CompatSymbol\",\n \"CompatType\",\n \"FileBinding\",\n \"SymbolTable\",\n \"TypedContext\",\n ],\n },\n];\n","import { BINARY_DATA } from \"./readonly-binary.config.ts\";\nimport { BROWSER_HANDLES, WEBGPU_HANDLES } from \"./readonly-browser.config.ts\";\nimport { lintToolReadonlyAllow } from \"./readonly-lint-tools.config.ts\";\n\nexport const readonlyParameterAllow = [\n {\n from: \"lib\" as const,\n name: [\n \"HTMLElement\",\n \"HTMLDivElement\",\n \"Worker\",\n \"ReadableStream\",\n \"Request\",\n \"Response\",\n ...BINARY_DATA,\n \"RegExp\",\n \"RegExpExecArray\",\n \"RegExpMatchArray\",\n \"Date\",\n \"SpeechRecognitionResult\",\n \"CryptoKey\",\n ...BROWSER_HANDLES,\n ],\n },\n { from: \"package\" as const, package: \"@webgpu/types\", name: [...WEBGPU_HANDLES] },\n { from: \"package\" as const, package: \"@vscode/tree-sitter-wasm\", name: \"Language\" },\n { from: \"package\" as const, package: \"domhandler\", name: [\"AnyNode\", \"Text\", \"Element\"] },\n {\n from: \"package\" as const,\n package: \"@cloudflare/workers-types\",\n name: [\n \"AnalyticsEngineDataset\",\n \"Container\",\n \"DurableObjectState\",\n \"DurableObjectStorage\",\n \"CryptoKey\",\n \"KVNamespace\",\n \"R2Bucket\",\n \"SecretsStoreSecret\",\n \"TailEvent\",\n \"Onset\",\n \"Log\",\n \"Exception\",\n \"Attribute\",\n \"SpanUpdateInfo\",\n \"FetchResponseInfo\",\n \"Span\",\n ],\n },\n { from: \"package\" as const, package: \"@alchemy.run/cloudflare\", name: [\"Store\", \"WorkerProps\"] },\n {\n from: \"package\" as const,\n package: \"@bufbuild/protobuf\",\n name: [\"DescMessage\", \"JsonObject\", \"JsonValue\", \"Message\"],\n },\n { from: \"package\" as const, package: \"lighthouse\", name: [\"FlowResult\", \"Step\", \"UserFlow\"] },\n { from: \"package\" as const, package: \"vitest\", name: \"TestProject\" },\n {\n from: \"package\" as const,\n package: \"puppeteer-core\",\n name: [\"Browser\", \"ElementHandle\", \"Page\"],\n },\n { from: \"package\" as const, package: \"miniflare\", name: \"Miniflare\" },\n { from: \"package\" as const, package: \"elysia\", name: \"ElysiaConfig\" },\n { from: \"package\" as const, package: \"@types/node\", name: [\"Request\", \"Response\"] },\n { from: \"package\" as const, package: \"@better-auth/drizzle-adapter\", name: \"DB\" },\n { from: \"package\" as const, package: \"@tanstack/query-core\", name: \"QueryClient\" },\n {\n from: \"package\" as const,\n package: \"@codemirror/view\",\n name: [\"Decoration\", \"EditorView\", \"GutterMarker\", \"ViewUpdate\", \"WidgetType\"],\n },\n {\n from: \"package\" as const,\n package: \"@codemirror/state\",\n name: [\"ChangeDesc\", \"EditorState\", \"Extension\", \"StateEffect\", \"Text\", \"Transaction\"],\n },\n { from: \"package\" as const, package: \"@codemirror/lint\", name: \"Diagnostic\" },\n { from: \"package\" as const, package: \"comlink\", name: \"Remote\" },\n {\n from: \"package\" as const,\n package: \"typescript\",\n name: [\n \"API\",\n \"ArrayLiteralExpression\",\n \"BinaryExpression\",\n \"BindingElement\",\n \"CallExpression\",\n \"Checker\",\n \"ClassDeclaration\",\n \"CompilerHost\",\n \"CompilerOptions\",\n \"CompletionEntry\",\n \"ConfigFileResponse\",\n \"Declaration\",\n \"DeclarationBase\",\n \"DiagnosticResponse\",\n \"ElementAccessExpression\",\n \"EnumDeclaration\",\n \"ExportAssignment\",\n \"ExportDeclaration\",\n \"ExportSpecifier\",\n \"Expression\",\n \"ExpressionBase\",\n \"InterfaceDeclaration\",\n \"JSDocCallbackTag\",\n \"JSDocTagBase\",\n \"JSDocTypedefTag\",\n \"ModuleDeclaration\",\n \"Node\",\n \"NodeHandle\",\n \"NumericLiteral\",\n \"ParameterDeclaration\",\n \"ParseConfigFileHost\",\n \"ParsedCommandLine\",\n \"Program\",\n \"Project\",\n \"PropertyAccessExpression\",\n \"PropertyDeclaration\",\n \"PropertySignature\",\n \"Signature\",\n \"SignatureDeclaration\",\n \"Snapshot\",\n \"SourceFile\",\n \"StringLiteral\",\n \"Symbol\",\n \"Type\",\n \"TypeAliasDeclaration\",\n \"TypeChecker\",\n \"TypeFlags\",\n \"TypeNode\",\n \"TypeNodeBase\",\n \"UnionTypeNode\",\n \"VariableDeclaration\",\n \"VariableDeclarationList\",\n \"WasmTransport\",\n ],\n },\n { from: \"package\" as const, package: \"@codemirror/autocomplete\", name: \"CompletionContext\" },\n ...lintToolReadonlyAllow,\n {\n from: \"package\" as const,\n package: \"react\",\n name: [\n \"ReactNode\",\n \"ButtonHTMLAttributes\",\n \"ChangeEvent\",\n \"ClassAttributes\",\n \"FocusEvent\",\n \"KeyboardEvent\",\n \"SubmitEvent\",\n ],\n },\n { from: \"package\" as const, package: \"clsx\", name: \"ClassValue\" },\n {\n from: \"package\" as const,\n package: \"@anthropic-ai/claude-agent-sdk\",\n name: [\"SDKMessage\", \"SDKResultMessage\"],\n },\n {\n from: \"package\" as const,\n package: \"@types/dom-speech-recognition\",\n name: [\"SpeechRecognition\", \"SpeechRecognitionEvent\", \"SpeechRecognitionResult\"],\n },\n { from: \"package\" as const, package: \"@modelcontextprotocol/server\", name: \"McpServer\" },\n {\n from: \"package\" as const,\n package: \"@modelcontextprotocol/client\",\n name: [\"CallToolResult\", \"Client\", \"ContentBlock\"],\n },\n { from: \"package\" as const, package: \"discord.js\", name: [\"Client\", \"Guild\"] },\n {\n from: \"package\" as const,\n package: \"@discordjs/voice\",\n name: [\"AudioPlayer\", \"VoiceConnection\"],\n },\n { from: \"package\" as const, package: \"mdast\", name: [\"Root\", \"RootContent\", \"Yaml\"] },\n { from: \"package\" as const, package: \"@types/mdast\", name: [\"Code\", \"Nodes\"] },\n { from: \"package\" as const, package: \"@types/hast\", name: [\"Element\", \"RootContent\"] },\n { from: \"package\" as const, package: \"ical.js\", name: \"Component\" },\n {\n from: \"package\" as const,\n package: \"@jupyterlab/nbformat\",\n name: [\n \"ICell\",\n \"IDisplayData\",\n \"IExecuteResult\",\n \"INotebookContent\",\n \"IOutput\",\n \"MultilineString\",\n ],\n },\n { from: \"package\" as const, package: \"unpdf\", name: \"PDFDocumentProxy\" },\n { from: \"package\" as const, package: \"@kenjiuno/msgreader\", name: \"FieldsData\" },\n {\n from: \"package\" as const,\n package: \"parse5\",\n name: [\n \"Document\",\n \"DocumentFragment\",\n \"DocumentType\",\n \"Element\",\n \"Template\",\n \"CommentNode\",\n \"TextNode\",\n ],\n },\n { from: \"package\" as const, package: \"postal-mime\", name: [\"Address\", \"Email\"] },\n { from: \"package\" as const, package: \"fflate\", name: [\"Unzipped\"] },\n {\n from: \"package\" as const,\n package: \"@openrouter/sdk\",\n name: [\"DecisionsChoiceAnswer\", \"DecisionsNoulAnswer\", \"DecisionsScoreAnswer\", \"Unknown\"],\n },\n { from: \"package\" as const, package: \"recharts\", name: \"TooltipPayloadEntry\" },\n { from: \"package\" as const, package: \"vfile\", name: \"VFile\" },\n { from: \"package\" as const, package: \"modern-tar\", name: \"ParsedTarEntry\" },\n { from: \"package\" as const, package: \"@zip.js/zip.js\", name: [\"Entry\", \"FileEntry\"] },\n {\n from: \"package\" as const,\n package: \"three\",\n name: [\n \"LoadingManager\",\n \"Object3D\",\n \"WebGLRenderer\",\n \"PerspectiveCamera\",\n \"Scene\",\n \"Sphere\",\n \"BufferAttribute\",\n \"Material\",\n \"Mesh\",\n ],\n },\n {\n from: \"package\" as const,\n package: \"@huggingface/transformers\",\n name: [\"RawImage\", \"PretrainedConfig\", \"PreTrainedModel\", \"Processor\"],\n },\n {\n from: \"package\" as const,\n package: \"effect\",\n name: [\n \"Atom\",\n \"Cause\",\n \"Context\",\n \"Deferred\",\n \"Duration\",\n \"Effect\",\n \"Exit\",\n \"Fiber\",\n \"HashMap\",\n \"HashSet\",\n \"HttpClient\",\n \"HttpClientRequest\",\n \"HttpClientResponse\",\n \"HttpServerRequest\",\n \"HttpServerResponse\",\n \"Json\",\n \"JsonArray\",\n \"JsonObject\",\n \"Layer\",\n \"Logger\",\n \"NativeSpan\",\n \"Option\",\n \"Redacted\",\n \"Ref\",\n \"Stream\",\n \"Utc\",\n \"Writable\",\n ],\n },\n];\n","import { fileURLToPath } from \"node:url\";\n\nimport tanstackQuery from \"@r_masseater/oxlint-typed-rules/tanstack-query\";\nimport tanstackRouter from \"@r_masseater/oxlint-typed-rules/tanstack-router\";\nimport { plugin as shadcn } from \"@shadcn/lint\";\nimport baselineJs from \"eslint-plugin-baseline-js\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport decisionPlugin from \"./decision-rules.ts\";\nimport { alchemyOverride, scriptsOverride } from \"./lint-overrides.config.ts\";\nimport {\n COMMENT_DIRECTIVES,\n allRulesOf,\n decisionPluginName,\n generated,\n pluginRules,\n restrictedImports,\n shadcnRestyleContracts,\n} from \"./lint.config.ts\";\nimport { readonlyParameterAllow } from \"./readonly-types.config.ts\";\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\n\nconst resolved = (specifier: string): string => fileURLToPath(import.meta.resolve(specifier));\n\nconst DECISION_TIMEOUT_MS = 50_000;\n\nconst typedRules = \"@r_masseater/oxlint-typed-rules\";\n\nconst jsPlugins = [\n { name: \"vite-plus\", specifier: resolved(\"vite-plus/oxlint-plugin\") },\n { name: \"tanstack-query\", specifier: resolved(`${typedRules}/tanstack-query`) },\n { name: \"tanstack-router\", specifier: resolved(`${typedRules}/tanstack-router`) },\n { name: \"tanstack-start\", specifier: resolved(`${typedRules}/tanstack-start`) },\n { name: \"drizzle\", specifier: resolved(`${typedRules}/drizzle`) },\n { name: \"react-hooks-js\", specifier: resolved(\"eslint-plugin-react-hooks\") },\n { name: \"@eslint-react\", specifier: resolved(`${typedRules}/react`) },\n { name: \"shadcn\", specifier: resolved(\"@shadcn/lint\") },\n { name: \"no-comments\", specifier: resolved(\"eslint-plugin-no-comments\") },\n { name: \"baseline-js\", specifier: resolved(\"eslint-plugin-baseline-js\") },\n { name: \"@html-eslint/react\", specifier: resolved(\"@html-eslint/eslint-plugin-react\") },\n { name: \"eslint-js\", specifier: resolved(\"oxlint-plugin-eslint\") },\n { name: decisionPluginName, specifier: resolved(\"@r_masseater/msch/decision-rules\") },\n { name: \"msch-lint\", specifier: resolved(\"@r_masseater/msch/inline-exports\") },\n];\n\nconst rules = {\n \"vite-plus/prefer-vite-plus-imports\": \"error\",\n \"tanstack-start/no-async-client-component\": \"error\",\n \"tanstack-start/no-client-code-in-server-component\": \"error\",\n \"no-comments/disallowComments\": [\"error\", { allow: COMMENT_DIRECTIVES }],\n ...allRulesOf({ prefix: \"tanstack-query\", rules: tanstackQuery.rules }),\n ...allRulesOf({ prefix: \"tanstack-router\", rules: tanstackRouter.rules }),\n \"drizzle/enforce-delete-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n \"drizzle/enforce-update-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n ...allRulesOf({ prefix: \"shadcn\", rules: shadcn.rules }),\n \"shadcn/no-restyle\": [\"error\", { contracts: shadcnRestyleContracts }],\n ...allRulesOf({ prefix: \"baseline-js\", rules: baselineJs.rules }),\n ...baselineJs.configs.recommended().rules,\n \"baseline-js/use-baseline\": [\n \"error\",\n {\n available: \"widely\",\n includeWebApis: { preset: \"auto\" },\n includeJsBuiltins: { preset: \"auto\" },\n },\n ],\n ...pluginRules,\n \"eslint/sort-imports\": \"off\",\n \"eslint/sort-keys\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/exports-last\": \"off\",\n \"msch-lint/inline-exports\": \"error\",\n \"react/react-in-jsx-scope\": \"off\",\n \"eslint/no-undef\": \"off\",\n \"typescript/promise-function-async\": \"off\",\n \"react/forbid-component-props\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"node/no-top-level-await\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"eslint/new-cap\": [\"error\", { capIsNew: false }],\n \"eslint/one-var\": [\"error\", \"never\"],\n \"eslint/id-length\": [\"error\", { exceptions: [\"x\", \"y\"] }],\n \"jsdoc/check-tag-names\": [\"error\", { definedTags: [\"msch\"] }],\n \"jsdoc/require-param\": [\"error\", { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\"] }],\n \"jsdoc/require-returns\": [\"error\", { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\"] }],\n \"eslint/no-restricted-imports\": [\"error\", restrictedImports],\n \"typescript/prefer-readonly-parameter-types\": [\n \"error\",\n { ignoreInferredTypes: true, allow: readonlyParameterAllow },\n ],\n \"eslint/no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"react/function-component-definition\": [\n \"error\",\n { namedComponents: \"arrow-function\", unnamedComponents: \"arrow-function\" },\n ],\n \"typescript/no-empty-interface\": [\"error\", { allowSingleExtends: true }],\n \"typescript/no-empty-object-type\": [\"error\", { allowInterfaces: \"with-single-extends\" }],\n \"react/jsx-filename-extension\": [\"error\", { extensions: [\".tsx\"] }],\n \"react/only-export-components\": [\"error\", { allowExportNames: [\"Route\"] }],\n} satisfies LintConfig[\"rules\"];\n\nconst overrides = [\n alchemyOverride,\n {\n files: [\"**/*.config.ts\", \"**/alchemy.*.ts\", \"**/*.worker.ts\", \"**/decision-rules.ts\"],\n rules: { \"import/no-default-export\": \"off\" },\n },\n scriptsOverride,\n {\n files: [\"**/vite.config.ts\"],\n rules: {\n \"eslint/max-lines\": \"off\",\n \"eslint/max-lines-per-function\": \"off\",\n \"baseline-js/use-baseline\": \"off\",\n },\n },\n] satisfies LintConfig[\"overrides\"];\n\nexport const lint = {\n ignorePatterns: generated,\n plugins: [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"react\",\n \"react-perf\",\n \"jsx-a11y\",\n \"jsdoc\",\n \"promise\",\n \"node\",\n \"effecttsgo\",\n ],\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n restriction: \"error\",\n nursery: \"error\",\n },\n jsPlugins,\n rules,\n overrides,\n settings: {\n [decisionPlugin.meta.name]: {\n model: \"cloudflare/@cf/qwen/qwen3.8-27b\",\n timeoutMs: DECISION_TIMEOUT_MS,\n ci: \"skip\",\n },\n },\n options: {\n typeAware: true,\n typeCheck: true,\n denyWarnings: true,\n reportUnusedDisableDirectives: \"error\",\n },\n} satisfies LintConfig;\n","export const fsdRules = {\n \"fsd/insignificant-slice\": \"off\",\n \"fsd/no-cross-imports\": \"error\",\n \"fsd/no-higher-level-imports\": \"error\",\n \"fsd/no-wildcard-exports\": \"error\",\n} as const;\n"],"mappings":";;;;;;;;;;;;;AAAA,MAAa,kBAGT;CACF,OAAO,CAAC,mBAAmB;CAC3B,OAAO,EACL,kCAAkC;EAChC;EACA;GACE,UAAU;GACV,SAAS;EACX;EACA;GACE,UACE;GACF,SACE;EACJ;EACA;GACE,UACE;GACF,SACE;EACJ;CACF,EACF;AACF;AAEA,MAAa,kBAGT;CACF,OAAO,CAAC,YAAY;CACpB,OAAO;EACL,uBAAuB;EACvB,gBAAgB;EAChB,kCAAkC;CACpC;AACF;;AC9BA,MAAM,oBAAuC;CAC3C;CACA;CACA;CACA;AACF;AACA,MAAM,mBAAmB;AACzB,MAAM,WAAW;AAEjB,MAAa,kBAAkB;AAC/B,MAAa,iBACX;AAEF,MAAa,gBAA6D;EACvE,WAAW;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8CAA8C;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4CAA4C;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yBAAyB;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,qCAAqC;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,gCAAgC;EAC9B;EACA;EACA;EACA;EACA;EACA;CACF;EACC,kBAAkB;EAAC;EAAoB;EAAY;CAAU;EAC7D,iBA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+BAA+B;CAC/B,2BAA2B;AAC7B"}
|
package/dist/oxlint.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as JSON_FLAG, n as describeFinding, t as ProblemList } from "./problem-BeBSq75T.mjs";
|
|
2
2
|
import { Array, Option, Schema, pipe } from "effect";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { execFileSync } from "node:child_process";
|
|
5
|
-
// src/oxlint-rule.ts
|
|
5
|
+
// src/features/oxlint-plugin/model/oxlint-rule.ts
|
|
6
6
|
const diagnosticOf = (problem) => ({
|
|
7
7
|
message: describeFinding(problem),
|
|
8
8
|
loc: { start: {
|
|
@@ -18,7 +18,7 @@ const mschPlugin = (load) => ({
|
|
|
18
18
|
meta: { name: "msch" },
|
|
19
19
|
rules: { vocabulary: vocabularyRule(load) }
|
|
20
20
|
});
|
|
21
|
-
// src/oxlint.ts
|
|
21
|
+
// src/app/oxlint.ts
|
|
22
22
|
const CLI_PATH = fileURLToPath(import.meta.resolve("@r_masseater/msch/cli"));
|
|
23
23
|
const decodeProblems = Schema.decodeUnknownSync(Schema.fromJsonString(ProblemList));
|
|
24
24
|
const loaded = /* @__PURE__ */ new Map();
|
package/dist/oxlint.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.mjs","names":["Arr"],"sources":["../src/oxlint-rule.ts","../src/oxlint.ts"],"sourcesContent":["import { Array as Arr, pipe } from \"effect\";\nimport type { Diagnostic, Plugin, Rule } from \"vite-plus/lint/plugins\";\n\nimport { describeFinding } from \"
|
|
1
|
+
{"version":3,"file":"oxlint.mjs","names":["Arr"],"sources":["../src/features/oxlint-plugin/model/oxlint-rule.ts","../src/app/oxlint.ts"],"sourcesContent":["import { Array as Arr, pipe } from \"effect\";\nimport type { Diagnostic, Plugin, Rule } from \"vite-plus/lint/plugins\";\n\nimport { describeFinding } from \"#/shared/lib/problem.ts\";\nimport type { Problem } from \"#/shared/lib/problem.ts\";\nimport { POSITION_BASE } from \"#/shared/lib/syntax.ts\";\n\nexport type ProblemLoader = (cwd: string) => readonly Problem[];\n\nconst diagnosticOf = (problem: Problem): Diagnostic => ({\n message: describeFinding(problem),\n loc: { start: { line: problem.line, column: problem.column - POSITION_BASE } },\n});\n\nconst vocabularyRule = (load: ProblemLoader): Rule => ({\n create: (context) => ({\n Program: () => {\n const problems = pipe(\n load(context.cwd),\n Arr.filter((problem) => problem.file === context.filename),\n );\n for (const problem of problems) {\n context.report(diagnosticOf(problem));\n }\n },\n }),\n});\n\nexport const mschPlugin = (load: ProblemLoader): Plugin & { rules: { vocabulary: Rule } } => ({\n meta: { name: \"msch\" },\n rules: { vocabulary: vocabularyRule(load) },\n});\n","import { execFileSync } from \"node:child_process\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { Option, Schema } from \"effect\";\n\nimport { mschPlugin } from \"#/features/oxlint-plugin/index.ts\";\nimport { JSON_FLAG } from \"#/shared/lib/cli-contract.ts\";\nimport { ProblemList } from \"#/shared/lib/problem.ts\";\nimport type { Problem } from \"#/shared/lib/problem.ts\";\n\nconst CLI_PATH = fileURLToPath(import.meta.resolve(\"@r_masseater/msch/cli\"));\nconst decodeProblems = Schema.decodeUnknownSync(Schema.fromJsonString(ProblemList));\nconst loaded = new Map<string, readonly Problem[]>();\n\nconst runCli = (cwd: string): readonly Problem[] =>\n decodeProblems(\n execFileSync(process.execPath, [CLI_PATH, JSON_FLAG], {\n cwd,\n encoding: \"utf8\",\n maxBuffer: Number.MAX_SAFE_INTEGER,\n }),\n );\n\nconst loadProblems = (cwd: string): readonly Problem[] =>\n Option.fromUndefinedOr(loaded.get(cwd)).pipe(\n Option.getOrElse(() => {\n const problems = runCli(cwd);\n loaded.set(cwd, problems);\n return problems;\n }),\n );\n\nexport default mschPlugin(loadProblems);\n"],"mappings":";;;;;AASA,MAAM,gBAAgB,aAAkC;CACtD,SAAS,gBAAgB,OAAO;CAChC,KAAK,EAAE,OAAO;EAAE,MAAM,QAAQ;EAAM,QAAQ,QAAQ,SAAA;CAAuB,EAAE;AAC/E;AAEA,MAAM,kBAAkB,UAA+B,EACrD,SAAS,aAAa,EACpB,eAAe;CACb,MAAM,WAAW,KACf,KAAK,QAAQ,GAAG,GAChBA,MAAI,QAAQ,YAAY,QAAQ,SAAS,QAAQ,QAAQ,CAC3D;CACA,KAAK,MAAM,WAAW,UACpB,QAAQ,OAAO,aAAa,OAAO,CAAC;AAExC,EACF,GACF;AAEA,MAAa,cAAc,UAAmE;CAC5F,MAAM,EAAE,MAAM,OAAO;CACrB,OAAO,EAAE,YAAY,eAAe,IAAI,EAAE;AAC5C;;ACrBA,MAAM,WAAW,cAAc,YAAY,QAAQ,uBAAuB,CAAC;AAC3E,MAAM,iBAAiB,OAAO,kBAAkB,OAAO,eAAe,WAAW,CAAC;AAClF,MAAM,yBAAS,IAAI,IAAgC;AAEnD,MAAM,UAAU,QACd,eACE,aAAa,QAAQ,UAAU,CAAC,UAAU,SAAS,GAAG;CACpD;CACA,UAAU;CACV,WAAW,OAAO;AACpB,CAAC,CACH;AAEF,MAAM,gBAAgB,QACpB,OAAO,gBAAgB,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,KACtC,OAAO,gBAAgB;CACrB,MAAM,WAAW,OAAO,GAAG;CAC3B,OAAO,IAAI,KAAK,QAAQ;CACxB,OAAO;AACT,CAAC,CACH;AAEF,IAAA,iBAAe,WAAW,YAAY"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as NODE_MODULES } from "./repository-files-CfhXZQrO.mjs";
|
|
2
2
|
import { Array, Option, Order, Schema, String as String$1, pipe } from "effect";
|
|
3
3
|
import { InternalSymbolName, SyntaxKind, getJSDocTags, getLeadingCommentRanges, getNameOfDeclaration, getTextOfJSDocComment } from "typescript/ast";
|
|
4
4
|
import { isArrayLiteralExpression, isBinaryExpression, isCallExpression, isClassDeclaration, isElementAccessExpression, isEnumDeclaration, isExportDeclaration, isIdentifier, isImportDeclaration, isInterfaceDeclaration, isModuleBlock, isModuleDeclaration, isNewExpression, isNumericLiteral, isObjectLiteralExpression, isPropertyAccessExpression, isPropertyAssignment, isSatisfiesExpression, isSignatureDeclaration, isSourceFile, isSpreadElement, isStringLiteral, isTypeAliasDeclaration, isTypeLiteralNode, isTypeReferenceNode, isUnionTypeNode, isVariableDeclaration, isVariableDeclarationList, isVariableStatement } from "typescript/ast/is";
|
|
5
5
|
import { API, IndexKind } from "typescript/sync";
|
|
6
|
-
// src/
|
|
6
|
+
// src/shared/lib/cli-contract.ts
|
|
7
|
+
const JSON_FLAG = "--json";
|
|
8
|
+
// src/shared/lib/syntax.ts
|
|
7
9
|
const NODE_MODULES_SEGMENT = `/${NODE_MODULES}/`;
|
|
8
10
|
const uniqueByReference = (items) => Array.dedupeWith(items, (left, right) => left === right);
|
|
9
11
|
const childrenOf = (node) => {
|
|
@@ -53,7 +55,7 @@ const moduleSpecifierOf = (statement) => {
|
|
|
53
55
|
return Option.fromUndefinedOr(statement.moduleSpecifier).pipe(Option.filter((specifier) => isStringLiteral(specifier)), Option.map((specifier) => specifier.text));
|
|
54
56
|
};
|
|
55
57
|
const importedModulesOf = (sourceFile) => pipe(sourceFile.statements, Array.map((statement) => moduleSpecifierOf(statement)), Array.getSomes);
|
|
56
|
-
// src/problem.ts
|
|
58
|
+
// src/shared/lib/problem.ts
|
|
57
59
|
const RuleNameSchema = Schema.Literals([
|
|
58
60
|
"owner-annotation",
|
|
59
61
|
"duplicate-value-set",
|
|
@@ -67,6 +69,9 @@ const RuleNameSchema = Schema.Literals([
|
|
|
67
69
|
"hidden-unicode",
|
|
68
70
|
"python-file",
|
|
69
71
|
"python-command",
|
|
72
|
+
"unneeded-file",
|
|
73
|
+
"unneeded-setup",
|
|
74
|
+
"cargo-outside-pnpm",
|
|
70
75
|
"nested-docs",
|
|
71
76
|
"root-readme",
|
|
72
77
|
"stack-dependency",
|
|
@@ -74,6 +79,7 @@ const RuleNameSchema = Schema.Literals([
|
|
|
74
79
|
"unverified-crate",
|
|
75
80
|
"hidden-verify",
|
|
76
81
|
"root-workspace-path",
|
|
82
|
+
"shared-uncached-task",
|
|
77
83
|
"colocated-test",
|
|
78
84
|
"comment"
|
|
79
85
|
]);
|
|
@@ -109,8 +115,6 @@ const problemKey = (problem) => pipe([
|
|
|
109
115
|
const sortProblems = (problems) => Array.sort(Array.dedupeWith(problems, (left, right) => problemKey(left) === problemKey(right)), problemOrder);
|
|
110
116
|
const describeFinding = (problem) => `[${problem.rule}] ${problem.message}`;
|
|
111
117
|
const formatProblem = (relative) => (problem) => `${relative(problem.file)}:${String(problem.line)}:${String(problem.column)} ${describeFinding(problem)}`;
|
|
112
|
-
|
|
113
|
-
const JSON_FLAG = "--json";
|
|
114
|
-
export { isTypeAliasDeclaration as $, getTextOfJSDocComment as A, isInterfaceDeclaration as B, API as C, getJSDocTags as D, SyntaxKind as E, isElementAccessExpression as F, isObjectLiteralExpression as G, isModuleDeclaration as H, isEnumDeclaration as I, isSatisfiesExpression as J, isPropertyAccessExpression as K, isExportDeclaration as L, isBinaryExpression as M, isCallExpression as N, getLeadingCommentRanges as O, isClassDeclaration as P, isStringLiteral as Q, isIdentifier as R, uniqueByReference as S, InternalSymbolName as T, isNewExpression as U, isModuleBlock as V, isNumericLiteral as W, isSourceFile as X, isSignatureDeclaration as Y, isSpreadElement as Z, lineOf as _, problemAt as a, isVariableStatement as at, resolvedSymbol as b, childrenOf as c, declarationsOf as d, isTypeLiteralNode as et, descendantsOf as f, isTypeDeclaration as g, isGenericDeclaration as h, formatProblem as i, isVariableDeclarationList as it, isArrayLiteralExpression as j, getNameOfDeclaration as k, columnOf as l, isExternalDeclaration as m, ProblemList as n, isUnionTypeNode as nt, sortProblems as o, importedModulesOf as p, isPropertyAssignment as q, describeFinding as r, isVariableDeclaration as rt, NODE_MODULES_SEGMENT as s, JSON_FLAG as t, isTypeReferenceNode as tt, contains as u, propertyNamesOf as v, IndexKind as w, symbolAt as x, referencedSymbols as y, isImportDeclaration as z };
|
|
118
|
+
export { isTypeLiteralNode as $, isArrayLiteralExpression as A, isModuleBlock as B, IndexKind as C, getLeadingCommentRanges as D, getJSDocTags as E, isEnumDeclaration as F, isPropertyAccessExpression as G, isNewExpression as H, isExportDeclaration as I, isSignatureDeclaration as J, isPropertyAssignment as K, isIdentifier as L, isCallExpression as M, isClassDeclaration as N, getNameOfDeclaration as O, isElementAccessExpression as P, isTypeAliasDeclaration as Q, isImportDeclaration as R, API as S, SyntaxKind as T, isNumericLiteral as U, isModuleDeclaration as V, isObjectLiteralExpression as W, isSpreadElement as X, isSourceFile as Y, isStringLiteral as Z, propertyNamesOf as _, sortProblems as a, JSON_FLAG as at, symbolAt as b, columnOf as c, descendantsOf as d, isTypeReferenceNode as et, importedModulesOf as f, lineOf as g, isTypeDeclaration as h, problemAt as i, isVariableStatement as it, isBinaryExpression as j, getTextOfJSDocComment as k, contains as l, isGenericDeclaration as m, describeFinding as n, isVariableDeclaration as nt, NODE_MODULES_SEGMENT as o, isExternalDeclaration as p, isSatisfiesExpression as q, formatProblem as r, isVariableDeclarationList as rt, childrenOf as s, ProblemList as t, isUnionTypeNode as tt, declarationsOf as u, referencedSymbols as v, InternalSymbolName as w, uniqueByReference as x, resolvedSymbol as y, isInterfaceDeclaration as z };
|
|
115
119
|
|
|
116
|
-
//# sourceMappingURL=
|
|
120
|
+
//# sourceMappingURL=problem-BeBSq75T.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"problem-BeBSq75T.mjs","names":["Arr","Str","Arr"],"sources":["../src/shared/lib/cli-contract.ts","../src/shared/lib/syntax.ts","../src/shared/lib/problem.ts"],"sourcesContent":["export const JSON_FLAG = \"--json\";\n","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\nexport const 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\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 \"unneeded-file\",\n \"unneeded-setup\",\n \"cargo-outside-pnpm\",\n \"nested-docs\",\n \"root-readme\",\n \"stack-dependency\",\n \"install-size\",\n \"unverified-crate\",\n \"hidden-verify\",\n \"root-workspace-path\",\n \"shared-uncached-task\",\n \"colocated-test\",\n \"comment\",\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"],"mappings":";;;;;;AAAA,MAAa,YAAY;;AC0BzB,MAAa,uBAAuB,IAAI,aAAa;AAIrD,MAAa,qBAA2B,UACtCA,MAAI,WAAW,QAAQ,MAAM,UAAU,SAAS,KAAK;AAEvD,MAAa,cAAc,SAAgC;CACzD,MAAM,WAAmB,CAAC;CAC1B,KAAK,cAAc,UAAU;EAC3B,SAAS,KAAK,KAAK;CACrB,CAAC;CACD,OAAO;AACT;AAEA,MAAa,iBAAiB,SAC5B,KACE,WAAW,IAAI,GACfA,MAAI,SAAS,UAAUA,MAAI,QAAQ,cAAc,KAAK,GAAG,KAAK,CAAC,CACjE;AAEF,MAAM,kBACH,aACA,eACCC,SAAI,SAAS,oBAAoB,CAAC,CAAC,WAAW,QAAQ,KACtD,QAAQ,gCAAgC,UAAU;AAEtD,MAAa,yBACV,aACA,gBACC,eAAe,OAAO,CAAC,CAAC,YAAY,cAAc,CAAC;AAEvD,MAAM,8BAAuC,IAAI,IAAI;CACnD,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;CACX,WAAW;AACb,CAAC;AAED,MAAa,kBAAkB,WAC7B,KACE,OAAO,cACPD,MAAI,SAAS,WAAW,OAAO,QAAQ,OAAO,gBAAgB,OAAO,QAAQ,CAAC,CAAC,CA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/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"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Array, Context, Effect, FileSystem, Layer, Path, Stream, String, pipe } from "effect";
|
|
2
|
+
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
3
|
+
import { NodeChildProcessSpawner, NodeFileSystem, NodePath, NodeStdio } from "@effect/platform-node-shared";
|
|
4
|
+
// src/shared/lib/node-services.ts
|
|
5
|
+
/** @internal */
|
|
6
|
+
const nodeServicesLayer = Layer.provideMerge(NodeChildProcessSpawner.layer, Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeStdio.layer));
|
|
7
|
+
// src/shared/lib/repository-files.ts
|
|
8
|
+
const MISSING_SIZE = 0;
|
|
9
|
+
const GENERATED_PATHSPEC = ":(attr:linguist-generated)";
|
|
10
|
+
const LISTED_ARGS = [
|
|
11
|
+
"--cached",
|
|
12
|
+
"--others",
|
|
13
|
+
"--exclude-standard"
|
|
14
|
+
];
|
|
15
|
+
const NODE_MODULES = "node_modules";
|
|
16
|
+
var RepositoryFiles = class extends Context.Service()("@r_masseater/msch/shared/lib/repository-files/RepositoryFiles") {};
|
|
17
|
+
const nodeRepositoryFiles = Layer.effect(RepositoryFiles, Effect.gen(function* nodeRepositoryFiles() {
|
|
18
|
+
const fs = yield* FileSystem.FileSystem;
|
|
19
|
+
const path = yield* Path.Path;
|
|
20
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
21
|
+
const gitFiles = (root, args) => Effect.gen(function* listFiles() {
|
|
22
|
+
const listed = yield* (yield* ChildProcess.make("git", [
|
|
23
|
+
"ls-files",
|
|
24
|
+
"-z",
|
|
25
|
+
...args
|
|
26
|
+
], {
|
|
27
|
+
cwd: root,
|
|
28
|
+
stdin: "ignore"
|
|
29
|
+
})).stdout.pipe(Stream.decodeText(), Stream.mkString);
|
|
30
|
+
return pipe(String.split(listed, "\0"), Array.filter(String.isNonEmpty));
|
|
31
|
+
}).pipe(Effect.scoped, Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), Effect.orElseSucceed(() => []));
|
|
32
|
+
return RepositoryFiles.of({
|
|
33
|
+
generatedFiles: (root) => gitFiles(root, ["--", GENERATED_PATHSPEC]).pipe(Effect.map(Array.map((file) => path.join(root, file)))),
|
|
34
|
+
listedFiles: (root) => gitFiles(root, LISTED_ARGS),
|
|
35
|
+
matchingFiles: (root, pathspecs) => gitFiles(root, [
|
|
36
|
+
...LISTED_ARGS,
|
|
37
|
+
"--",
|
|
38
|
+
...pathspecs
|
|
39
|
+
]),
|
|
40
|
+
readFile: (file) => fs.readFileString(file).pipe(Effect.option),
|
|
41
|
+
exists: (file) => fs.exists(file).pipe(Effect.orElseSucceed(() => false)),
|
|
42
|
+
realPath: (file) => fs.realPath(file).pipe(Effect.orElseSucceed(() => file)),
|
|
43
|
+
readDirectory: (directory) => fs.readDirectory(directory).pipe(Effect.orElseSucceed(() => [])),
|
|
44
|
+
isDirectory: (file) => fs.stat(file).pipe(Effect.map((info) => info.type === "Directory"), Effect.option),
|
|
45
|
+
fileSize: (file) => fs.stat(file).pipe(Effect.map((info) => Number(info.size)), Effect.orElseSucceed(() => MISSING_SIZE)),
|
|
46
|
+
join: (...segments) => path.join(...segments),
|
|
47
|
+
resolve: (...segments) => path.resolve(...segments),
|
|
48
|
+
relative: (from, to) => path.relative(from, to),
|
|
49
|
+
dirname: (file) => path.dirname(file),
|
|
50
|
+
basename: (file) => path.basename(file)
|
|
51
|
+
});
|
|
52
|
+
})).pipe(Layer.provide(nodeServicesLayer));
|
|
53
|
+
export { nodeServicesLayer as i, RepositoryFiles as n, nodeRepositoryFiles as r, NODE_MODULES as t };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=repository-files-CfhXZQrO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-files-CfhXZQrO.mjs","names":["Str","Arr"],"sources":["../src/shared/lib/node-services.ts","../src/shared/lib/repository-files.ts"],"sourcesContent":["import {\n NodeChildProcessSpawner,\n NodeFileSystem,\n NodePath,\n NodeStdio,\n} from \"@effect/platform-node-shared\";\nimport { Layer } from \"effect\";\n\n/** @internal */\nexport const nodeServicesLayer = Layer.provideMerge(\n NodeChildProcessSpawner.layer,\n Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeStdio.layer),\n);\n","import {\n Array as Arr,\n Context,\n Effect,\n FileSystem,\n Layer,\n Path,\n Stream,\n String as Str,\n pipe,\n} from \"effect\";\nimport type { Option } from \"effect\";\nimport { ChildProcess, ChildProcessSpawner } from \"effect/process\";\n\nimport { nodeServicesLayer } from \"./node-services.ts\";\n\nconst MISSING_SIZE = 0;\nconst GENERATED_PATHSPEC = \":(attr:linguist-generated)\";\nconst LISTED_ARGS = [\"--cached\", \"--others\", \"--exclude-standard\"];\n\nexport const NODE_MODULES = \"node_modules\";\n\nexport class RepositoryFiles extends Context.Service<\n RepositoryFiles,\n {\n readonly readFile: (file: string) => Effect.Effect<Option.Option<string>>;\n readonly exists: (file: string) => Effect.Effect<boolean>;\n readonly realPath: (file: string) => Effect.Effect<string>;\n readonly readDirectory: (directory: string) => Effect.Effect<readonly string[]>;\n readonly generatedFiles: (root: string) => Effect.Effect<readonly string[]>;\n readonly listedFiles: (root: string) => Effect.Effect<readonly string[]>;\n readonly matchingFiles: (\n root: string,\n pathspecs: readonly string[],\n ) => Effect.Effect<readonly string[]>;\n readonly isDirectory: (file: string) => Effect.Effect<Option.Option<boolean>>;\n readonly fileSize: (file: string) => Effect.Effect<number>;\n readonly join: (...segments: readonly string[]) => string;\n readonly resolve: (...segments: readonly string[]) => string;\n readonly relative: (from: string, to: string) => string;\n readonly dirname: (file: string) => string;\n readonly basename: (file: string) => string;\n }\n>()(\"@r_masseater/msch/shared/lib/repository-files/RepositoryFiles\") {}\n\nexport const nodeRepositoryFiles = Layer.effect(\n RepositoryFiles,\n Effect.gen(function* nodeRepositoryFiles() {\n const fs = yield* FileSystem.FileSystem;\n const path = yield* Path.Path;\n const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;\n const gitFiles = (root: string, args: readonly string[]): Effect.Effect<readonly string[]> =>\n Effect.gen(function* listFiles() {\n const handle = yield* ChildProcess.make(\"git\", [\"ls-files\", \"-z\", ...args], {\n cwd: root,\n stdin: \"ignore\",\n });\n const listed = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);\n return pipe(Str.split(listed, \"\\0\"), Arr.filter(Str.isNonEmpty));\n }).pipe(\n Effect.scoped,\n Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),\n Effect.orElseSucceed((): readonly string[] => []),\n );\n return RepositoryFiles.of({\n generatedFiles: (root) =>\n gitFiles(root, [\"--\", GENERATED_PATHSPEC]).pipe(\n Effect.map(Arr.map((file) => path.join(root, file))),\n ),\n listedFiles: (root) => gitFiles(root, LISTED_ARGS),\n matchingFiles: (root, pathspecs) => gitFiles(root, [...LISTED_ARGS, \"--\", ...pathspecs]),\n readFile: (file) => fs.readFileString(file).pipe(Effect.option),\n exists: (file) => fs.exists(file).pipe(Effect.orElseSucceed(() => false)),\n realPath: (file) => fs.realPath(file).pipe(Effect.orElseSucceed(() => file)),\n readDirectory: (directory) =>\n fs.readDirectory(directory).pipe(Effect.orElseSucceed((): readonly string[] => [])),\n isDirectory: (file) =>\n fs.stat(file).pipe(\n Effect.map((info) => info.type === \"Directory\"),\n Effect.option,\n ),\n fileSize: (file) =>\n fs.stat(file).pipe(\n Effect.map((info) => Number(info.size)),\n Effect.orElseSucceed(() => MISSING_SIZE),\n ),\n join: (...segments) => path.join(...segments),\n resolve: (...segments) => path.resolve(...segments),\n relative: (from, to) => path.relative(from, to),\n dirname: (file) => path.dirname(file),\n basename: (file) => path.basename(file),\n });\n }),\n).pipe(Layer.provide(nodeServicesLayer));\n"],"mappings":";;;;;AASA,MAAa,oBAAoB,MAAM,aACrC,wBAAwB,OACxB,MAAM,SAAS,eAAe,OAAO,SAAS,OAAO,UAAU,KAAK,CACtE;;ACIA,MAAM,eAAe;AACrB,MAAM,qBAAqB;AAC3B,MAAM,cAAc;CAAC;CAAY;CAAY;AAAoB;AAEjE,MAAa,eAAe;AAE5B,IAAa,kBAAb,cAAqC,QAAQ,QAqB3C,CAAC,CAAC,+DAA+D,CAAC,CAAC,CAAC;AAEtE,MAAa,sBAAsB,MAAM,OACvC,iBACA,OAAO,IAAI,UAAU,sBAAsB;CACzC,MAAM,KAAK,OAAO,WAAW;CAC7B,MAAM,OAAO,OAAO,KAAK;CACzB,MAAM,UAAU,OAAO,oBAAoB;CAC3C,MAAM,YAAY,MAAc,SAC9B,OAAO,IAAI,UAAU,YAAY;EAK/B,MAAM,SAAS,QAAO,OAJA,aAAa,KAAK,OAAO;GAAC;GAAY;GAAM,GAAG;EAAI,GAAG;GAC1E,KAAK;GACL,OAAO;EACT,CAAC,EAAA,CAC4B,OAAO,KAAK,OAAO,WAAW,GAAG,OAAO,QAAQ;EAC7E,OAAO,KAAKA,OAAI,MAAM,QAAQ,IAAI,GAAGC,MAAI,OAAOD,OAAI,UAAU,CAAC;CACjE,CAAC,CAAC,CAAC,KACD,OAAO,QACP,OAAO,eAAe,oBAAoB,qBA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