@r_masseater/msch 0.24.1 → 0.25.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.
@@ -0,0 +1,1110 @@
1
+ import { t as COMMENT_DIRECTIVES } from "./comment-directives-WcDqvLwJ.mjs";
2
+ import { Array, Record, String, Struct, pipe } from "effect";
3
+ import { fileURLToPath } from "node:url";
4
+ import tanstackQuery from "@r_masseater/oxlint-typed-rules/tanstack-query";
5
+ import tanstackRouter from "@r_masseater/oxlint-typed-rules/tanstack-router";
6
+ import { plugin } from "@shadcn/lint";
7
+ import baselineJs from "eslint-plugin-baseline-js";
8
+ import { presets } from "@effect/tsgo/oxlint-presets";
9
+ import htmlReact from "@html-eslint/eslint-plugin-react";
10
+ import eslintReact from "@r_masseater/oxlint-typed-rules/react";
11
+ import reactHooks from "eslint-plugin-react-hooks";
12
+ import { createDecisionPlugin, defineDecisionRule } from "@r_masseater/oxlint-plugin-decision";
13
+ import fsd from "@r_masseater/vite-plus-adopt/fsd";
14
+ // src/features/lint-preset/config/lint-overrides.config.ts
15
+ const LOGPUSH = "Property[key.name=\"logpush\"]:not([value.value=false])";
16
+ const LOGPUSH_MESSAGE = "Worker には logpush: true を付ける。付けないと、その Worker のログが Logpush に流れない";
17
+ const cloudflareResourceSyntax = [
18
+ {
19
+ selector: `CallExpression[callee.object.name="Workers"][callee.property.name="Worker"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,
20
+ message: LOGPUSH_MESSAGE
21
+ },
22
+ {
23
+ selector: `CallExpression[callee.object.name="Website"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,
24
+ message: LOGPUSH_MESSAGE
25
+ },
26
+ {
27
+ selector: "MemberExpression[object.name=\"Rum\"][property.name=\"Site\"]",
28
+ message: "Rum.Site は使わない。CI のトークンに Account Settings Write が要る。Cloudflare API でホストごとに一度サイトを作り、トークンを CF_BEACON_TOKEN に置く"
29
+ }
30
+ ];
31
+ const removalPolicySyntax = {
32
+ selector: "CallExpression[callee.object.name=/^(D1|R2)$/][callee.property.name=/^(Database|Bucket)$/]:not(CallExpression[callee.property.name=\"pipe\"][arguments.0.callee.object.name=\"RemovalPolicy\"] > MemberExpression.callee > CallExpression.object)",
33
+ message: "D1 と R2 は作り直すと中身が消えるので、alchemy の RemovalPolicy.protect() を .pipe で付けて置き換えと削除を止める"
34
+ };
35
+ const removalPolicyOverride = {
36
+ files: ["**/*.ts"],
37
+ excludeFiles: ["**/*.test.ts"],
38
+ rules: { "eslint-js/no-restricted-syntax": ["error", removalPolicySyntax] }
39
+ };
40
+ const alchemyOverride = {
41
+ files: ["**/alchemy.run.ts"],
42
+ rules: { "eslint-js/no-restricted-syntax": [
43
+ "error",
44
+ ...cloudflareResourceSyntax,
45
+ removalPolicySyntax,
46
+ {
47
+ selector: "CallExpression[callee.name=\"Stack\"]:not([arguments.0.name=\"APP_NAME\"])",
48
+ message: "スタック名には app-name.ts の APP_NAME を渡す"
49
+ },
50
+ {
51
+ selector: "Program:not(:has(YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))",
52
+ message: "スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する"
53
+ },
54
+ {
55
+ selector: "CallExpression[callee.name=\"Stack\"] > .arguments:nth-child(3):not(:has(FunctionExpression > BlockStatement > ExpressionStatement:nth-last-child(2) > YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))",
56
+ message: "スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する"
57
+ }
58
+ ] }
59
+ };
60
+ const commandsOverride = {
61
+ files: ["bin/**"],
62
+ rules: {
63
+ "node/no-process-env": "off",
64
+ "node/no-sync": "off",
65
+ "effecttsgo/node-builtin-import": "off"
66
+ }
67
+ };
68
+ // src/features/lint-preset/config/decision-rules.ts
69
+ var decision_rules_default = createDecisionPlugin({
70
+ name: "stack",
71
+ rules: [
72
+ defineDecisionRule({
73
+ id: "exclusive-status",
74
+ target: "file",
75
+ question: "Does this code represent one piece of state with several boolean flags or optional fields whose combinations can contradict each other, instead of one exclusive status expressed as a discriminated union? Answer no when every state is a single exclusive status, or when the file holds no such state. A violation needs two or more booleans or optional fields that describe the same piece of state; a single boolean value, parameter, return value or field is not a violation, and a union of objects told apart by a status or kind field is already an exclusive status. A constant configuration object whose shape a library fixes, such as an OpenFeature flag definition, holds no state and is not a violation.",
76
+ message: "状態は排他的なstatusを持つ判別共用体で表し、booleanフラグの組を使わない。",
77
+ cutoff: .8
78
+ }),
79
+ defineDecisionRule({
80
+ id: "server-state-tanstack-query",
81
+ target: "file",
82
+ question: "Does this code fetch, cache or synchronize server data on the client with something other than TanStack Query, such as fetch inside useEffect, SWR or a hand-written cache? Answer no when server data on the client goes only through TanStack Query, or when the file handles none. Creating an API client such as a better-auth or Eden client, which fetches nothing until a query calls it, is not a violation.",
83
+ message: "サーバー状態はTanStack Queryだけで扱う。",
84
+ cutoff: .8
85
+ }),
86
+ defineDecisionRule({
87
+ id: "ui-state-effect-atom",
88
+ target: "file",
89
+ question: "Does this code hold client-side UI state with something other than effect-atom, such as useState, useReducer, React context used as a store, zustand, jotai or redux? Answer no when client-side UI state is held only by effect-atom, or when the file holds none. effect-atom is Atom from effect/reactivity, read and written through @effect/atom-react hooks such as useAtomValue and useAtomSet. Creating a TanStack Query QueryClient or configuring the router, which hold no UI state, is not a violation.",
90
+ message: "UI状態はeffect-atomだけで扱う。",
91
+ cutoff: .8
92
+ })
93
+ ]
94
+ });
95
+ // src/features/lint-preset/config/lint.config.ts
96
+ const generated = [
97
+ "**/routeTree.gen.ts",
98
+ "**/generated/**",
99
+ "**/drizzle/**/snapshot.json",
100
+ ".claude/skills/**",
101
+ ".intent/**",
102
+ "AGENTS.md",
103
+ "skills-lock.json",
104
+ "**/CHANGELOG.md",
105
+ ".github/release-please/*manifest.json",
106
+ "**/.release-please-manifest.json",
107
+ "**/*.d.rpp.ts",
108
+ "**/src-tauri/gen/**"
109
+ ];
110
+ const asErrors = (names) => Record.fromEntries(pipe(names, Array.map((name) => [name, "error"])));
111
+ const allRulesOf = ({ prefix, rules }) => asErrors(pipe(Record.keys(rules), Array.map((rule) => `${prefix}/${rule}`)));
112
+ const reactHooksRules = asErrors(pipe(Struct.keys(reactHooks.configs["recommended-latest"].rules), Array.map(String.replace("react-hooks/", "react-hooks-js/"))));
113
+ const eslintReactRuleNames = pipe(Record.keys(eslintReact.configs["strict-typescript"].rules ?? {}), Array.filter((name) => !(String.replace("@eslint-react/", "react-hooks-js/")(name) in reactHooksRules)));
114
+ const effectRuleNames = pipe(Record.values(presets), Array.flatMap((preset) => Struct.keys(preset.rules ?? {})));
115
+ const pluginRules = {
116
+ ...asErrors(Record.keys(htmlReact.configs.all.rules ?? {})),
117
+ ...reactHooksRules,
118
+ ...asErrors(eslintReactRuleNames),
119
+ ...asErrors(effectRuleNames)
120
+ };
121
+ const decisionPluginName = decision_rules_default.meta.name;
122
+ const decisionRules = allRulesOf({
123
+ prefix: decisionPluginName,
124
+ rules: decision_rules_default.rules
125
+ });
126
+ const decisionTestRules = pipe(decisionRules, Record.map(() => "off"));
127
+ const shadcnRestyleContracts = [{
128
+ pattern: "^Table(Head|Cell)$",
129
+ allow: ["text-alignment", "fvn-spacing"]
130
+ }, {
131
+ pattern: "^TableCaption$",
132
+ allow: [
133
+ "caption",
134
+ "text-alignment",
135
+ "mt-*",
136
+ "mb-*"
137
+ ]
138
+ }];
139
+ // src/features/lint-preset/config/readonly-binary.config.ts
140
+ const BINARY_DATA = [
141
+ "ArrayBuffer",
142
+ "DataView",
143
+ "BigInt64Array",
144
+ "BigUint64Array",
145
+ "Float32Array",
146
+ "Float64Array",
147
+ "Int8Array",
148
+ "Int16Array",
149
+ "Int32Array",
150
+ "Uint8Array",
151
+ "Uint8ClampedArray",
152
+ "Uint16Array",
153
+ "Uint32Array"
154
+ ];
155
+ // src/features/lint-preset/config/readonly-browser.config.ts
156
+ const WEBGPU_HANDLES = [
157
+ "GPUDevice",
158
+ "GPUCanvasContext",
159
+ "GPUTexture",
160
+ "GPUBuffer",
161
+ "GPUBindGroup",
162
+ "GPUBindGroupLayout",
163
+ "GPUPipelineLayout",
164
+ "GPURenderPipeline",
165
+ "GPUSampler"
166
+ ];
167
+ const BROWSER_HANDLES = [
168
+ "HTMLCanvasElement",
169
+ "HTMLImageElement",
170
+ "HTMLAnchorElement",
171
+ "CanvasRenderingContext2D",
172
+ "PointerEvent",
173
+ "WheelEvent",
174
+ "KeyboardEvent",
175
+ "MouseEvent",
176
+ "AbortSignal",
177
+ "ImageBitmap",
178
+ "AudioContext",
179
+ "OfflineAudioContext",
180
+ "AnalyserNode",
181
+ "AudioBuffer",
182
+ "AudioBufferSourceNode",
183
+ ...WEBGPU_HANDLES
184
+ ];
185
+ // src/features/lint-preset/config/readonly-lint-tools.config.ts
186
+ const lintToolReadonlyAllow = [
187
+ {
188
+ from: "package",
189
+ package: "@oxlint/plugins",
190
+ name: [
191
+ "Context",
192
+ "ExportNamedDeclaration",
193
+ "ExportSpecifier",
194
+ "Statement",
195
+ "Fixer",
196
+ "ImportDeclaration",
197
+ "ImportDeclarationSpecifier",
198
+ "Location",
199
+ "MemberExpression",
200
+ "Node",
201
+ "Range",
202
+ "Rule",
203
+ "RuleMeta",
204
+ "SourceCode",
205
+ "VisitorWithHooks"
206
+ ]
207
+ },
208
+ {
209
+ from: "package",
210
+ package: "oxlint",
211
+ name: [
212
+ "DummyRule",
213
+ "DummyRuleMap",
214
+ "InvalidTestCase",
215
+ "OxlintOverride",
216
+ "Rule",
217
+ "TestCases",
218
+ "ValidTestCase"
219
+ ]
220
+ },
221
+ {
222
+ from: "package",
223
+ package: "@commitlint/types",
224
+ name: ["QualifiedConfig"]
225
+ },
226
+ {
227
+ from: "package",
228
+ package: "@textlint/config-loader",
229
+ name: ["TextlintLoadPackagesFromRawConfigResult"]
230
+ },
231
+ {
232
+ from: "package",
233
+ package: "markdownlint",
234
+ name: ["LintError"]
235
+ },
236
+ {
237
+ from: "package",
238
+ package: "steiger",
239
+ name: [
240
+ "ConfigObject",
241
+ "GlobalIgnore",
242
+ "Plugin"
243
+ ]
244
+ },
245
+ {
246
+ from: "file",
247
+ path: "upstream/attw-core/lib/checkPackage.d.ts",
248
+ name: ["CheckPackageOptions"]
249
+ },
250
+ {
251
+ from: "package",
252
+ package: "@r_masseater/vite-plus-adopt",
253
+ name: ["CheckPackageOptions"]
254
+ },
255
+ {
256
+ from: "file",
257
+ path: "src/shared/config/types.ts",
258
+ name: [
259
+ "CommitlintConfig",
260
+ "MarkdownlintConfig",
261
+ "TextlintConfig",
262
+ "ToolSections"
263
+ ]
264
+ },
265
+ {
266
+ from: "file",
267
+ name: [
268
+ "BoundSymbol",
269
+ "CompatSymbol",
270
+ "CompatType",
271
+ "FileBinding",
272
+ "SymbolTable",
273
+ "TypedContext"
274
+ ]
275
+ }
276
+ ];
277
+ // src/features/lint-preset/config/readonly-types.config.ts
278
+ const readonlyParameterAllow = [
279
+ {
280
+ from: "lib",
281
+ name: [
282
+ "HTMLElement",
283
+ "HTMLDivElement",
284
+ "Worker",
285
+ "ReadableStream",
286
+ "Request",
287
+ "Response",
288
+ ...BINARY_DATA,
289
+ "RegExp",
290
+ "RegExpExecArray",
291
+ "RegExpMatchArray",
292
+ "Date",
293
+ "SpeechRecognitionResult",
294
+ "CryptoKey",
295
+ ...BROWSER_HANDLES
296
+ ]
297
+ },
298
+ {
299
+ from: "package",
300
+ package: "@webgpu/types",
301
+ name: [...WEBGPU_HANDLES]
302
+ },
303
+ {
304
+ from: "package",
305
+ package: "@vscode/tree-sitter-wasm",
306
+ name: "Language"
307
+ },
308
+ {
309
+ from: "package",
310
+ package: "domhandler",
311
+ name: [
312
+ "AnyNode",
313
+ "Text",
314
+ "Element"
315
+ ]
316
+ },
317
+ {
318
+ from: "package",
319
+ package: "@cloudflare/workers-types",
320
+ name: [
321
+ "AnalyticsEngineDataset",
322
+ "Container",
323
+ "DurableObjectState",
324
+ "DurableObjectStorage",
325
+ "CryptoKey",
326
+ "KVNamespace",
327
+ "R2Bucket",
328
+ "SecretsStoreSecret",
329
+ "TailEvent",
330
+ "Onset",
331
+ "Log",
332
+ "Exception",
333
+ "Attribute",
334
+ "SpanUpdateInfo",
335
+ "FetchResponseInfo",
336
+ "Span"
337
+ ]
338
+ },
339
+ {
340
+ from: "package",
341
+ package: "@alchemy.run/cloudflare",
342
+ name: ["Store", "WorkerProps"]
343
+ },
344
+ {
345
+ from: "package",
346
+ package: "@bufbuild/protobuf",
347
+ name: [
348
+ "DescMessage",
349
+ "JsonObject",
350
+ "JsonValue",
351
+ "Message"
352
+ ]
353
+ },
354
+ {
355
+ from: "package",
356
+ package: "lighthouse",
357
+ name: [
358
+ "FlowResult",
359
+ "Step",
360
+ "UserFlow"
361
+ ]
362
+ },
363
+ {
364
+ from: "package",
365
+ package: "vitest",
366
+ name: "TestProject"
367
+ },
368
+ {
369
+ from: "package",
370
+ package: "puppeteer-core",
371
+ name: [
372
+ "Browser",
373
+ "ElementHandle",
374
+ "Page"
375
+ ]
376
+ },
377
+ {
378
+ from: "package",
379
+ package: "miniflare",
380
+ name: "Miniflare"
381
+ },
382
+ {
383
+ from: "package",
384
+ package: "elysia",
385
+ name: "ElysiaConfig"
386
+ },
387
+ {
388
+ from: "package",
389
+ package: "@types/node",
390
+ name: ["Request", "Response"]
391
+ },
392
+ {
393
+ from: "package",
394
+ package: "@better-auth/drizzle-adapter",
395
+ name: "DB"
396
+ },
397
+ {
398
+ from: "package",
399
+ package: "drizzle-orm",
400
+ name: ["DrizzleSqliteDODatabase", "SQL"]
401
+ },
402
+ {
403
+ from: "package",
404
+ package: "@tanstack/query-core",
405
+ name: "QueryClient"
406
+ },
407
+ {
408
+ from: "package",
409
+ package: "@codemirror/view",
410
+ name: [
411
+ "Decoration",
412
+ "EditorView",
413
+ "GutterMarker",
414
+ "ViewUpdate",
415
+ "WidgetType"
416
+ ]
417
+ },
418
+ {
419
+ from: "package",
420
+ package: "@codemirror/state",
421
+ name: [
422
+ "ChangeDesc",
423
+ "EditorState",
424
+ "Extension",
425
+ "StateEffect",
426
+ "Text",
427
+ "Transaction"
428
+ ]
429
+ },
430
+ {
431
+ from: "package",
432
+ package: "@codemirror/lint",
433
+ name: "Diagnostic"
434
+ },
435
+ {
436
+ from: "package",
437
+ package: "comlink",
438
+ name: "Remote"
439
+ },
440
+ {
441
+ from: "package",
442
+ package: "typescript",
443
+ name: [
444
+ "API",
445
+ "ArrayLiteralExpression",
446
+ "ArrowFunction",
447
+ "BinaryExpression",
448
+ "BindingElement",
449
+ "CallExpression",
450
+ "Checker",
451
+ "ClassDeclaration",
452
+ "CompilerHost",
453
+ "CompilerOptions",
454
+ "CompletionEntry",
455
+ "ConfigFileResponse",
456
+ "Declaration",
457
+ "DeclarationBase",
458
+ "DiagnosticResponse",
459
+ "ElementAccessExpression",
460
+ "EnumDeclaration",
461
+ "ExportAssignment",
462
+ "ExportDeclaration",
463
+ "ExportSpecifier",
464
+ "Expression",
465
+ "ExpressionBase",
466
+ "FunctionDeclaration",
467
+ "FunctionExpression",
468
+ "Identifier",
469
+ "InterfaceDeclaration",
470
+ "JSDocCallbackTag",
471
+ "JSDocTagBase",
472
+ "JSDocTypedefTag",
473
+ "ModuleDeclaration",
474
+ "Node",
475
+ "NodeHandle",
476
+ "NumericLiteral",
477
+ "ParameterDeclaration",
478
+ "ParseConfigFileHost",
479
+ "ParsedCommandLine",
480
+ "Program",
481
+ "Project",
482
+ "PropertyAccessExpression",
483
+ "PropertyDeclaration",
484
+ "PropertySignature",
485
+ "Signature",
486
+ "SignatureDeclaration",
487
+ "Snapshot",
488
+ "SourceFile",
489
+ "StringLiteral",
490
+ "Symbol",
491
+ "Type",
492
+ "TypeAliasDeclaration",
493
+ "TypeChecker",
494
+ "TypeFlags",
495
+ "TypeNode",
496
+ "TypeNodeBase",
497
+ "UnionTypeNode",
498
+ "VariableDeclaration",
499
+ "VariableDeclarationList",
500
+ "WasmTransport"
501
+ ]
502
+ },
503
+ {
504
+ from: "package",
505
+ package: "@codemirror/autocomplete",
506
+ name: "CompletionContext"
507
+ },
508
+ ...lintToolReadonlyAllow,
509
+ {
510
+ from: "package",
511
+ package: "react",
512
+ name: [
513
+ "ReactNode",
514
+ "ButtonHTMLAttributes",
515
+ "ChangeEvent",
516
+ "ClassAttributes",
517
+ "FocusEvent",
518
+ "KeyboardEvent",
519
+ "SubmitEvent"
520
+ ]
521
+ },
522
+ {
523
+ from: "package",
524
+ package: "clsx",
525
+ name: "ClassValue"
526
+ },
527
+ {
528
+ from: "package",
529
+ package: "@anthropic-ai/claude-agent-sdk",
530
+ name: ["SDKMessage", "SDKResultMessage"]
531
+ },
532
+ {
533
+ from: "package",
534
+ package: "@types/dom-speech-recognition",
535
+ name: [
536
+ "SpeechRecognition",
537
+ "SpeechRecognitionEvent",
538
+ "SpeechRecognitionResult"
539
+ ]
540
+ },
541
+ {
542
+ from: "package",
543
+ package: "@modelcontextprotocol/server",
544
+ name: "McpServer"
545
+ },
546
+ {
547
+ from: "package",
548
+ package: "@modelcontextprotocol/client",
549
+ name: [
550
+ "CallToolResult",
551
+ "Client",
552
+ "ContentBlock"
553
+ ]
554
+ },
555
+ {
556
+ from: "package",
557
+ package: "discord.js",
558
+ name: ["Client", "Guild"]
559
+ },
560
+ {
561
+ from: "package",
562
+ package: "@discordjs/voice",
563
+ name: ["AudioPlayer", "VoiceConnection"]
564
+ },
565
+ {
566
+ from: "package",
567
+ package: "mdast",
568
+ name: [
569
+ "Root",
570
+ "RootContent",
571
+ "Yaml"
572
+ ]
573
+ },
574
+ {
575
+ from: "package",
576
+ package: "@types/mdast",
577
+ name: ["Code", "Nodes"]
578
+ },
579
+ {
580
+ from: "package",
581
+ package: "@types/hast",
582
+ name: ["Element", "RootContent"]
583
+ },
584
+ {
585
+ from: "package",
586
+ package: "ical.js",
587
+ name: "Component"
588
+ },
589
+ {
590
+ from: "package",
591
+ package: "@jupyterlab/nbformat",
592
+ name: [
593
+ "ICell",
594
+ "IDisplayData",
595
+ "IExecuteResult",
596
+ "INotebookContent",
597
+ "IOutput",
598
+ "MultilineString"
599
+ ]
600
+ },
601
+ {
602
+ from: "package",
603
+ package: "unpdf",
604
+ name: "PDFDocumentProxy"
605
+ },
606
+ {
607
+ from: "package",
608
+ package: "@kenjiuno/msgreader",
609
+ name: "FieldsData"
610
+ },
611
+ {
612
+ from: "package",
613
+ package: "parse5",
614
+ name: [
615
+ "Document",
616
+ "DocumentFragment",
617
+ "DocumentType",
618
+ "Element",
619
+ "Template",
620
+ "CommentNode",
621
+ "TextNode"
622
+ ]
623
+ },
624
+ {
625
+ from: "package",
626
+ package: "postal-mime",
627
+ name: ["Address", "Email"]
628
+ },
629
+ {
630
+ from: "package",
631
+ package: "fflate",
632
+ name: ["Unzipped"]
633
+ },
634
+ {
635
+ from: "package",
636
+ package: "@openrouter/sdk",
637
+ name: [
638
+ "DecisionsChoiceAnswer",
639
+ "DecisionsNoulAnswer",
640
+ "DecisionsScoreAnswer",
641
+ "Unknown"
642
+ ]
643
+ },
644
+ {
645
+ from: "package",
646
+ package: "recharts",
647
+ name: "TooltipPayloadEntry"
648
+ },
649
+ {
650
+ from: "package",
651
+ package: "vfile",
652
+ name: "VFile"
653
+ },
654
+ {
655
+ from: "package",
656
+ package: "modern-tar",
657
+ name: "ParsedTarEntry"
658
+ },
659
+ {
660
+ from: "package",
661
+ package: "@zip.js/zip.js",
662
+ name: ["Entry", "FileEntry"]
663
+ },
664
+ {
665
+ from: "package",
666
+ package: "three",
667
+ name: [
668
+ "LoadingManager",
669
+ "Object3D",
670
+ "WebGLRenderer",
671
+ "PerspectiveCamera",
672
+ "Scene",
673
+ "Sphere",
674
+ "BufferAttribute",
675
+ "Material",
676
+ "Mesh"
677
+ ]
678
+ },
679
+ {
680
+ from: "package",
681
+ package: "@huggingface/transformers",
682
+ name: [
683
+ "RawImage",
684
+ "PretrainedConfig",
685
+ "PreTrainedModel",
686
+ "Processor"
687
+ ]
688
+ },
689
+ {
690
+ from: "package",
691
+ package: "effect",
692
+ name: [
693
+ "Atom",
694
+ "Cause",
695
+ "Context",
696
+ "DateTime",
697
+ "Deferred",
698
+ "Duration",
699
+ "Effect",
700
+ "Exit",
701
+ "Fiber",
702
+ "HashMap",
703
+ "HashSet",
704
+ "HttpClient",
705
+ "HttpClientRequest",
706
+ "HttpClientResponse",
707
+ "HttpServerRequest",
708
+ "HttpServerResponse",
709
+ "Json",
710
+ "JsonArray",
711
+ "JsonObject",
712
+ "Layer",
713
+ "Logger",
714
+ "NativeSpan",
715
+ "Option",
716
+ "Redacted",
717
+ "Ref",
718
+ "Stream",
719
+ "Utc",
720
+ "Writable"
721
+ ]
722
+ }
723
+ ];
724
+ // src/features/lint-preset/config/preset.ts
725
+ const resolved = (specifier) => fileURLToPath(import.meta.resolve(specifier));
726
+ const DECISION_TIMEOUT_MS = 5e4;
727
+ const typedRules = "@r_masseater/oxlint-typed-rules";
728
+ const lint = {
729
+ ignorePatterns: generated,
730
+ plugins: [
731
+ "eslint",
732
+ "typescript",
733
+ "unicorn",
734
+ "oxc",
735
+ "import",
736
+ "react",
737
+ "react-perf",
738
+ "jsx-a11y",
739
+ "jsdoc",
740
+ "promise",
741
+ "node",
742
+ "effecttsgo"
743
+ ],
744
+ categories: {
745
+ correctness: "error",
746
+ suspicious: "error",
747
+ pedantic: "error",
748
+ perf: "error",
749
+ style: "error",
750
+ restriction: "error",
751
+ nursery: "error"
752
+ },
753
+ jsPlugins: [
754
+ {
755
+ name: "vite-plus",
756
+ specifier: resolved("vite-plus/oxlint-plugin")
757
+ },
758
+ {
759
+ name: "tanstack-query",
760
+ specifier: resolved(`${typedRules}/tanstack-query`)
761
+ },
762
+ {
763
+ name: "tanstack-router",
764
+ specifier: resolved(`${typedRules}/tanstack-router`)
765
+ },
766
+ {
767
+ name: "tanstack-start",
768
+ specifier: resolved(`${typedRules}/tanstack-start`)
769
+ },
770
+ {
771
+ name: "drizzle",
772
+ specifier: resolved(`${typedRules}/drizzle`)
773
+ },
774
+ {
775
+ name: "react-hooks-js",
776
+ specifier: resolved("eslint-plugin-react-hooks")
777
+ },
778
+ {
779
+ name: "@eslint-react",
780
+ specifier: resolved(`${typedRules}/react`)
781
+ },
782
+ {
783
+ name: "shadcn",
784
+ specifier: resolved("@shadcn/lint")
785
+ },
786
+ {
787
+ name: "no-comments",
788
+ specifier: resolved("eslint-plugin-no-comments")
789
+ },
790
+ {
791
+ name: "baseline-js",
792
+ specifier: resolved("eslint-plugin-baseline-js")
793
+ },
794
+ {
795
+ name: "@html-eslint/react",
796
+ specifier: resolved("@html-eslint/eslint-plugin-react")
797
+ },
798
+ {
799
+ name: "eslint-js",
800
+ specifier: resolved("oxlint-plugin-eslint")
801
+ },
802
+ {
803
+ name: decisionPluginName,
804
+ specifier: resolved("@r_masseater/msch/decision-rules")
805
+ },
806
+ {
807
+ name: "msch-lint",
808
+ specifier: resolved("@r_masseater/msch/lint-rules")
809
+ }
810
+ ],
811
+ rules: {
812
+ "vite-plus/prefer-vite-plus-imports": "error",
813
+ "tanstack-start/no-async-client-component": "error",
814
+ "tanstack-start/no-client-code-in-server-component": "error",
815
+ "no-comments/disallowComments": ["error", { allow: COMMENT_DIRECTIVES }],
816
+ ...allRulesOf({
817
+ prefix: "tanstack-query",
818
+ rules: tanstackQuery.rules
819
+ }),
820
+ ...allRulesOf({
821
+ prefix: "tanstack-router",
822
+ rules: tanstackRouter.rules
823
+ }),
824
+ "drizzle/enforce-delete-with-where": ["error", { drizzleObjectName: ["db"] }],
825
+ "drizzle/enforce-update-with-where": ["error", { drizzleObjectName: ["db"] }],
826
+ ...allRulesOf({
827
+ prefix: "shadcn",
828
+ rules: plugin.rules
829
+ }),
830
+ "shadcn/no-restyle": ["error", { contracts: shadcnRestyleContracts }],
831
+ ...allRulesOf({
832
+ prefix: "baseline-js",
833
+ rules: baselineJs.rules
834
+ }),
835
+ ...baselineJs.configs.recommended().rules,
836
+ "baseline-js/use-baseline": ["error", {
837
+ available: "widely",
838
+ includeWebApis: { preset: "auto" },
839
+ includeJsBuiltins: { preset: "auto" }
840
+ }],
841
+ ...pluginRules,
842
+ "eslint/capitalized-comments": "off",
843
+ "eslint/sort-imports": "off",
844
+ "eslint/sort-keys": "off",
845
+ "import/no-named-export": "off",
846
+ "import/prefer-default-export": "off",
847
+ "import/group-exports": "off",
848
+ "import/exports-last": "off",
849
+ "msch-lint/inline-exports": "error",
850
+ "msch-lint/ui-state-in-atoms": "error",
851
+ "msch-lint/no-hand-written-sql": "error",
852
+ "react/react-in-jsx-scope": "off",
853
+ "eslint/no-undef": "off",
854
+ "typescript/promise-function-async": "off",
855
+ "react/forbid-component-props": "off",
856
+ "oxc/no-rest-spread-properties": "off",
857
+ "node/no-top-level-await": "off",
858
+ "import/no-nodejs-modules": "off",
859
+ "eslint/new-cap": ["error", { capIsNew: false }],
860
+ "eslint/one-var": ["error", "never"],
861
+ "eslint/id-length": ["error", { exceptions: ["x", "y"] }],
862
+ "jsdoc/check-tag-names": ["error", { definedTags: ["msch"] }],
863
+ "jsdoc/require-param": ["error", { exemptedBy: [
864
+ "inheritdoc",
865
+ "internal",
866
+ "msch"
867
+ ] }],
868
+ "jsdoc/require-returns": ["error", { exemptedBy: [
869
+ "inheritdoc",
870
+ "internal",
871
+ "msch"
872
+ ] }],
873
+ "eslint-js/no-restricted-syntax": ["error", ...cloudflareResourceSyntax],
874
+ "typescript/prefer-readonly-parameter-types": ["error", {
875
+ ignoreInferredTypes: true,
876
+ allow: readonlyParameterAllow
877
+ }],
878
+ "eslint/no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
879
+ "react/function-component-definition": ["error", {
880
+ namedComponents: "arrow-function",
881
+ unnamedComponents: "arrow-function"
882
+ }],
883
+ "typescript/no-empty-interface": ["error", { allowSingleExtends: true }],
884
+ "typescript/no-empty-object-type": ["error", { allowInterfaces: "with-single-extends" }],
885
+ "react/jsx-filename-extension": ["error", { extensions: [".tsx"] }],
886
+ "react/only-export-components": ["error", { allowExportNames: ["Route"] }]
887
+ },
888
+ overrides: [
889
+ removalPolicyOverride,
890
+ alchemyOverride,
891
+ {
892
+ files: [
893
+ "**/*.config.ts",
894
+ "**/alchemy.*.ts",
895
+ "**/*.worker.ts",
896
+ "**/decision-rules.ts"
897
+ ],
898
+ rules: { "import/no-default-export": "off" }
899
+ },
900
+ commandsOverride,
901
+ {
902
+ files: ["**/vite.config.ts"],
903
+ rules: {
904
+ "eslint/max-lines": "off",
905
+ "eslint/max-lines-per-function": "off",
906
+ "baseline-js/use-baseline": "off"
907
+ }
908
+ }
909
+ ],
910
+ settings: { [decisionPluginName]: {
911
+ model: "cloudflare/@cf/qwen/qwen3.8-27b",
912
+ timeoutMs: DECISION_TIMEOUT_MS,
913
+ ci: "skip"
914
+ } },
915
+ options: {
916
+ typeAware: true,
917
+ typeCheck: true,
918
+ denyWarnings: true,
919
+ reportUnusedDisableDirectives: "error"
920
+ }
921
+ };
922
+ // src/features/lint-preset/config/required-stack.config.ts
923
+ const UI_STATE = "UI 状態は effect-atom だけで扱う";
924
+ const INSTRUMENTATION = "計装は Effect のトレーシングだけで扱う";
925
+ const INFRASTRUCTURE = "インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない";
926
+ const requiredStack = {
927
+ [UI_STATE]: [
928
+ "zustand",
929
+ "jotai",
930
+ "valtio",
931
+ "recoil",
932
+ "mobx",
933
+ "mobx-*",
934
+ "redux",
935
+ "@reduxjs/*",
936
+ "react-redux",
937
+ "xstate",
938
+ "@xstate/*",
939
+ "nanostores",
940
+ "@nanostores/*",
941
+ "@preact/signals*"
942
+ ],
943
+ "サーバー状態は TanStack Query と Eden だけで扱う": [
944
+ "swr",
945
+ "react-query",
946
+ "@apollo/*",
947
+ "urql",
948
+ "@urql/*",
949
+ "axios",
950
+ "ky",
951
+ "ofetch",
952
+ "got",
953
+ "node-fetch",
954
+ "graphql-request",
955
+ "@trpc/*"
956
+ ],
957
+ "ルーティングとサーバーは TanStack Start と Elysia だけで扱う": [
958
+ "react-router",
959
+ "react-router-dom",
960
+ "next",
961
+ "@remix-run/*",
962
+ "wouter",
963
+ "express",
964
+ "hono",
965
+ "fastify",
966
+ "koa",
967
+ "@nestjs/*"
968
+ ],
969
+ "データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する": [
970
+ "prisma",
971
+ "@prisma/*",
972
+ "typeorm",
973
+ "sequelize",
974
+ "kysely",
975
+ "knex",
976
+ "@mikro-orm/*",
977
+ "better-sqlite3",
978
+ "pg",
979
+ "mysql2"
980
+ ],
981
+ "認証は better-auth だけで扱う": [
982
+ "next-auth",
983
+ "@auth/*",
984
+ "lucia",
985
+ "passport",
986
+ "passport-*",
987
+ "@clerk/*",
988
+ "firebase/auth",
989
+ "@supabase/*"
990
+ ],
991
+ "UI は shadcn/ui と Tailwind CSS だけで組む": [
992
+ "@mui/*",
993
+ "antd",
994
+ "@chakra-ui/*",
995
+ "@mantine/*",
996
+ "styled-components",
997
+ "@emotion/*",
998
+ "bootstrap",
999
+ "react-bootstrap"
1000
+ ],
1001
+ "検証、日時、ログ、関数型ユーティリティは Effect だけで扱う": [
1002
+ "zod",
1003
+ "yup",
1004
+ "joi",
1005
+ "valibot",
1006
+ "arktype",
1007
+ "io-ts",
1008
+ "superstruct",
1009
+ "moment",
1010
+ "dayjs",
1011
+ "date-fns",
1012
+ "luxon",
1013
+ "winston",
1014
+ "pino",
1015
+ "bunyan",
1016
+ "loglevel",
1017
+ "lodash",
1018
+ "lodash-es",
1019
+ "ramda",
1020
+ "rxjs",
1021
+ "fp-ts",
1022
+ "neverthrow",
1023
+ "ts-results",
1024
+ "purify-ts"
1025
+ ],
1026
+ "CSV は effect/encoding の Csv だけで読み書きする": [
1027
+ "papaparse",
1028
+ "csv-parse",
1029
+ "csv-parser",
1030
+ "csv-stringify",
1031
+ "fast-csv",
1032
+ "@fast-csv/*",
1033
+ "d3-dsv"
1034
+ ],
1035
+ "フィーチャーフラグは OpenFeature だけで扱う": [
1036
+ "launchdarkly-*",
1037
+ "@launchdarkly/*",
1038
+ "@growthbook/*",
1039
+ "unleash-client",
1040
+ "flagsmith",
1041
+ "@vercel/flags"
1042
+ ],
1043
+ "テストは Vitest と Playwright だけで扱う": [
1044
+ "jest",
1045
+ "jest-*",
1046
+ "@jest/*",
1047
+ "ts-jest",
1048
+ "mocha",
1049
+ "jasmine",
1050
+ "jasmine-core",
1051
+ "ava",
1052
+ "cypress",
1053
+ "tap",
1054
+ "uvu"
1055
+ ],
1056
+ "決済は Stripe だけで扱う": [
1057
+ "@paypal/*",
1058
+ "paypal-rest-sdk",
1059
+ "braintree",
1060
+ "@paddle/*",
1061
+ "@lemonsqueezy/*",
1062
+ "square"
1063
+ ],
1064
+ "整形は Vite+ の vp fmt だけで扱う": [
1065
+ "prettier",
1066
+ "prettier-plugin-*",
1067
+ "@prettier/*",
1068
+ "@biomejs/*",
1069
+ "dprint"
1070
+ ],
1071
+ "lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む": [
1072
+ "eslint",
1073
+ "@eslint/*",
1074
+ "eslint-config-*",
1075
+ "tslint",
1076
+ "standard",
1077
+ "xo"
1078
+ ],
1079
+ [INSTRUMENTATION]: [
1080
+ "@opentelemetry/*",
1081
+ "dd-trace",
1082
+ "newrelic"
1083
+ ],
1084
+ [INFRASTRUCTURE]: [
1085
+ "wrangler",
1086
+ "miniflare",
1087
+ "@cloudflare/vite-plugin",
1088
+ "@vercel/*",
1089
+ "@netlify/*",
1090
+ "aws-cdk",
1091
+ "aws-cdk-lib",
1092
+ "@pulumi/*",
1093
+ "cdktf"
1094
+ ]
1095
+ };
1096
+ // src/features/lint-preset/config/traced-rules.config.ts
1097
+ const tracedRules = {
1098
+ "msch-lint/traced-elysia": "error",
1099
+ "msch-lint/traced-effect-run": "error"
1100
+ };
1101
+ // src/features/lint-preset/config/fsd-rules.ts
1102
+ const steigerRules = [...fsd.configs.recommended, { rules: {
1103
+ "fsd/insignificant-slice": "off",
1104
+ "fsd/no-cross-imports": "error",
1105
+ "fsd/no-higher-level-imports": "error",
1106
+ "fsd/no-wildcard-exports": "error"
1107
+ } }];
1108
+ export { lint as a, decisionRules as c, decision_rules_default as d, alchemyOverride as f, removalPolicySyntax as g, removalPolicyOverride as h, requiredStack as i, decisionTestRules as l, commandsOverride as m, tracedRules as n, readonlyParameterAllow as o, cloudflareResourceSyntax as p, INSTRUMENTATION as r, allRulesOf as s, steigerRules as t, generated as u };
1109
+
1110
+ //# sourceMappingURL=lint-preset-DM15aUhX.mjs.map