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