@rexezuge/tooling 0.0.0-stage → 1.0.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.
Files changed (160) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +297 -2
  3. package/dist/eslint.d.ts +120 -0
  4. package/dist/eslint.d.ts.map +1 -0
  5. package/dist/eslint.js +551 -0
  6. package/dist/eslint.js.map +1 -0
  7. package/dist/functions/pages-proxy.d.ts +113 -0
  8. package/dist/functions/pages-proxy.d.ts.map +1 -0
  9. package/dist/functions/pages-proxy.js +131 -0
  10. package/dist/functions/pages-proxy.js.map +1 -0
  11. package/dist/index.d.ts +31 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +28 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/scripts/backup/d1-target.d.ts +35 -0
  16. package/dist/scripts/backup/d1-target.d.ts.map +1 -0
  17. package/dist/scripts/backup/d1-target.js +31 -0
  18. package/dist/scripts/backup/d1-target.js.map +1 -0
  19. package/dist/scripts/backup/destination-config.d.ts +61 -0
  20. package/dist/scripts/backup/destination-config.d.ts.map +1 -0
  21. package/dist/scripts/backup/destination-config.js +57 -0
  22. package/dist/scripts/backup/destination-config.js.map +1 -0
  23. package/dist/scripts/backup/encrypt-backup.d.ts +35 -0
  24. package/dist/scripts/backup/encrypt-backup.d.ts.map +1 -0
  25. package/dist/scripts/backup/encrypt-backup.js +98 -0
  26. package/dist/scripts/backup/encrypt-backup.js.map +1 -0
  27. package/dist/scripts/backup/naming.d.ts +44 -0
  28. package/dist/scripts/backup/naming.d.ts.map +1 -0
  29. package/dist/scripts/backup/naming.js +58 -0
  30. package/dist/scripts/backup/naming.js.map +1 -0
  31. package/dist/scripts/check-god-files.d.ts +164 -0
  32. package/dist/scripts/check-god-files.d.ts.map +1 -0
  33. package/dist/scripts/check-god-files.js +271 -0
  34. package/dist/scripts/check-god-files.js.map +1 -0
  35. package/dist/scripts/ensure-spa-shell-stub.d.ts +3 -0
  36. package/dist/scripts/ensure-spa-shell-stub.d.ts.map +1 -0
  37. package/dist/scripts/ensure-spa-shell-stub.js +30 -0
  38. package/dist/scripts/ensure-spa-shell-stub.js.map +1 -0
  39. package/dist/scripts/init-secrets.d.ts +63 -0
  40. package/dist/scripts/init-secrets.d.ts.map +1 -0
  41. package/dist/scripts/init-secrets.js +240 -0
  42. package/dist/scripts/init-secrets.js.map +1 -0
  43. package/dist/scripts/lib/cli-args.d.ts +78 -0
  44. package/dist/scripts/lib/cli-args.d.ts.map +1 -0
  45. package/dist/scripts/lib/cli-args.js +116 -0
  46. package/dist/scripts/lib/cli-args.js.map +1 -0
  47. package/dist/scripts/lib/github-actions.d.ts +26 -0
  48. package/dist/scripts/lib/github-actions.d.ts.map +1 -0
  49. package/dist/scripts/lib/github-actions.js +38 -0
  50. package/dist/scripts/lib/github-actions.js.map +1 -0
  51. package/dist/scripts/lib/wrangler-table.d.ts +46 -0
  52. package/dist/scripts/lib/wrangler-table.d.ts.map +1 -0
  53. package/dist/scripts/lib/wrangler-table.js +99 -0
  54. package/dist/scripts/lib/wrangler-table.js.map +1 -0
  55. package/dist/scripts/migrations-lock.d.ts +3 -0
  56. package/dist/scripts/migrations-lock.d.ts.map +1 -0
  57. package/dist/scripts/migrations-lock.js +46 -0
  58. package/dist/scripts/migrations-lock.js.map +1 -0
  59. package/dist/scripts/prepare-wrangler-config.d.ts +3 -0
  60. package/dist/scripts/prepare-wrangler-config.d.ts.map +1 -0
  61. package/dist/scripts/prepare-wrangler-config.js +50 -0
  62. package/dist/scripts/prepare-wrangler-config.js.map +1 -0
  63. package/dist/scripts/spa-shell.d.ts +41 -0
  64. package/dist/scripts/spa-shell.d.ts.map +1 -0
  65. package/dist/scripts/spa-shell.js +155 -0
  66. package/dist/scripts/spa-shell.js.map +1 -0
  67. package/dist/scripts/validate-locales.d.ts +26 -0
  68. package/dist/scripts/validate-locales.d.ts.map +1 -0
  69. package/dist/scripts/validate-locales.js +350 -0
  70. package/dist/scripts/validate-locales.js.map +1 -0
  71. package/dist/scripts/verify-migrations.d.ts +62 -0
  72. package/dist/scripts/verify-migrations.d.ts.map +1 -0
  73. package/dist/scripts/verify-migrations.js +302 -0
  74. package/dist/scripts/verify-migrations.js.map +1 -0
  75. package/dist/scripts/verify-spa-shell.d.ts +3 -0
  76. package/dist/scripts/verify-spa-shell.d.ts.map +1 -0
  77. package/dist/scripts/verify-spa-shell.js +53 -0
  78. package/dist/scripts/verify-spa-shell.js.map +1 -0
  79. package/dist/scripts/wrangler-config/cli.d.ts +22 -0
  80. package/dist/scripts/wrangler-config/cli.d.ts.map +1 -0
  81. package/dist/scripts/wrangler-config/cli.js +51 -0
  82. package/dist/scripts/wrangler-config/cli.js.map +1 -0
  83. package/dist/scripts/wrangler-config/patches.d.ts +51 -0
  84. package/dist/scripts/wrangler-config/patches.d.ts.map +1 -0
  85. package/dist/scripts/wrangler-config/patches.js +140 -0
  86. package/dist/scripts/wrangler-config/patches.js.map +1 -0
  87. package/dist/scripts/wrangler-config/resources.d.ts +70 -0
  88. package/dist/scripts/wrangler-config/resources.d.ts.map +1 -0
  89. package/dist/scripts/wrangler-config/resources.js +290 -0
  90. package/dist/scripts/wrangler-config/resources.js.map +1 -0
  91. package/dist/scripts/wrangler-config/types.d.ts +103 -0
  92. package/dist/scripts/wrangler-config/types.d.ts.map +1 -0
  93. package/dist/scripts/wrangler-config/types.js +49 -0
  94. package/dist/scripts/wrangler-config/types.js.map +1 -0
  95. package/dist/test/integration-migrations.d.ts +167 -0
  96. package/dist/test/integration-migrations.d.ts.map +1 -0
  97. package/dist/test/integration-migrations.js +171 -0
  98. package/dist/test/integration-migrations.js.map +1 -0
  99. package/dist/test/mocks/cloudflare-workers.d.ts +106 -0
  100. package/dist/test/mocks/cloudflare-workers.d.ts.map +1 -0
  101. package/dist/test/mocks/cloudflare-workers.js +90 -0
  102. package/dist/test/mocks/cloudflare-workers.js.map +1 -0
  103. package/dist/vite.d.ts +117 -0
  104. package/dist/vite.d.ts.map +1 -0
  105. package/dist/vite.js +125 -0
  106. package/dist/vite.js.map +1 -0
  107. package/dist/vitest-web.d.ts +73 -0
  108. package/dist/vitest-web.d.ts.map +1 -0
  109. package/dist/vitest-web.js +72 -0
  110. package/dist/vitest-web.js.map +1 -0
  111. package/dist/vitest.d.ts +92 -0
  112. package/dist/vitest.d.ts.map +1 -0
  113. package/dist/vitest.js +128 -0
  114. package/dist/vitest.js.map +1 -0
  115. package/package.json +58 -3
  116. package/src/eslint.test.ts +175 -0
  117. package/src/eslint.ts +640 -0
  118. package/src/functions/pages-proxy.test.ts +72 -0
  119. package/src/functions/pages-proxy.ts +187 -0
  120. package/src/github/actions/retry-step/action.yml +39 -0
  121. package/src/github/actions/setup-env/action.yml +20 -0
  122. package/src/github/dependabot.yml +30 -0
  123. package/src/github/workflows/backup-main.yml +46 -0
  124. package/src/github/workflows/continuous-deployment.yml +188 -0
  125. package/src/github/workflows/continuous-integration.yml +259 -0
  126. package/src/github/workflows/scheduled-version-update.yml +38 -0
  127. package/src/github/workflows/upstream-sync.yml +56 -0
  128. package/src/index.ts +42 -0
  129. package/src/scripts/backup/backup-rules.test.ts +105 -0
  130. package/src/scripts/backup/d1-target.ts +54 -0
  131. package/src/scripts/backup/destination-config.ts +92 -0
  132. package/src/scripts/backup/encrypt-backup.ts +107 -0
  133. package/src/scripts/backup/naming.ts +62 -0
  134. package/src/scripts/check-god-files.test.ts +131 -0
  135. package/src/scripts/check-god-files.ts +327 -0
  136. package/src/scripts/ensure-spa-shell-stub.ts +34 -0
  137. package/src/scripts/init-secrets.ts +265 -0
  138. package/src/scripts/lib/cli-args.ts +154 -0
  139. package/src/scripts/lib/github-actions.ts +41 -0
  140. package/src/scripts/lib/wrangler-table.ts +105 -0
  141. package/src/scripts/migrations-lock.ts +52 -0
  142. package/src/scripts/prepare-wrangler-config.ts +51 -0
  143. package/src/scripts/spa-shell.test.ts +91 -0
  144. package/src/scripts/spa-shell.ts +179 -0
  145. package/src/scripts/validate-locales.test.ts +89 -0
  146. package/src/scripts/validate-locales.ts +380 -0
  147. package/src/scripts/verify-migrations.test.ts +71 -0
  148. package/src/scripts/verify-migrations.ts +364 -0
  149. package/src/scripts/verify-spa-shell.ts +56 -0
  150. package/src/scripts/wrangler-config/cli.ts +51 -0
  151. package/src/scripts/wrangler-config/patches.ts +157 -0
  152. package/src/scripts/wrangler-config/resources.ts +330 -0
  153. package/src/scripts/wrangler-config/types.ts +113 -0
  154. package/src/test/integration-migrations.test.ts +169 -0
  155. package/src/test/integration-migrations.ts +267 -0
  156. package/src/test/mocks/cloudflare-workers.ts +115 -0
  157. package/src/vite.test.ts +83 -0
  158. package/src/vite.ts +202 -0
  159. package/src/vitest-web.ts +109 -0
  160. package/src/vitest.ts +185 -0
package/dist/eslint.js ADDED
@@ -0,0 +1,551 @@
1
+ /**
2
+ * The converged ESLint flat config for a monorepo in the Rexezuge family.
3
+ *
4
+ * Provenance: the base is Durable-DAV's `eslint.config.mjs` (380+ lines, the most
5
+ * elaborate of the nine repos, with the layered `no-restricted-imports` boundary
6
+ * rules). Merged in from the other three stacks that share the same plugin set:
7
+ *
8
+ * - **Edge-Sonic** — `test/**` is *not* ignored (it is linted like everything else,
9
+ * with a narrow override block for Vitest idioms), and
10
+ * `unicorn/prefer-ternary` is off. Edge-Sonic's per-rule "deliberately does not
11
+ * follow" block is carried over verbatim in spirit: each entry is off because
12
+ * complying would make the code worse for what the project is, and each is
13
+ * listed rather than dropped so the decision stays reviewable.
14
+ * - **Mail-Meow** — `prettier/prettier` is an **error**, not a warning.
15
+ * - **Mail-Meow** — `prettier/prettier` is an **error**, not a warning.
16
+ * - **AWS-AccessBridge** — the `apps/api` DAO/service boundary uses
17
+ * `allowTypeImports` where the source repos do. It is also the source for the
18
+ * anchored skip patterns and the symlink-safe walk that came out of its own backlog.
19
+ * - **Edge-Sonic** — `test/**` is *not* ignored (it is linted like everything else,
20
+ * with a narrow override block for Vitest idioms), `unicorn/prefer-ternary` is off
21
+ * with a documented reason, and the `import()` hole in `no-restricted-imports` is
22
+ * covered by a matching `no-restricted-syntax` rule. Edge-Sonic's per-rule
23
+ * "deliberately does not follow" block is carried over verbatim in spirit: each
24
+ * entry is off because complying would make the code worse for what the project
25
+ * is, and each is listed rather than dropped so the decision stays reviewable.
26
+ *
27
+ * Canonical decisions, and why each one:
28
+ *
29
+ * 1. **`prettier/prettier: 'error'`.** Three of the four source repos had it at
30
+ * `warn`, which under `eslint --quiet` is unenforceable — a gate nobody can see
31
+ * is a gate that has never run. Formatting drift is therefore a hard failure.
32
+ * 2. **The layered boundary rules are parameterized by `scope`.** Every source
33
+ * repo wrote the same seven blocks with a different npm scope hardcoded; the
34
+ * factory takes `scope` (`'@myapp'`) and generates the `@myapp/*` patterns.
35
+ * 3. **`test/**` is linted, not ignored.** Durable-DAV/AWS/Mail-Meow ignored it;
36
+ * Edge-Sonic does not, and records why: ~200 KB of test code had accumulated
37
+ * violations that nothing reported.
38
+ * 4. **`apps/web` is a layer in its own right**, banned from every `@scope/*`
39
+ * package. Edge-Sonic is the only source with that block; the others had none,
40
+ * which is how their layer table's "may import: the browser" was a convention
41
+ * rather than a gate. A backend package imported by the SPA compiles and then
42
+ * fails at bundle time, with the error pointing at the bundler.
43
+ * 5. **jsdom + node globals for web files.** The sources ran `globals.node` only;
44
+ * `apps/web` needs browser globals as well, and the vitest config for the SPA
45
+ * runs under jsdom, so the lint environment matches the test environment.
46
+ * 6. **`eslint-plugin-react-hooks` is NOT imported here.** The kit stays
47
+ * zero-dependency, and the plugin belongs to the app that has JSX. A consumer
48
+ * appends it — the README shows the four lines.
49
+ *
50
+ * The consumer's repo-level `eslint.config.mjs` becomes four lines, and a repo that
51
+ * needs a boundary the canonical table does not name passes `extraLayers` — see
52
+ * {@link RepoLintConfigOptions}.
53
+ */
54
+ import globals from 'globals';
55
+ import tseslint from 'typescript-eslint';
56
+ import unicorn from 'eslint-plugin-unicorn';
57
+ import { configs as sonarjsConfigs } from 'eslint-plugin-sonarjs';
58
+ import pluginRegexp from 'eslint-plugin-regexp';
59
+ import eslintConfigPrettier from 'eslint-config-prettier';
60
+ import prettier from 'eslint-plugin-prettier';
61
+ /**
62
+ * Bridge a third-party preset into `tseslint.config()`.
63
+ *
64
+ * `sonarjs`' `recommended` preset is typed as a union that includes the legacy
65
+ * config shape, which `tseslint.config()` does not accept — but ESLint accepts it
66
+ * at runtime, which is the only thing that matters here. One checked assertion,
67
+ * rather than forking the plugin's own types.
68
+ */
69
+ function asConfig(config) {
70
+ return config;
71
+ }
72
+ /**
73
+ * The directories the boundary rules cover, in the canonical layout.
74
+ */
75
+ const DEFAULT_PROJECT_DIRS = [
76
+ 'packages/shared',
77
+ 'packages/backend-errors',
78
+ 'packages/backend-runtime',
79
+ 'packages/backend-data',
80
+ 'packages/backend-services',
81
+ 'apps/api',
82
+ 'apps/background',
83
+ 'apps/web',
84
+ ];
85
+ /**
86
+ * The layer table, parameterized by `scope`.
87
+ *
88
+ * Each entry reproduces the corresponding block in Durable-DAV's
89
+ * `eslint.config.mjs` with `@durable-dav/` replaced by the caller's scope. The
90
+ * table is data rather than seven inline blocks so the dynamic-`import()` guard
91
+ * below can be generated from the same list — a rule that derived its banned set
92
+ * from another rule's configuration would be a second source of truth for the
93
+ * layer table, and that table is what the docs describe.
94
+ */
95
+ function layerBans(scope) {
96
+ const at = (name) => `${scope}/${name}`;
97
+ return [
98
+ {
99
+ dir: 'packages/shared',
100
+ ban: [at('*')],
101
+ message: `${scope} packages must not import from other ${scope} packages — this is a zero-dependency base layer`,
102
+ },
103
+ {
104
+ dir: 'packages/backend-errors',
105
+ ban: [at('*')],
106
+ message: `${scope} packages must not import from other ${scope} packages — this is a zero-dependency base layer`,
107
+ },
108
+ {
109
+ dir: 'packages/backend-runtime',
110
+ ban: [at('backend-data'), at('webdav'), at('backend-services'), at('api'), at('background')],
111
+ message: 'backend-runtime must not import from a higher layer',
112
+ },
113
+ {
114
+ dir: 'packages/backend-data',
115
+ ban: [at('backend-runtime'), at('webdav'), at('backend-services'), at('api'), at('background')],
116
+ message: 'backend-data must not import from a higher layer',
117
+ },
118
+ {
119
+ dir: 'packages/backend-services',
120
+ ban: [at('api'), at('background')],
121
+ message: 'backend-services must not import from apps',
122
+ },
123
+ {
124
+ dir: 'apps/api',
125
+ ban: [at('backend-data/dao'), at('backend-data')],
126
+ allowTypeImports: true,
127
+ message: 'apps/api must not import DAOs or backend-data values directly; use backend-services instead',
128
+ },
129
+ {
130
+ dir: 'apps/background',
131
+ ban: [at('api')],
132
+ message: 'apps/background must not import from apps/api',
133
+ },
134
+ // The browser half, and the only layer that bans the namespace wholesale
135
+ // rather than a list of siblings: a backend package imported by the SPA
136
+ // typechecks and then fails at bundle time, with the error pointing at the
137
+ // bundler rather than at the boundary. Edge-Sonic is the source; the others had
138
+ // no block for it at all, which is how their layer table's "may import: the
139
+ // browser" was a convention instead of a gate.
140
+ {
141
+ dir: 'apps/web',
142
+ ban: [at('*')],
143
+ message: `${at('apps/web')} ships zero backend dependencies — this module is the SPA's own copy`,
144
+ },
145
+ ];
146
+ }
147
+ /**
148
+ * The `no-restricted-imports` entries for one layer.
149
+ *
150
+ * Written as `group` patterns rather than exact `paths`, so `@myapp/backend-data`
151
+ * and `@myapp/backend-data/dao` are both caught by one entry. `allowTypeImports`
152
+ * is passed through only where the source repos set it, because
153
+ * `apps/api` legitimately types its filters and models against DAO shapes.
154
+ */
155
+ function restrictedImports(bans) {
156
+ return bans.map(({ dir, ban, message, allowTypeImports }) => ({
157
+ files: [`${dir}/**/*.{ts,js,mts,cts,mjs,cjs}`],
158
+ rules: {
159
+ 'no-restricted-imports': [
160
+ 'error',
161
+ {
162
+ patterns: ban.map((group) => ({
163
+ group: [group, `${group}/*`],
164
+ message,
165
+ ...(allowTypeImports === true && { allowTypeImports: true }),
166
+ })),
167
+ },
168
+ ],
169
+ },
170
+ }));
171
+ }
172
+ /**
173
+ * The dynamic-`import()` guard, generated from the same table.
174
+ *
175
+ * `no-restricted-imports` reads `ImportDeclaration` nodes only; a dynamic
176
+ * `import()` is an `ImportExpression`, and this ESLint version does not report it
177
+ * under that rule at all. Edge-Sonic verified this rather than assumed it — a
178
+ * static import of a restricted specifier from the same file is an `error`, and
179
+ * the identical specifier reached through `await import(...)` is silent. That
180
+ * hole was load-bearing there: the credential path reached a banned module
181
+ * through it. `no-restricted-syntax` sees `ImportExpression`, so the boundary is
182
+ * stated a second way.
183
+ *
184
+ * The specifier list is duplicated from the layer table on purpose; see the
185
+ * comment on `layerBans`.
186
+ */
187
+ function restrictedDynamicImports(bans) {
188
+ return bans.map(({ dir, ban, message }) => ({
189
+ files: [`${dir}/**/*.{ts,js,mts,cts,mjs,cjs}`],
190
+ rules: {
191
+ 'no-restricted-syntax': [
192
+ 'error',
193
+ ...ban.map((specifier) => ({
194
+ selector: `ImportExpression[source.type='Literal'][source.value=/^${specifier.replaceAll('/', '\\/')}/]`,
195
+ message: `A dynamic import() is not covered by no-restricted-imports, so this layer reaches \`${specifier}\` through the one syntax that gate does not see. Both say no: ${message}`,
196
+ })),
197
+ ],
198
+ },
199
+ }));
200
+ }
201
+ /**
202
+ * Build the repo's flat config.
203
+ *
204
+ * Consumed from the repo root as three lines:
205
+ *
206
+ * ```js
207
+ * // eslint.config.mjs
208
+ * import { defineRepoLintConfig } from '@rexezuge/tooling/eslint';
209
+ * export default defineRepoLintConfig({ scope: '@myapp' });
210
+ * ```
211
+ */
212
+ export function defineRepoLintConfig(options) {
213
+ const { scope } = options;
214
+ const projectDirs = options.projectDirs ?? DEFAULT_PROJECT_DIRS;
215
+ const canonical = layerBans(scope).filter((layer) => projectDirs.some((dir) => layer.dir.startsWith(dir)));
216
+ const extra = options.extraLayers ?? [];
217
+ const bans = [...canonical, ...extra];
218
+ return tseslint.config({
219
+ ignores: [
220
+ 'eslint.config.mjs',
221
+ 'eslint.config.js',
222
+ 'scripts/**',
223
+ 'worker-configuration.d.ts',
224
+ 'local/**',
225
+ 'app/dist/**',
226
+ 'apps/web/dist/**',
227
+ 'apps/*/dist/**',
228
+ 'src/generated/**',
229
+ 'apps/api/src/generated/**',
230
+ 'coverage/**',
231
+ 'coverage-integration/**',
232
+ 'coverage-web/**',
233
+ 'node_modules/**',
234
+ ...(options.extraIgnores ?? []),
235
+ ],
236
+ },
237
+ // Base: globals for all JS/TS source files. Node is the floor because the
238
+ // scripts and the workers both run on it; the web block below adds browser
239
+ // globals rather than replacing them, so a shared file that touches both
240
+ // (there are several in `shared/`) still lints.
241
+ {
242
+ files: ['**/*.{js,mjs,cjs,ts,mts,cts,tsx,jsx}'],
243
+ languageOptions: {
244
+ globals: globals.node,
245
+ },
246
+ },
247
+ // Type-aware TS rules, scoped to TS files only.
248
+ {
249
+ files: ['**/*.{ts,mts,cts,tsx}'],
250
+ extends: tseslint.configs.recommendedTypeChecked,
251
+ languageOptions: {
252
+ parserOptions: {
253
+ projectService: true,
254
+ tsconfigRootDir: options.tsconfigRootDir ?? process.cwd(),
255
+ },
256
+ },
257
+ },
258
+ // --- typescript-eslint overrides (identical in all four source stacks) ---
259
+ {
260
+ files: ['**/*.{ts,mts,cts,tsx}'],
261
+ rules: {
262
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
263
+ // Allow `void expr` for intentional fire-and-forget in Workers.
264
+ '@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
265
+ // Relax the unsafe-any rules to warn: the external API boundaries
266
+ // (Cloudflare bindings, provider SDKs) are typed `any` upstream, and the
267
+ // alternative is a config that cannot be adopted.
268
+ '@typescript-eslint/no-explicit-any': 'warn',
269
+ '@typescript-eslint/no-unsafe-assignment': 'warn',
270
+ '@typescript-eslint/no-unsafe-member-access': 'warn',
271
+ '@typescript-eslint/no-unsafe-call': 'warn',
272
+ '@typescript-eslint/no-unsafe-return': 'warn',
273
+ '@typescript-eslint/no-unsafe-argument': 'warn',
274
+ // JSX event handlers and hook callback objects commonly use async
275
+ // functions where void is expected.
276
+ '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: { attributes: false, properties: false } }],
277
+ },
278
+ },
279
+ // --- Unicorn: modern JS/TS quality rules ---
280
+ asConfig(unicorn.configs['flat/recommended']), {
281
+ rules: {
282
+ // Codebase uses ctx, req, res, env, err, util, db, dao, etc. — too
283
+ // invasive to rename.
284
+ 'unicorn/prevent-abbreviations': 'off',
285
+ // D1/DAO layer returns null; disabling this avoids mass rewrites.
286
+ 'unicorn/no-null': 'off',
287
+ // Monorepo uses CommonJS-compatible module style in some configs.
288
+ 'unicorn/prefer-module': 'off',
289
+ // Top-level await not available in all Workers entry points.
290
+ 'unicorn/prefer-top-level-await': 'off',
291
+ // Error subclassing via `new MyError()` is intentional in backend-errors.
292
+ 'unicorn/custom-error-definition': 'off',
293
+ // Allow process.exit in build/script files.
294
+ 'unicorn/no-process-exit': 'off',
295
+ // Array reduce is used intentionally in analytics/data transformation.
296
+ 'unicorn/no-array-reduce': 'off',
297
+ // Allow Number() — parseInt/parseFloat are used in some cases intentionally.
298
+ 'unicorn/prefer-number-properties': ['error', { checkInfinity: false }],
299
+ // Allow nested ternaries in JSX (React render patterns).
300
+ 'unicorn/no-nested-ternary': 'off',
301
+ // Allow Array.from — codebase uses it for iterables.
302
+ 'unicorn/prefer-spread': 'off',
303
+ // Entire codebase uses PascalCase for TS files; kebab-case would require
304
+ // mass renames.
305
+ 'unicorn/filename-case': 'off',
306
+ // Established names should not be force-renamed.
307
+ 'unicorn/name-replacements': 'off',
308
+ // Zod schema builder chains and other deep method chains are intentional.
309
+ 'unicorn/max-nested-calls': 'off',
310
+ // import.meta.dirname is not available in all test environments.
311
+ 'unicorn/prefer-import-meta-properties': 'off',
312
+ // Codebase uses `err` as catch parameter name throughout.
313
+ 'unicorn/catch-error-name': 'off',
314
+ // Established boolean param names (retryable, enabled, etc.).
315
+ 'unicorn/consistent-boolean-name': 'off',
316
+ // Uint8Array#toBase64 / fromBase64 are not in all Workers runtime versions.
317
+ 'unicorn/prefer-uint8array-base64': 'off',
318
+ // Class member ordering would require extensive restructuring.
319
+ 'unicorn/consistent-class-member-order': 'off',
320
+ // API response fields use verb prefixes by convention.
321
+ 'unicorn/no-non-function-verb-prefix': 'off',
322
+ // forEach is used intentionally throughout the provider and utility layers.
323
+ 'unicorn/no-for-each': 'off',
324
+ // .then() chains in DAO and provider layers are often intentional.
325
+ 'unicorn/prefer-await': 'warn',
326
+ // Callback references (e.g. .map(Number)) are sometimes intentional.
327
+ 'unicorn/no-array-callback-reference': 'warn',
328
+ // toSorted() is ES2023 and may not be in all tsconfig lib targets.
329
+ 'unicorn/no-array-sort': 'warn',
330
+ // Early-return guard clauses are the established style; the rule only
331
+ // rewrites the final guard of a ladder, which yields asymmetric mixed
332
+ // style and long inline ternaries. Off in Mail-Meow and Edge-Sonic;
333
+ // canonical here because it is the family's established style.
334
+ 'unicorn/prefer-ternary': 'off',
335
+ // `(await x).y` -> a named intermediate. Fires constantly in the tests,
336
+ // where destructuring beside the assertion it serves is clearer.
337
+ 'unicorn/no-await-expression-member': 'off',
338
+ // `Number(x)` over `+x`: the `+` form is used where an explicit typeof
339
+ // check has already narrowed the operand.
340
+ 'unicorn/prefer-number-coercion': 'off',
341
+ // Code-point iteration: the byte-level readers index deliberately,
342
+ // because the offset *is* what they are reading.
343
+ 'unicorn/prefer-code-point': 'off',
344
+ // `if (!x) return;` over a compound condition: one guard per line, each
345
+ // with its own comment, is what keeps endpoint guards readable.
346
+ 'unicorn/prefer-simple-condition-first': 'off',
347
+ // Module-scope `let` assigned from `beforeEach` in the test harnesses.
348
+ 'unicorn/no-top-level-assignment-in-function': 'off',
349
+ // Sequential `for...of` with `await` in the DAOs — D1's subrequest
350
+ // budget is the scarce resource.
351
+ 'unicorn/no-unreadable-for-of-expression': 'off',
352
+ // `Object.hasOwn` over `in`: used where a prototype-chain hit is harmless.
353
+ 'unicorn/no-computed-property-existence-check': 'off',
354
+ // A labeled `break` out of two loops.
355
+ 'unicorn/no-break-in-nested-loop': 'off',
356
+ // `this` outside a class body: the module-level cache singletons
357
+ // document their `this` contract in prose.
358
+ 'unicorn/no-this-outside-of-class': 'off',
359
+ // A class named inside its own static method.
360
+ 'unicorn/class-reference-in-static-methods': 'off',
361
+ // `void promise` where initiating the call is the point and the rejection
362
+ // is handled at a named site elsewhere.
363
+ 'sonarjs/void-use': 'off',
364
+ // An `async` function with no `await`: every handler and DAO method is
365
+ // `async` by shape so a future `await` does not change its signature.
366
+ '@typescript-eslint/require-await': 'off',
367
+ // Backtracking risk in bounded-prefix readers that run over a file the
368
+ // server already chose to fetch, never over a request parameter.
369
+ 'sonarjs/super-linear-regex': 'off',
370
+ // Assigning `globalThis.fetch` in a test — the only way to intercept the
371
+ // ambient fetch in Node without a module mock.
372
+ 'unicorn/no-global-object-property-assignment': 'off',
373
+ // `(a ? b : c) && d`: written longhand so each precedence decision is
374
+ // visible.
375
+ 'unicorn/prefer-logical-operator-over-ternary': 'off',
376
+ // `children[0]` in the XML helpers, which index a child list positionally.
377
+ 'unicorn/better-dom-traversing': 'off',
378
+ // `entries()` -> `keys()`/`values()`: the full entry is destructured.
379
+ 'unicorn/prefer-iterator-to-array': 'off',
380
+ // `.map(fn, thisArg)`: rejected on purpose.
381
+ 'unicorn/no-array-method-this-argument': 'off',
382
+ // A module-scope function that closes over nothing.
383
+ 'unicorn/consistent-function-scoping': 'off',
384
+ // `foo[0] === 'a' || foo[0] === 'b'` written longhand where the
385
+ // alternatives are not adjacent.
386
+ 'unicorn/prefer-includes-over-repeated-comparisons': 'off',
387
+ // A `type` alias over an inline union, where the name is what makes the
388
+ // signature and its doc comment readable.
389
+ 'sonarjs/use-type-alias': 'off',
390
+ // A short local alias for a type imported from a protocol package.
391
+ 'sonarjs/redundant-type-aliases': 'off',
392
+ // `type: value` narrowing the other way, where both spellings appear in
393
+ // the same schema and the code follows whichever the spec uses there.
394
+ 'sonarjs/no-nested-assignment': 'off',
395
+ // `Number.isInteger` plus a separate range check, where the bounds come
396
+ // from the caller's own options in one place.
397
+ 'unicorn/prefer-number-is-safe-integer': 'off',
398
+ // `\u{...}` over a `\xNN` escape: the table is written in the byte form
399
+ // the spec prints.
400
+ 'unicorn/prefer-unicode-code-point-escapes': 'off',
401
+ // `self.x = this.x` in an entry model: the alias makes the verbatim
402
+ // round-trip explicit.
403
+ 'unicorn/no-this-assignment': 'off',
404
+ // Building a `Set` at module scope from a constant list, for O(1)
405
+ // membership on a path that runs per parameter.
406
+ 'unicorn/no-top-level-side-effects': 'off',
407
+ // `await` on a value the types say is not thenable, where the value is a
408
+ // `PromiseLike` from an interface declared that way.
409
+ '@typescript-eslint/await-thenable': 'off',
410
+ // A conditional whose branches are identical, kept where the two branches
411
+ // are named separately to document that they are meant to diverge.
412
+ 'sonarjs/no-all-duplicated-branches': 'off',
413
+ // An `else` after a `return`: the flat form keeps the remaining cases at
414
+ // one indent level in the dispatch tables.
415
+ 'unicorn/prefer-else-if': 'off',
416
+ // A nested ternary in a sort comparator, where the three-way order is the
417
+ // point.
418
+ 'unicorn/prefer-minimal-ternary': 'off',
419
+ // `x === undefined` reported as always-true/false. With
420
+ // `noUncheckedIndexedAccess` on, the guard is exactly right.
421
+ 'sonarjs/different-types-comparison': 'off',
422
+ // An accumulating loop with a sequential `await` in it, over D1 writes.
423
+ 'unicorn/prefer-array-from-async': 'off',
424
+ },
425
+ },
426
+ // --- SonarJS: code smell and bug detection ---
427
+ asConfig(sonarjsConfigs.recommended), {
428
+ rules: {
429
+ // Raise duplicate-string threshold to avoid flagging intentional repeated
430
+ // literals like provider IDs.
431
+ 'sonarjs/no-duplicate-string': ['warn', { threshold: 5 }],
432
+ // Cognitive complexity — warn rather than error, so the ratchet can move
433
+ // without a red build. Raise the number only as files are decomposed.
434
+ 'sonarjs/cognitive-complexity': ['warn', 20],
435
+ // False positives: connection method names like 'imap-password' and
436
+ // field names like 'password_hash'.
437
+ 'sonarjs/no-hardcoded-passwords': 'off',
438
+ // Third-party deprecations are warnings, not errors.
439
+ 'sonarjs/deprecation': 'warn',
440
+ // Nested ternaries in complex data-mapping code.
441
+ 'sonarjs/no-nested-conditional': 'warn',
442
+ // React component props are commonly not marked Readonly<>.
443
+ 'sonarjs/prefer-read-only-props': 'warn',
444
+ // Static readonly properties require invasive refactoring.
445
+ 'sonarjs/public-static-readonly': 'warn',
446
+ // Nested template literals in SQL queries and prompt construction.
447
+ 'sonarjs/no-nested-template-literals': 'warn',
448
+ },
449
+ },
450
+ // --- Regexp: static analysis for regular expressions ---
451
+ asConfig(pluginRegexp.configs['flat/recommended']),
452
+ // --- Prettier: formatting drift is a hard error ---
453
+ //
454
+ // Mail-Meow's decision, adopted repo-wide because the alternative is
455
+ // unenforceable: `pnpm run lint` is `eslint --fix --quiet` in three of the
456
+ // four source repos, and `--quiet` discards every warning, so a
457
+ // `prettier/prettier` *warning* is a silent no-op. 242 files were in that
458
+ // state in Edge-Sonic: the gate had never run.
459
+ asConfig(eslintConfigPrettier), {
460
+ plugins: { prettier },
461
+ rules: {
462
+ 'prettier/prettier': 'error',
463
+ },
464
+ },
465
+ // --- Import direction guardrails (parameterized by scope) ---
466
+ ...restrictedImports(bans), ...restrictedDynamicImports(bans),
467
+ // --- Web: browser globals, matching the jsdom test environment ---
468
+ //
469
+ // The sources linted `apps/web` under `globals.node` only, so `window`,
470
+ // `document` and `localStorage` read as undefined globals. The vitest web
471
+ // config runs those suites under jsdom; the lint environment should agree
472
+ // with the environment the code is executed in, or the rule is reporting
473
+ // something untrue about how the file behaves.
474
+ {
475
+ files: ['apps/web/**/*.{ts,tsx,js,jsx,mts,cts,mjs,cjs}'],
476
+ languageOptions: {
477
+ globals: { ...globals.node, ...globals.browser },
478
+ },
479
+ },
480
+ // --- Test suite ---
481
+ //
482
+ // `test/**` is deliberately NOT in the ignores list above. Durable-DAV,
483
+ // AWS and Mail-Meow all ignored it, and ~200 KB of test code had accumulated
484
+ // violations that nothing reported. This block puts the suite back under the
485
+ // same rules as the rest of the workspace and switches off only the handful
486
+ // whose findings are structural artefacts of test code rather than defects.
487
+ // It does not disable correctness rules: the unused-variable, dead-store,
488
+ // regex and sorting findings in the suite are real and are fixed, not
489
+ // suppressed.
490
+ {
491
+ files: ['test/**/*.{ts,tsx,mts,cts}', '**/*.test.{ts,tsx,mts,cts}', '**/*.spec.{ts,tsx,mts,cts}'],
492
+ rules: {
493
+ // `it('…', async () => …)` is the Vitest idiom.
494
+ '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: { arguments: false, attributes: false } }],
495
+ // Unbound method is a common false positive in mock assertions like
496
+ // expect(fn).toHaveBeenCalledWith(...).
497
+ '@typescript-eslint/unbound-method': 'off',
498
+ // Test helpers and stubs routinely use async functions without await.
499
+ '@typescript-eslint/require-await': 'off',
500
+ // Redundant type constituents appear in typed mock stubs.
501
+ '@typescript-eslint/no-redundant-type-constituents': 'off',
502
+ // `as never` casts are the standard fake-DB double pattern in tests.
503
+ '@typescript-eslint/no-unnecessary-type-assertion': 'off',
504
+ // Promise.withResolvers() and function-scoping refactors are cosmetic.
505
+ 'unicorn/prefer-promise-with-resolvers': 'off',
506
+ 'unicorn/consistent-function-scoping': 'off',
507
+ // Fake-DB builders push-then-return and sort without comparators.
508
+ 'unicorn/no-return-array-push': 'off',
509
+ 'unicorn/require-array-sort-compare': 'off',
510
+ // Iterator-helper rewrites churn test fakes with no runtime benefit.
511
+ 'unicorn/prefer-iterator-helpers': 'off',
512
+ 'unicorn/prefer-iterator-to-array': 'off',
513
+ // String replacement with test-driven values is intentional in assertions.
514
+ 'unicorn/no-unsafe-string-replacement': 'off',
515
+ // Fake-D1 doubles await a DAO thunk and call straight onto the result.
516
+ 'unicorn/no-await-expression-member': 'off',
517
+ // `void promise` marks a deliberately unawaited promise in a test.
518
+ 'sonarjs/void-use': 'off',
519
+ // A test asserting request routing has to name `http://` hosts, and a
520
+ // proxy test has to name a loopback upstream. Both are the subject
521
+ // matter, not leaked configuration. `unicorn/prefer-https` must stay off
522
+ // here and this is not a style preference: it rewrites `http://` to
523
+ // `https://` *inside string literals*, and `--fix` applies it silently.
524
+ 'sonarjs/no-clear-text-protocols': 'off',
525
+ 'sonarjs/no-hardcoded-ip': 'off',
526
+ 'unicorn/prefer-https': 'off',
527
+ // sonarjs/assertions-in-tests fires false positives when test helpers
528
+ // handle assertions indirectly.
529
+ 'sonarjs/assertions-in-tests': 'off',
530
+ // sonarjs/no-extra-arguments fires incorrectly on Vitest mock overloads.
531
+ 'sonarjs/no-extra-arguments': 'off',
532
+ // Union/inline types in test fakes are more readable than aliases.
533
+ 'sonarjs/use-type-alias': 'off',
534
+ // Alphabetical-sort rule fights deterministic fixture ordering.
535
+ 'sonarjs/no-alphabetical-sort': 'off',
536
+ // Repeated string literals in fixtures/assertions are clearer inline.
537
+ 'sonarjs/no-duplicate-string': 'off',
538
+ // Fake-D1 doubles break out of a nested loop to model a statement miss.
539
+ 'unicorn/no-break-in-nested-loop': 'off',
540
+ // Fixtures are naturally built with sort()/for…of over composed expressions.
541
+ 'unicorn/no-array-sort': 'off',
542
+ 'unicorn/no-unreadable-for-of-expression': 'off',
543
+ 'unicorn/no-useless-template-literals': 'off',
544
+ 'unicorn/no-declarations-before-early-exit': 'off',
545
+ 'unicorn/prefer-includes-over-repeated-comparisons': 'off',
546
+ 'sonarjs/prefer-specific-assertions': 'off',
547
+ 'sonarjs/no-inverted-boolean-check': 'off',
548
+ },
549
+ });
550
+ }
551
+ //# sourceMappingURL=eslint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint.js","sourceRoot":"","sources":["../src/eslint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAA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