@r_masseater/msch 0.16.0 → 0.19.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/{problem-xi8VIKs3.mjs → cli-contract-C0YCHq4g.mjs} +21 -5
- package/dist/cli-contract-C0YCHq4g.mjs.map +1 -0
- package/dist/cli.mjs +1230 -435
- package/dist/cli.mjs.map +1 -1
- package/dist/decision-rules.d.mts +3 -2
- package/dist/lint.d.mts +19 -10
- package/dist/lint.mjs +247 -178
- package/dist/lint.mjs.map +1 -1
- package/dist/oxlint.mjs +1 -1
- package/dist/{repository-files-BiKs7S7N.mjs → repository-files-B11FFAIk.mjs} +10 -3
- package/dist/repository-files-B11FFAIk.mjs.map +1 -0
- package/dist/{workspace-aMPb8EA_.mjs → workspace-CMPDXFWk.mjs} +64 -20
- package/dist/workspace-CMPDXFWk.mjs.map +1 -0
- package/dist/workspace-settings.mjs +2 -2
- package/package.json +3 -1
- package/skills/msch-checks/SKILL.md +22 -0
- package/dist/decision-rules-BFywSPLT.d.mts +0 -3
- package/dist/problem-xi8VIKs3.mjs.map +0 -1
- package/dist/repository-files-BiKs7S7N.mjs.map +0 -1
- package/dist/workspace-aMPb8EA_.mjs.map +0 -1
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export { _default as default };
|
|
1
|
+
declare const _default: import("@r_masseater/oxlint-plugin-decision").DecisionPlugin;
|
|
2
|
+
export { _default as default };
|
|
3
|
+
//# sourceMappingURL=decision-rules.d.mts.map
|
package/dist/lint.d.mts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
export declare const generated: string[];
|
|
2
|
+
export declare const allRulesOf: ({ prefix, rules }: Readonly<{
|
|
3
|
+
prefix: string;
|
|
4
|
+
rules: Readonly<Record<string, unknown>>;
|
|
5
|
+
}>) => Readonly<Record<string, "error">>;
|
|
6
|
+
declare const decisionPluginName: string;
|
|
7
|
+
export declare const decisionRules: Readonly<Record<string, "error">>;
|
|
8
|
+
export declare const decisionTestRules: Record<string, "off">;
|
|
2
9
|
export declare const lint: {
|
|
3
10
|
ignorePatterns: string[];
|
|
4
11
|
plugins: ("effecttsgo" | "eslint" | "import" | "jsdoc" | "jsx-a11y" | "node" | "oxc" | "promise" | "react" | "react-perf" | "typescript" | "unicorn")[];
|
|
@@ -87,6 +94,10 @@ export declare const lint: {
|
|
|
87
94
|
message: string;
|
|
88
95
|
}>[];
|
|
89
96
|
}];
|
|
97
|
+
"eslint-js/no-restricted-syntax": ["error", ...Readonly<{
|
|
98
|
+
selector: string;
|
|
99
|
+
message: string;
|
|
100
|
+
}>[]];
|
|
90
101
|
"typescript/prefer-readonly-parameter-types": ["error", {
|
|
91
102
|
ignoreInferredTypes: true;
|
|
92
103
|
allow: ({
|
|
@@ -142,7 +153,7 @@ export declare const lint: {
|
|
|
142
153
|
rules: Readonly<Record<string, "off">>;
|
|
143
154
|
})[];
|
|
144
155
|
settings: {
|
|
145
|
-
[
|
|
156
|
+
[decisionPluginName]: {
|
|
146
157
|
model: string;
|
|
147
158
|
timeoutMs: number;
|
|
148
159
|
ci: string;
|
|
@@ -155,6 +166,10 @@ export declare const lint: {
|
|
|
155
166
|
reportUnusedDisableDirectives: "error";
|
|
156
167
|
};
|
|
157
168
|
};
|
|
169
|
+
export declare const cloudflareResourceSyntax: readonly Readonly<{
|
|
170
|
+
selector: string;
|
|
171
|
+
message: string;
|
|
172
|
+
}>[];
|
|
158
173
|
export declare const removalPolicySyntax: Readonly<{
|
|
159
174
|
selector: string;
|
|
160
175
|
message: string;
|
|
@@ -168,7 +183,7 @@ export declare const alchemyOverride: {
|
|
|
168
183
|
files: string[];
|
|
169
184
|
rules: Readonly<Record<string, ["error", ...unknown[]]>>;
|
|
170
185
|
};
|
|
171
|
-
export declare const
|
|
186
|
+
export declare const commandsOverride: {
|
|
172
187
|
files: string[];
|
|
173
188
|
rules: Readonly<Record<string, "off">>;
|
|
174
189
|
};
|
|
@@ -189,13 +204,6 @@ export declare const restrictedImports: {
|
|
|
189
204
|
message: string;
|
|
190
205
|
}>[];
|
|
191
206
|
};
|
|
192
|
-
export declare const generated: string[];
|
|
193
|
-
export declare const allRulesOf: ({ prefix, rules }: Readonly<{
|
|
194
|
-
prefix: string;
|
|
195
|
-
rules: Readonly<Record<string, unknown>>;
|
|
196
|
-
}>) => Readonly<Record<string, "error">>;
|
|
197
|
-
export declare const decisionRules: Readonly<Record<string, "error">>;
|
|
198
|
-
export declare const decisionTestRules: Record<string, "off">;
|
|
199
207
|
export declare const fsdRules: {
|
|
200
208
|
readonly "fsd/insignificant-slice": "off";
|
|
201
209
|
readonly "fsd/no-cross-imports": "error";
|
|
@@ -226,4 +234,5 @@ export declare const readonlyParameterAllow: ({
|
|
|
226
234
|
package: string;
|
|
227
235
|
name: string;
|
|
228
236
|
})[];
|
|
237
|
+
export {};
|
|
229
238
|
//# sourceMappingURL=lint.d.mts.map
|
package/dist/lint.mjs
CHANGED
|
@@ -11,6 +11,22 @@ 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
13
|
// src/features/lint-preset/config/lint-overrides.config.ts
|
|
14
|
+
const LOGPUSH = "Property[key.name=\"logpush\"]:not([value.value=false])";
|
|
15
|
+
const LOGPUSH_MESSAGE = "Worker には logpush: true を付ける。付けないと、その Worker のログが Logpush に流れない";
|
|
16
|
+
const cloudflareResourceSyntax = [
|
|
17
|
+
{
|
|
18
|
+
selector: `CallExpression[callee.object.name="Workers"][callee.property.name="Worker"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,
|
|
19
|
+
message: LOGPUSH_MESSAGE
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
selector: `CallExpression[callee.object.name="Website"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,
|
|
23
|
+
message: LOGPUSH_MESSAGE
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
selector: "MemberExpression[object.name=\"Rum\"][property.name=\"Site\"]",
|
|
27
|
+
message: "Rum.Site は使わない。CI のトークンに Account Settings Write が要る。Cloudflare API でホストごとに一度サイトを作り、トークンを CF_BEACON_TOKEN に置く"
|
|
28
|
+
}
|
|
29
|
+
];
|
|
14
30
|
const removalPolicySyntax = {
|
|
15
31
|
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)",
|
|
16
32
|
message: "D1 と R2 は作り直すと中身が消えるので、alchemy の RemovalPolicy.protect() を .pipe で付けて置き換えと削除を止める"
|
|
@@ -24,6 +40,7 @@ const alchemyOverride = {
|
|
|
24
40
|
files: ["**/alchemy.run.ts"],
|
|
25
41
|
rules: { "eslint-js/no-restricted-syntax": [
|
|
26
42
|
"error",
|
|
43
|
+
...cloudflareResourceSyntax,
|
|
27
44
|
removalPolicySyntax,
|
|
28
45
|
{
|
|
29
46
|
selector: "CallExpression[callee.name=\"Stack\"]:not([arguments.0.name=\"APP_NAME\"])",
|
|
@@ -39,8 +56,8 @@ const alchemyOverride = {
|
|
|
39
56
|
}
|
|
40
57
|
] }
|
|
41
58
|
};
|
|
42
|
-
const
|
|
43
|
-
files: ["
|
|
59
|
+
const commandsOverride = {
|
|
60
|
+
files: ["bin/**"],
|
|
44
61
|
rules: {
|
|
45
62
|
"node/no-process-env": "off",
|
|
46
63
|
"node/no-sync": "off",
|
|
@@ -48,179 +65,6 @@ const scriptsOverride = {
|
|
|
48
65
|
}
|
|
49
66
|
};
|
|
50
67
|
// src/features/lint-preset/config/lint.config.ts
|
|
51
|
-
const REACT_STATE_HOOKS = [
|
|
52
|
-
"useState",
|
|
53
|
-
"useReducer",
|
|
54
|
-
"createContext",
|
|
55
|
-
"useContext"
|
|
56
|
-
];
|
|
57
|
-
const HAND_WRITTEN_SQL = "SQL を手書きせず Drizzle のクエリビルダーを使う";
|
|
58
|
-
const UI_STATE = "UI 状態は effect-atom だけで扱う";
|
|
59
|
-
const INSTRUMENTATION = "計装は Effect のトレーシングだけで扱う";
|
|
60
|
-
const INFRASTRUCTURE = "インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない";
|
|
61
|
-
const requiredStack = {
|
|
62
|
-
[UI_STATE]: [
|
|
63
|
-
"zustand",
|
|
64
|
-
"jotai",
|
|
65
|
-
"valtio",
|
|
66
|
-
"recoil",
|
|
67
|
-
"mobx",
|
|
68
|
-
"mobx-*",
|
|
69
|
-
"redux",
|
|
70
|
-
"@reduxjs/*",
|
|
71
|
-
"react-redux",
|
|
72
|
-
"xstate",
|
|
73
|
-
"@xstate/*",
|
|
74
|
-
"nanostores",
|
|
75
|
-
"@nanostores/*",
|
|
76
|
-
"@preact/signals*"
|
|
77
|
-
],
|
|
78
|
-
"サーバー状態は TanStack Query と Eden だけで扱う": [
|
|
79
|
-
"swr",
|
|
80
|
-
"react-query",
|
|
81
|
-
"@apollo/*",
|
|
82
|
-
"urql",
|
|
83
|
-
"@urql/*",
|
|
84
|
-
"axios",
|
|
85
|
-
"ky",
|
|
86
|
-
"ofetch",
|
|
87
|
-
"got",
|
|
88
|
-
"node-fetch",
|
|
89
|
-
"graphql-request",
|
|
90
|
-
"@trpc/*"
|
|
91
|
-
],
|
|
92
|
-
"ルーティングとサーバーは TanStack Start と Elysia だけで扱う": [
|
|
93
|
-
"react-router",
|
|
94
|
-
"react-router-dom",
|
|
95
|
-
"next",
|
|
96
|
-
"@remix-run/*",
|
|
97
|
-
"wouter",
|
|
98
|
-
"express",
|
|
99
|
-
"hono",
|
|
100
|
-
"fastify",
|
|
101
|
-
"koa",
|
|
102
|
-
"@nestjs/*"
|
|
103
|
-
],
|
|
104
|
-
"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する": [
|
|
105
|
-
"prisma",
|
|
106
|
-
"@prisma/*",
|
|
107
|
-
"typeorm",
|
|
108
|
-
"sequelize",
|
|
109
|
-
"kysely",
|
|
110
|
-
"knex",
|
|
111
|
-
"@mikro-orm/*",
|
|
112
|
-
"better-sqlite3",
|
|
113
|
-
"pg",
|
|
114
|
-
"mysql2"
|
|
115
|
-
],
|
|
116
|
-
"認証は better-auth だけで扱う": [
|
|
117
|
-
"next-auth",
|
|
118
|
-
"@auth/*",
|
|
119
|
-
"lucia",
|
|
120
|
-
"passport",
|
|
121
|
-
"passport-*",
|
|
122
|
-
"@clerk/*",
|
|
123
|
-
"firebase/auth",
|
|
124
|
-
"@supabase/*"
|
|
125
|
-
],
|
|
126
|
-
"UI は shadcn/ui と Tailwind CSS だけで組む": [
|
|
127
|
-
"@mui/*",
|
|
128
|
-
"antd",
|
|
129
|
-
"@chakra-ui/*",
|
|
130
|
-
"@mantine/*",
|
|
131
|
-
"styled-components",
|
|
132
|
-
"@emotion/*",
|
|
133
|
-
"bootstrap",
|
|
134
|
-
"react-bootstrap"
|
|
135
|
-
],
|
|
136
|
-
"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う": [
|
|
137
|
-
"zod",
|
|
138
|
-
"yup",
|
|
139
|
-
"joi",
|
|
140
|
-
"valibot",
|
|
141
|
-
"arktype",
|
|
142
|
-
"io-ts",
|
|
143
|
-
"superstruct",
|
|
144
|
-
"moment",
|
|
145
|
-
"dayjs",
|
|
146
|
-
"date-fns",
|
|
147
|
-
"luxon",
|
|
148
|
-
"winston",
|
|
149
|
-
"pino",
|
|
150
|
-
"bunyan",
|
|
151
|
-
"loglevel",
|
|
152
|
-
"lodash",
|
|
153
|
-
"lodash-es",
|
|
154
|
-
"ramda",
|
|
155
|
-
"rxjs",
|
|
156
|
-
"fp-ts",
|
|
157
|
-
"neverthrow",
|
|
158
|
-
"ts-results",
|
|
159
|
-
"purify-ts"
|
|
160
|
-
],
|
|
161
|
-
"フィーチャーフラグは OpenFeature だけで扱う": [
|
|
162
|
-
"launchdarkly-*",
|
|
163
|
-
"@launchdarkly/*",
|
|
164
|
-
"@growthbook/*",
|
|
165
|
-
"unleash-client",
|
|
166
|
-
"flagsmith",
|
|
167
|
-
"@vercel/flags"
|
|
168
|
-
],
|
|
169
|
-
[INSTRUMENTATION]: [
|
|
170
|
-
"@opentelemetry/*",
|
|
171
|
-
"dd-trace",
|
|
172
|
-
"newrelic"
|
|
173
|
-
],
|
|
174
|
-
[INFRASTRUCTURE]: [
|
|
175
|
-
"wrangler",
|
|
176
|
-
"miniflare",
|
|
177
|
-
"@cloudflare/vite-plugin",
|
|
178
|
-
"@vercel/*",
|
|
179
|
-
"@netlify/*",
|
|
180
|
-
"aws-cdk",
|
|
181
|
-
"aws-cdk-lib",
|
|
182
|
-
"@pulumi/*",
|
|
183
|
-
"cdktf"
|
|
184
|
-
]
|
|
185
|
-
};
|
|
186
|
-
const requiredStackEntries = Array.flatMap(Record.toEntries(requiredStack), ([message, modules]) => pipe(modules, Array.map((module) => ({
|
|
187
|
-
message,
|
|
188
|
-
module
|
|
189
|
-
}))));
|
|
190
|
-
const requiredStackPaths = Array.map(pipe(requiredStackEntries, Array.filter(({ module }) => !String.includes("*")(module))), ({ message, module }) => ({
|
|
191
|
-
name: module,
|
|
192
|
-
message
|
|
193
|
-
}));
|
|
194
|
-
const requiredStackPatterns = pipe(requiredStackEntries, Array.map(({ message, module }) => {
|
|
195
|
-
if (String.includes("*")(module)) return {
|
|
196
|
-
group: [module, `${module}/**`],
|
|
197
|
-
message
|
|
198
|
-
};
|
|
199
|
-
return {
|
|
200
|
-
group: [`${module}/**`],
|
|
201
|
-
message
|
|
202
|
-
};
|
|
203
|
-
}));
|
|
204
|
-
const restrictedImports = {
|
|
205
|
-
paths: [
|
|
206
|
-
{
|
|
207
|
-
name: "react",
|
|
208
|
-
importNames: [...REACT_STATE_HOOKS],
|
|
209
|
-
message: UI_STATE
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
name: "drizzle-orm",
|
|
213
|
-
importNames: ["sql"],
|
|
214
|
-
message: HAND_WRITTEN_SQL
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
name: "drizzle-orm/sql",
|
|
218
|
-
message: HAND_WRITTEN_SQL
|
|
219
|
-
},
|
|
220
|
-
...requiredStackPaths
|
|
221
|
-
],
|
|
222
|
-
patterns: [...requiredStackPatterns]
|
|
223
|
-
};
|
|
224
68
|
const generated = [
|
|
225
69
|
"**/routeTree.gen.ts",
|
|
226
70
|
"**/generated/**",
|
|
@@ -296,6 +140,11 @@ const BROWSER_HANDLES = [
|
|
|
296
140
|
"MouseEvent",
|
|
297
141
|
"AbortSignal",
|
|
298
142
|
"ImageBitmap",
|
|
143
|
+
"AudioContext",
|
|
144
|
+
"OfflineAudioContext",
|
|
145
|
+
"AnalyserNode",
|
|
146
|
+
"AudioBuffer",
|
|
147
|
+
"AudioBufferSourceNode",
|
|
299
148
|
...WEBGPU_HANDLES
|
|
300
149
|
];
|
|
301
150
|
// src/features/lint-preset/config/readonly-lint-tools.config.ts
|
|
@@ -828,6 +677,225 @@ const readonlyParameterAllow = [
|
|
|
828
677
|
]
|
|
829
678
|
}
|
|
830
679
|
];
|
|
680
|
+
// src/features/lint-preset/config/required-stack.config.ts
|
|
681
|
+
const REACT_STATE_HOOKS = [
|
|
682
|
+
"useState",
|
|
683
|
+
"useReducer",
|
|
684
|
+
"createContext",
|
|
685
|
+
"useContext"
|
|
686
|
+
];
|
|
687
|
+
const HAND_WRITTEN_SQL = "SQL を手書きせず Drizzle のクエリビルダーを使う";
|
|
688
|
+
const UI_STATE = "UI 状態は effect-atom だけで扱う";
|
|
689
|
+
const INSTRUMENTATION = "計装は Effect のトレーシングだけで扱う";
|
|
690
|
+
const INFRASTRUCTURE = "インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない";
|
|
691
|
+
const requiredStack = {
|
|
692
|
+
[UI_STATE]: [
|
|
693
|
+
"zustand",
|
|
694
|
+
"jotai",
|
|
695
|
+
"valtio",
|
|
696
|
+
"recoil",
|
|
697
|
+
"mobx",
|
|
698
|
+
"mobx-*",
|
|
699
|
+
"redux",
|
|
700
|
+
"@reduxjs/*",
|
|
701
|
+
"react-redux",
|
|
702
|
+
"xstate",
|
|
703
|
+
"@xstate/*",
|
|
704
|
+
"nanostores",
|
|
705
|
+
"@nanostores/*",
|
|
706
|
+
"@preact/signals*"
|
|
707
|
+
],
|
|
708
|
+
"サーバー状態は TanStack Query と Eden だけで扱う": [
|
|
709
|
+
"swr",
|
|
710
|
+
"react-query",
|
|
711
|
+
"@apollo/*",
|
|
712
|
+
"urql",
|
|
713
|
+
"@urql/*",
|
|
714
|
+
"axios",
|
|
715
|
+
"ky",
|
|
716
|
+
"ofetch",
|
|
717
|
+
"got",
|
|
718
|
+
"node-fetch",
|
|
719
|
+
"graphql-request",
|
|
720
|
+
"@trpc/*"
|
|
721
|
+
],
|
|
722
|
+
"ルーティングとサーバーは TanStack Start と Elysia だけで扱う": [
|
|
723
|
+
"react-router",
|
|
724
|
+
"react-router-dom",
|
|
725
|
+
"next",
|
|
726
|
+
"@remix-run/*",
|
|
727
|
+
"wouter",
|
|
728
|
+
"express",
|
|
729
|
+
"hono",
|
|
730
|
+
"fastify",
|
|
731
|
+
"koa",
|
|
732
|
+
"@nestjs/*"
|
|
733
|
+
],
|
|
734
|
+
"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する": [
|
|
735
|
+
"prisma",
|
|
736
|
+
"@prisma/*",
|
|
737
|
+
"typeorm",
|
|
738
|
+
"sequelize",
|
|
739
|
+
"kysely",
|
|
740
|
+
"knex",
|
|
741
|
+
"@mikro-orm/*",
|
|
742
|
+
"better-sqlite3",
|
|
743
|
+
"pg",
|
|
744
|
+
"mysql2"
|
|
745
|
+
],
|
|
746
|
+
"認証は better-auth だけで扱う": [
|
|
747
|
+
"next-auth",
|
|
748
|
+
"@auth/*",
|
|
749
|
+
"lucia",
|
|
750
|
+
"passport",
|
|
751
|
+
"passport-*",
|
|
752
|
+
"@clerk/*",
|
|
753
|
+
"firebase/auth",
|
|
754
|
+
"@supabase/*"
|
|
755
|
+
],
|
|
756
|
+
"UI は shadcn/ui と Tailwind CSS だけで組む": [
|
|
757
|
+
"@mui/*",
|
|
758
|
+
"antd",
|
|
759
|
+
"@chakra-ui/*",
|
|
760
|
+
"@mantine/*",
|
|
761
|
+
"styled-components",
|
|
762
|
+
"@emotion/*",
|
|
763
|
+
"bootstrap",
|
|
764
|
+
"react-bootstrap"
|
|
765
|
+
],
|
|
766
|
+
"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う": [
|
|
767
|
+
"zod",
|
|
768
|
+
"yup",
|
|
769
|
+
"joi",
|
|
770
|
+
"valibot",
|
|
771
|
+
"arktype",
|
|
772
|
+
"io-ts",
|
|
773
|
+
"superstruct",
|
|
774
|
+
"moment",
|
|
775
|
+
"dayjs",
|
|
776
|
+
"date-fns",
|
|
777
|
+
"luxon",
|
|
778
|
+
"winston",
|
|
779
|
+
"pino",
|
|
780
|
+
"bunyan",
|
|
781
|
+
"loglevel",
|
|
782
|
+
"lodash",
|
|
783
|
+
"lodash-es",
|
|
784
|
+
"ramda",
|
|
785
|
+
"rxjs",
|
|
786
|
+
"fp-ts",
|
|
787
|
+
"neverthrow",
|
|
788
|
+
"ts-results",
|
|
789
|
+
"purify-ts"
|
|
790
|
+
],
|
|
791
|
+
"CSV は effect/encoding の Csv だけで読み書きする": [
|
|
792
|
+
"papaparse",
|
|
793
|
+
"csv-parse",
|
|
794
|
+
"csv-parser",
|
|
795
|
+
"csv-stringify",
|
|
796
|
+
"fast-csv",
|
|
797
|
+
"@fast-csv/*",
|
|
798
|
+
"d3-dsv"
|
|
799
|
+
],
|
|
800
|
+
"フィーチャーフラグは OpenFeature だけで扱う": [
|
|
801
|
+
"launchdarkly-*",
|
|
802
|
+
"@launchdarkly/*",
|
|
803
|
+
"@growthbook/*",
|
|
804
|
+
"unleash-client",
|
|
805
|
+
"flagsmith",
|
|
806
|
+
"@vercel/flags"
|
|
807
|
+
],
|
|
808
|
+
"テストは Vitest と Playwright だけで扱う": [
|
|
809
|
+
"jest",
|
|
810
|
+
"jest-*",
|
|
811
|
+
"@jest/*",
|
|
812
|
+
"ts-jest",
|
|
813
|
+
"mocha",
|
|
814
|
+
"jasmine",
|
|
815
|
+
"jasmine-core",
|
|
816
|
+
"ava",
|
|
817
|
+
"cypress",
|
|
818
|
+
"tap",
|
|
819
|
+
"uvu"
|
|
820
|
+
],
|
|
821
|
+
"決済は Stripe だけで扱う": [
|
|
822
|
+
"@paypal/*",
|
|
823
|
+
"paypal-rest-sdk",
|
|
824
|
+
"braintree",
|
|
825
|
+
"@paddle/*",
|
|
826
|
+
"@lemonsqueezy/*",
|
|
827
|
+
"square"
|
|
828
|
+
],
|
|
829
|
+
"整形は Vite+ の vp fmt だけで扱う": [
|
|
830
|
+
"prettier",
|
|
831
|
+
"prettier-plugin-*",
|
|
832
|
+
"@prettier/*",
|
|
833
|
+
"@biomejs/*",
|
|
834
|
+
"dprint"
|
|
835
|
+
],
|
|
836
|
+
"lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む": [
|
|
837
|
+
"eslint",
|
|
838
|
+
"@eslint/*",
|
|
839
|
+
"eslint-config-*",
|
|
840
|
+
"tslint",
|
|
841
|
+
"standard",
|
|
842
|
+
"xo"
|
|
843
|
+
],
|
|
844
|
+
[INSTRUMENTATION]: [
|
|
845
|
+
"@opentelemetry/*",
|
|
846
|
+
"dd-trace",
|
|
847
|
+
"newrelic"
|
|
848
|
+
],
|
|
849
|
+
[INFRASTRUCTURE]: [
|
|
850
|
+
"wrangler",
|
|
851
|
+
"miniflare",
|
|
852
|
+
"@cloudflare/vite-plugin",
|
|
853
|
+
"@vercel/*",
|
|
854
|
+
"@netlify/*",
|
|
855
|
+
"aws-cdk",
|
|
856
|
+
"aws-cdk-lib",
|
|
857
|
+
"@pulumi/*",
|
|
858
|
+
"cdktf"
|
|
859
|
+
]
|
|
860
|
+
};
|
|
861
|
+
const requiredStackEntries = Array.flatMap(Record.toEntries(requiredStack), ([message, modules]) => pipe(modules, Array.map((module) => ({
|
|
862
|
+
message,
|
|
863
|
+
module
|
|
864
|
+
}))));
|
|
865
|
+
const requiredStackPaths = Array.map(pipe(requiredStackEntries, Array.filter(({ module }) => !String.includes("*")(module))), ({ message, module }) => ({
|
|
866
|
+
name: module,
|
|
867
|
+
message
|
|
868
|
+
}));
|
|
869
|
+
const requiredStackPatterns = pipe(requiredStackEntries, Array.map(({ message, module }) => {
|
|
870
|
+
if (String.includes("*")(module)) return {
|
|
871
|
+
group: [module, `${module}/**`],
|
|
872
|
+
message
|
|
873
|
+
};
|
|
874
|
+
return {
|
|
875
|
+
group: [`${module}/**`],
|
|
876
|
+
message
|
|
877
|
+
};
|
|
878
|
+
}));
|
|
879
|
+
const restrictedImports = {
|
|
880
|
+
paths: [
|
|
881
|
+
{
|
|
882
|
+
name: "react",
|
|
883
|
+
importNames: [...REACT_STATE_HOOKS],
|
|
884
|
+
message: UI_STATE
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
name: "drizzle-orm",
|
|
888
|
+
importNames: ["sql"],
|
|
889
|
+
message: HAND_WRITTEN_SQL
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
name: "drizzle-orm/sql",
|
|
893
|
+
message: HAND_WRITTEN_SQL
|
|
894
|
+
},
|
|
895
|
+
...requiredStackPaths
|
|
896
|
+
],
|
|
897
|
+
patterns: [...requiredStackPatterns]
|
|
898
|
+
};
|
|
831
899
|
// src/features/lint-preset/config/preset.ts
|
|
832
900
|
const resolved = (specifier) => fileURLToPath(import.meta.resolve(specifier));
|
|
833
901
|
const DECISION_TIMEOUT_MS = 5e4;
|
|
@@ -975,6 +1043,7 @@ const lint = {
|
|
|
975
1043
|
"msch"
|
|
976
1044
|
] }],
|
|
977
1045
|
"eslint/no-restricted-imports": ["error", restrictedImports],
|
|
1046
|
+
"eslint-js/no-restricted-syntax": ["error", ...cloudflareResourceSyntax],
|
|
978
1047
|
"typescript/prefer-readonly-parameter-types": ["error", {
|
|
979
1048
|
ignoreInferredTypes: true,
|
|
980
1049
|
allow: readonlyParameterAllow
|
|
@@ -1001,7 +1070,7 @@ const lint = {
|
|
|
1001
1070
|
],
|
|
1002
1071
|
rules: { "import/no-default-export": "off" }
|
|
1003
1072
|
},
|
|
1004
|
-
|
|
1073
|
+
commandsOverride,
|
|
1005
1074
|
{
|
|
1006
1075
|
files: ["**/vite.config.ts"],
|
|
1007
1076
|
rules: {
|
|
@@ -1011,7 +1080,7 @@ const lint = {
|
|
|
1011
1080
|
}
|
|
1012
1081
|
}
|
|
1013
1082
|
],
|
|
1014
|
-
settings: { [
|
|
1083
|
+
settings: { [decisionPluginName]: {
|
|
1015
1084
|
model: "cloudflare/@cf/qwen/qwen3.8-27b",
|
|
1016
1085
|
timeoutMs: DECISION_TIMEOUT_MS,
|
|
1017
1086
|
ci: "skip"
|
|
@@ -1030,6 +1099,6 @@ const fsdRules = {
|
|
|
1030
1099
|
"fsd/no-higher-level-imports": "error",
|
|
1031
1100
|
"fsd/no-wildcard-exports": "error"
|
|
1032
1101
|
};
|
|
1033
|
-
export { INFRASTRUCTURE, INSTRUMENTATION, alchemyOverride, allRulesOf, decisionRules, decisionTestRules, fsdRules, generated, lint, readonlyParameterAllow, removalPolicyOverride, removalPolicySyntax, requiredStack, restrictedImports
|
|
1102
|
+
export { INFRASTRUCTURE, INSTRUMENTATION, alchemyOverride, allRulesOf, cloudflareResourceSyntax, commandsOverride, decisionRules, decisionTestRules, fsdRules, generated, lint, readonlyParameterAllow, removalPolicyOverride, removalPolicySyntax, requiredStack, restrictedImports };
|
|
1034
1103
|
|
|
1035
1104
|
//# sourceMappingURL=lint.mjs.map
|