Repository navigation
fix(ci): any lint warning fails the gate, and the repo is formatted to pass it - #313
Conversation
…o their writers `eslint .` exits 0 on warnings, so CI's lint step passed over 1,084 of them, and a real defect (a typed env that applied to nothing) sat among the formatting noise. `--max-warnings 0` goes in the `lint` script rather than in the CI step, so `.claude/skills/pr-prep/check.sh`, which runs `pnpm lint` before a push, holds the same bar CI does. `.prettierignore` names every file a command rewrites: the generated SahajCloud types and translation mirror, the lockfile, #276's redirect map and snapshots (named before they reach main), and the two files copied from claude-workflow, whose canonical text `audit-contracts` compares. `.claude/` is in it too: a repo-wide `prettier --write` would otherwise stall on the Protected Paths guard. Markdown is in it because Prettier rewrites a fenced tsx sample into a statement (`;<Icon … />`) and nothing checks Markdown formatting afterwards. ESLint does not read .gitignore, so with warnings now blocking, every worktree Claude Code checks out under `.claude/worktrees/` failed `pnpm lint` on its own branch's warnings, and `eslint --fix` would rewrite it. `.claude/**` joins ESLint's ignores. `server/payload-types.ts` does too: eslint-plugin- prettier reads .prettierignore, and without it `--fix` strips the file's generated `/* eslint-disable */` as unused. `tests/guards/lint-scope.test.ts` pins both tools' scope. With warnings blocking, `no-console` at `warn` stops meaning "tolerated". Scripts print their output with it, so `scripts/**` turns it off. Stories ship to design.wemeditate.com, so they fall under the repo-wide rule and each log carries its own reason. Tests keep the warning, which now stops a stray debug log landing; `server/` falls back to the repo-wide rule, and its three deliberate logs are handled at the site. The two test files that feed `Badge` and `DropdownItem` a `javascript:` URL join the files that prove `Link`'s gate refuses one. Comments and docs that said warnings exit 0 are brought in line. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
The story logged the token's length and first eight characters to the console on every render, on the public playground at design.wemeditate.com: the class of log #105 removed from a shipped component. The panel above the search already shows whether the token is set, so the log goes. The two callback logs that remain in stories, the selected location and the error boundary's reset, show what the callback receives; each now carries a disable saying so, since stories no longer sit outside `no-console`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
`withRetry` logged a failed attempt with `console.log`, the same level as the request log, so a filter for problems in the Worker's logs missed every read that needed a retry. It is a failure being retried, and Sentry already records it at `warning`, so `console.warn` it is. The recovery line and the `[PayloadCMS]` request log stay `console.log`, each with a disable that says why: neither reports a failure, and the server specs spy on `console.log` for the request log. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
`types/vike.d.ts` imports types, which makes it a module, and a module's top-level `interface ImportMetaEnv` declares a local type rather than merging into the global one Vite reads. So every `import.meta.env.X` stayed vite's `any`: `const n: number = import.meta.env.SAHAJCLOUD_API_KEY` compiled. The only symptom was `no-unused-vars` on the `ImportMeta` wrapper. The interface moves into the file's existing `declare global`, and the redundant `ImportMeta` goes: Vite's own already types `env` as the global `ImportMetaEnv`. `tsc --noEmit` passes with the narrower types, and the probe above is now a type error. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
Four sites no autofix reaches. `LeafDivider`'s story and `MasonryGrid` import a name they never use. `Logo` destructures the anchor-only props only to keep them off its `<div>`, so the line carries a disable saying so. `LayoutBlock` destructured `useColumnsOnDesktop` and never read it; it leaves the destructure, and the prop stays on the interface for whoever implements it. `Logo` and `LayoutBlock` are only quieted here, with no change in behaviour. The typed split for `Logo` and what `useColumnsOnDesktop: false` should draw are other changes' work. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
Mechanical, and nothing else: run on the tree the commits before it leave, with `.prettierignore` in force, it takes `pnpm lint` from 1,038 autofixable warnings in 130 files (586 prettier, 388 perfectionist/sort-jsx-props, 64 padding-line-between-statements) to none, and `prettier --check .` from 110 files to none. `perfectionist/sort-jsx-props` reorders props only between spreads, so no override order changes. The built CSS is byte-identical to the build from the unformatted stylesheets. Regenerate rather than rebase this commit: on a fresh main, drop it, rebase the commits before it, then run the same two commands and commit the result. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
|
🤖 no session running Written by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The split is right: one mechanical tip over five small hand-written commits, and a recipe that names no SHA. The two claims that would hurt if wrong both hold — no prop crosses a spread (Spacer swaps aria-hidden and className, both still ahead of {...props}), and every file:line the body cites resolves. The gap is the opposite of scope creep: the stricter gate stops short of what the reformat touched, and .prettierignore names .claude/ for the Protected Paths reason while the same commit reformats .mcp.json.
Findings
- should-fix —
.prettierignoremisses.mcp.json, a protected path this commit reformats. (.prettierignore:27) - consider — the gate enforces Prettier only where ESLint lints, leaving five reformatted files unheld. (
package.json:7) - consider — two ignore entries name paths absent from this branch. (
.prettierignore:16) - consider — a 138-file reformat belongs in
.git-blame-ignore-revs. Only the recipe can record it, since the SHA exists once the commit is regenerated. No thread.
What was checked
Hand-written diff read whole (git diff c4a7927..597e47f, 16 files): .prettierignore, eslint.config.js, package.json, types/vike.d.ts, both server/ log sites, the three disables, lint-scope.test.ts. Ladder: no helper, type or dependency added — the new guard drives ESLint's and Prettier's own APIs. Contracts hold both ways: server/payload-types.ts is ignored by both tools, so --fix cannot strip its generated /* eslint-disable */, and docs/rules/code-comments.md stays byte-comparable for audit-contracts. The mechanical commit was audited by extension (93 tsx, 37 ts, 3 mjs, 3 css, 1 jsonc, 1 json) and by spread, not line by line. git ls-tree found the tracked protected paths and no JS or TS under .claude/, as the body claims.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`.mcp.json` is on Claude Code's Protected Paths list, like `.claude/`, so a repo-wide `prettier --write` on it either stalls an unattended run or answers the guard's prompt with nobody present. The third tracked protected path, `.npmrc`, needs no entry: Prettier infers no parser for it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYdqayMNYnSWuzXukg
ESLint's prettier rule reaches only the files ESLint lints, so the three CSS files, `wrangler.design.jsonc` and `.mcp.json` this repo also formats had nothing checking them and would drift back on the next edit. `pnpm lint` now ends in `prettier --check .`, which makes `.prettierignore` load-bearing. The flag sits in the script, not in CI's step text, so CI's `pnpm lint` step and `.claude/skills/pr-prep/check.sh` hold the same bar with no edit to either, and the second is a protected path. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYdqayMNYnSWuzXukg
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
wemeditate-design | b8ebf22 | Commit Preview URL Branch Preview URL |
Nov 21 2026, 12:01 AM |
|
Pushed 99dd698. Four findings answered, three threads resolved. Adopted
Rebutted
Also merged 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
…ofix Three conflicts, all in files this branch only reformatted, so main's side stands in each: - Logo.tsx: main added the `inline` variant. This branch's own change here, the unused-vars disable on the div destructure, is untouched. - Header.tsx: two comment blocks main rewrote for the mobile header. - HeaderNavDropdown.tsx: main dropped the span anchor and the `className` prop now that Button forwards a ref, and added the chevron. The merge also brings MobileMenu.interaction.test.tsx, whose one padding-line warning fails this branch's `--max-warnings 0` gate. Fixed with `eslint --fix` on that file, so no second repo-wide mechanical commit follows. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWpDsXVSGS55A17pCd
|
Merged
The merge also brought Lean gate on the merge: 0 errors, 0 warnings, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#313 formatted the whole repo and made any lint warning fail the gate, so the three conflicts were formatting against this branch's new code, not two readings of one behaviour. - `components/atoms/Countdown/`: `main` reflowed the atom and its story that no page had ever rendered. This branch replaces that implementation outright, so its side stands and `main`'s reflow is moot. - `components/molecules/index.ts`: `main` dropped the trailing blank line the `LiveSession` export was appended after. Both kept. `perfectionist/sort-jsx-props` and `prettier --check` then reached this branch's own new files for the first time; both are applied by autofix and reorder no prop across a spread. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVTh4weWZoK6hcKdqu
`main` now fails the gate on any lint warning and carries a repo-wide prettier pass (#313). The only textual conflict was `Splash.tsx`, where that pass dropped the blank line after `SplashProps) {` and this branch inserted its loader hooks there. Both sides kept: the hooks stay, and main's formatting holds across the file. Gate on the merge: eslint --max-warnings 0 clean, prettier --check clean, tsc --noEmit clean, vitest 1737 of 1737 passing in 165 files. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVFPdgw8o2b6HXxAEr
#313 and #283 both landed on main and both touched this branch's files. - `Box.tsx`, `Spacer.tsx` (modify/delete): main's change to each was prettier reformatting only, so the deletion stands. - `Logo.tsx`: kept main's `inline` variant and its formatting, and kept this branch's typed `splitAnchorProps`. The `as any` destructure main guarded with an `eslint-disable` is gone, because the typed split is what makes the disable unnecessary. - `types/vike.d.ts`: kept main's move of `ImportMetaEnv` inside `declare global`, and re-applied this branch's `@see` fix to the comment that moved with it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXF1P3KeuL9FKNxXts
#313 reformatted the repo and made any lint warning fail the gate, which touched both of this branch's conflicted files. - `SocialShare.tsx`: the hunk is #313's prop reordering against this branch's removal of `platforms.sort()`. Took main's formatting with this branch's `.map`, so the caller's order survives and the file clears `--max-warnings 0`. Those were the 7 warnings the PR body logged as unfixable on lines it does not write; main has now fixed them. - `DiscoverMeditation.stories.tsx`: main's side is #313 reformatting the old story body, which this branch replaces — `pages` is required now, so `<DiscoverMeditation />` with no props would not typecheck. Took this branch's file. Main carries no `DiscoverMeditation.test.tsx`, so the add/add the PR body anticipated from #288 did not arrive. Lean gate on the merge: lint clean under `--max-warnings 0`, prettier clean, `tsc --noEmit` clean, 164 files / 1706 tests pass. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYq1nwFopvLJWfb9Jv
#313 reformatted the whole repo and made any lint warning fail the gate, so the three conflicts were its prop sorting against this branch's behaviour. Took this branch's side in each and re-ran the formatter over the 14 files, which is what the hunks disagreed about. TechniqueCard also lost `buttonText` here, so the two story call sites keep no such prop. `pnpm lint` passes with --max-warnings 0 for the first time on this branch. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjY6ZuKZDia71RQecDL
submissions/schema.ts ended on a second newline. Lint went red once #313 set --max-warnings 0, which turns prettier/prettier into a failure. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWhMsP61j5GKkGuVZy
#327 made a retried attempt a breadcrumb and the final failure a `captureException`. A mock carrying only `captureMessage` therefore throws inside `withRetry`'s own catch, which aborts the loop after one attempt and reads as a read that never retried — `server/content-index.test.ts` failed exactly that way on the merge. Also formats the branch's files for the warning-free gate #313 introduced. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXv5NZFJUmYG7dNyNq
…lated (#328) * refactor(server): one file per /api route, under server/routes/api server/api-routes.ts held all four same-origin JSON routes. Each now lives in the file its path names, so the folder is the route list: routes/api/related-meditations.ts GET /api/related-meditations/:lectureId routes/api/related-lectures.ts GET /api/related-lectures/:meditationId routes/api/submissions.ts POST /api/submissions routes/api/live-preview/populate.ts POST /api/live-preview/populate What more than one route reads moves to _shared.ts (parseLocale, relatedAnswer) and _proxy-failure.ts (upstreamRefusal, reportProxyFailure). index.ts keeps registerApiRoutes, so entry.ts changes by one import. No behaviour changes: every handler body is moved verbatim, and every existing test case is kept, split beside the file it covers. The new index.test.ts fails a route registered outside the file its path names, a route file that registers nothing, and a file index.ts does not register. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(server): a folder per /api route, holding its test and its own files Each route is now a folder at its path, holding route.ts, route.test.ts and anything only it reads: related-meditations/route.ts GET /api/related-meditations/:lectureId related-lectures/route.ts GET /api/related-lectures/:meditationId submissions/route.ts, schema.ts POST /api/submissions live-preview/populate/route.ts POST /api/live-preview/populate submissionSchema and SUBMISSION_BODY_LIMIT move from server/validation.ts to submissions/schema.ts, since only that route reads them; the zod-validation rule now also loads for a route's schema.ts. Top-level `_` files stay for what several routes share. index.test.ts now maps a path to `<path>/route.ts`, and also fails a file that sits in no route's folder and is not a shared `_` file. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(server): move the route-tree guard to tests/guards index.test.ts was a guard — a prose rule held by a test — sitting inside the folder it audits, while the other twenty live in tests/guards/ with shared plumbing in _source-scan.ts and two of them cited by AGENTS.md at that path. Keeping this one next to its subject made a second convention for the same kind of check. It globs ../../server/routes/api/**/*.ts from there and strips that prefix off each key, so a reported path still reads as the folder does. Checked that it still fails on a stray file and on a misplaced route path. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXkzgLHTsVGKfpM6Gf * docs(server): cut the route convention to its rule The section retold what the code and the guard already hold: the path-to-file example, the register signature, and a last sentence listing the three cases the guard fails on. A check that enforces a rule gets one pointer, never its cases. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXkzgLHTsVGKfpM6Gf * fix(server): give parseLocale a home beside isLocale parseLocale is isLocale plus a default, and both the narrowing and the 'en' it falls back to already live in sahajcloud-types.ts, where the default is named DEFAULT_LOCALE. It is reusable there by name. What stays behind is relatedAnswer, for the two related-* routes, so the file takes their name: _shared said only that something shared it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXkzgLHTsVGKfpM6Gf * fix(server): one owner for the short JSON Cache-Control oembed-routes.ts and the related-* answer each held a byte-identical 'public, max-age=300, stale-while-revalidate=1800'. The split built the shared owner for that value and left its twin next door, so both now read JSON_CACHE_CONTROL from server/cache-headers.ts. The sitemap's longer one stays where it is. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXkzgLHTsVGKfpM6Gf * fix(ci): drop the trailing blank line prettier refuses submissions/schema.ts ended on a second newline. Lint went red once #313 set --max-warnings 0, which turns prettier/prettier into a failure. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWhMsP61j5GKkGuVZy * refactor: move files to their topic folders and import through `@/` The mechanical half of the reorganisation, written by one script so any branch can replay it: - `@/` is the repo root (tsconfig `paths`, and the alias in vite, both vitest configs and Ladle), matching SahajCloud and SahajAtlasWeb. Imports leave a folder through `@/`; inside one they stay `./`. - SahajCloud types leave server/: types/payload/payload-types.ts (the path SahajAtlasWeb uses), types/sahajcloud.ts, types/atlas.ts. - The SahajCloud client and its transport move to server/sahajcloud/. - oembed, sitemap.xml and manifest.webmanifest get route folders under server/routes/, like the /api routes. - lib/ is grouped by topic: a11y, atlas, content, errors, forms, i18n, media, seo, sentry, urls (live-preview as before). The browser Sentry config moves from the repo root to lib/sentry/browser-config.ts, and AudioPlayer's shared playback types to lib/media/audio.ts. - Each template gets its own folder; DESIGN_SYSTEM.md, STORYBOOK.md and MCP_USAGE.md move to docs/. No code changes beyond import specifiers and the paths that name moved files. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(server): browser code reads nothing from server/, and every route has a folder Everything the browser needed from server/ moves to lib/: - the locale constants and rules → lib/i18n/locales.ts - WEB_TRANSLATIONS_SELECT and WebTranslations → lib/i18n/web-translations.ts - ErrorType, readStatus and detectErrorType → lib/errors/error-type.ts - isCanonicalOrigin → lib/seo/canonical-origin.ts With no browser importer left, error-utils.ts reports through @sentry/cloudflare like the rest of server/, instead of @sentry/react. The Ladle build therefore bundles no server/ module, so the Smoke (ladle) WATCH list drops its server/ paths, and the guard now asserts the bundle reaches none. robots.txt, sitemap.xml and manifest.webmanifest each get their own route folder (sitemap-routes.ts held all three), sharing ROOT_FILE_CACHE_CONTROL from server/cache-headers.ts. server/routes/ index.ts registers every route, so entry.ts makes one call, and the route-tree guard now covers the whole of server/routes/. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fixup: drop imports the route split left unused * refactor(server): one file per kind of SahajCloud read, behind server/sahajcloud/index.ts client.ts held every read in 1,030 lines. It splits into pages, documents, lectures, meditations, related, web-config and web-translations, with the select/populate shapes in selects.ts and the shared options and preview retry in query.ts. index.ts is the one entry point, so callers import from '@/server/sahajcloud'; its test moves with it, unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> * build(lint): imports leave a folder through @/, and browser code imports nothing from server/ Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(server): a guide for server/ and one for server/sahajcloud/, and every path the moves changed server/AGENTS.md now covers the route folders, the server-only boundary, the submission proxy and Sentry; the SahajCloud read rules move to server/sahajcloud/AGENTS.md, so they load where the reads are. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(ci): name both stale server/ entries in the Ladle triggers * chore(scripts): keep the move script on the branch, so an open PR can replay it scripts/reorg/ is temporary: it goes once no open PR predates this one. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(scripts): sync-translations writes the moved English mirror Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXrfyf1t8Nft3uZch7 * fix(lint): the component-tree JSDoc sits on the const it documents Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXrfyf1t8Nft3uZch7 * fix(server): getWebConfig bounds its warning through warnOnce Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXrfyf1t8Nft3uZch7 * fix(server): the proxy 400 bound is warnOnce, not a second copy Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXrfyf1t8Nft3uZch7 * fix(server): the atlas reads are exported from the sahajcloud barrel Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXrfyf1t8Nft3uZch7 * fix(server): three split comments name their module, not "above" Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXrfyf1t8Nft3uZch7 * fix(server): three files import one module once Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXrfyf1t8Nft3uZch7 * style(server): rewrap the warning-volume rule at 100 columns Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXrfyf1t8Nft3uZch7 * fix(server): workflow.json names the types file that exists, and reviews lib/sentry/ The generated-file note pointed at server/cms-types.ts, renamed away in #131; app-specific SahajCloud types live in types/sahajcloud.ts. The security-review trigger matched the root sentry.browser.config.ts, which this PR moved to lib/sentry/, so it now names lib/sentry/. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(i18n): screen-reader strings live in the repo, machine-translated Every string only a screen reader speaks moves out of SahajCloud's wm-web-translations into lib/i18n/a11y/<locale>.json: the 60 keys of the ten `a11y` groups, plus the three in-flight keys SahajCloud#1241, #1225 and #1232 were adding (media.a11y.progress, meditation.a11y.finder_region and blocks.a11y.next_session). English is the source; every other locale is machine-translated, and a11y.test.ts refuses a gap, a wrong plural set or a lost placeholder. loadTranslations mounts the request locale's strings at <tab>.a11y over whatever SahajCloud returns, so t('media.a11y.play') call sites are unchanged and SahajCloud's old copies stop mattering before it drops them. The English fallback keeps the visitor's screen-reader language. Only English is imported where a browser can reach it; the other locales load in the server-only catalog. The snapshot and sync:translations drop every `a11y` group. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(i18n): read screen-reader strings only from the repo, with nothing to strip SahajCloud#1246 removes every `a11y` group before this lands, so nothing upstream needs handling: WebTranslations no longer Omits SahajCloud's `a11y`, sync:translations no longer prunes one, and withA11y simply mounts. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(i18n): withA11y takes one type parameter, not two `Base` was only spread, and both call sites named it, so the generic was a cast with extra steps. `base: object` takes any of them, which also drops the `as unknown as` at the English snapshot and the return annotation `loadTranslations` only carried to widen that `.then`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYkcPeZouAmCkwAWh1 * fix(i18n): both bare-read routes mount the screen-reader strings `/manifest.webmanifest` and `/oembed` read SahajCloud directly, and the `TranslationSource` union existed only so they could pass that read to `getT`. It let an `a11y` key type-check at both and render as its key path. They mount the locale's strings instead, so the accessor's type says every string is present again. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYkcPeZouAmCkwAWh1 * fix(i18n): a11yStringsFor resolves without a cache Memoing ten small group spreads sat beside `withA11y` spreading thirteen whole tabs on every request, uncached. `loadTranslations` already memos the whole result per request. The two mount assertions compare by value, since the strings are no longer one shared object per locale. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYkcPeZouAmCkwAWh1 * docs(i18n): the rule names its check, not the check's cases The screen-reader bullet retold `a11y.test.ts`'s assertions, and this file loads in every session. The `eslint-disable` paragraph governs visible copy as much as spoken copy, so it sits above both bullets rather than reading as the second one's tail. `rest-api.md` names `withA11y` rather than `loadTranslations`, now that two routes mount the strings as well. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYkcPeZouAmCkwAWh1 --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: SYDevelopers Bot <[email protected]> Co-authored-by: sydevs-bot <[email protected]>
Summary
For a developer:
pnpm lintnow fails on any warning, both in CI and in the local pre-push gate. Today it exits 0 with 1,087 warnings, so a real defect can hide among the formatting noise. To start the stricter gate green, the repo is reformatted once with ESLint's and Prettier's own fixers. Generated files, copies from other repos, and Markdown are left to their own writers.For a visitor or an editor: nothing changes. The built CSS is byte-identical. JSX props are reordered only between spreads, so no override changes.
Two real fixes come with it:
import.meta.envnow has its declared types. Until now every read wasany.This is a draft and should merge last. The mechanical commit rewrites 138 files that open PRs also touch. Regenerate it at merge time with the recipe below. Do not rebase the mechanical commit.
Regeneration recipe
The mechanical commit is the one whose subject begins
chore: apply. The recipe finds it by that subject rather than by its position, so later review commits may land on top of it, and it names no SHA, so it keeps working each time main moves.Once this merges, any PR still open must run
pnpm exec eslint . --fix && pnpm exec prettier --write .on its branch and commit the result. Otherwise CI fails on its first warning.What changed and why
F5, warnings fail lint. The
lintscript inpackage.json:7is noweslint . --max-warnings 0 && prettier --check ..ci.yml: CI's existingpnpm lintstep, and.claude/skills/pr-prep/check.sh, which runspnpm lintbefore a push and is a protected path.prettier --check .half is from the review (consider). ESLint's prettier rule reaches only the files ESLint lints, so the three CSS files,wrangler.design.jsoncand.mcp.jsonthat the reformat also rewrote had nothing holding them and would drift back on the next edit. The check makes.prettierignoreload-bearing, andlint-scope.test.tsnow pins both halves of the script.pnpm lintexited 1 with "ESLint found too many warnings (maximum: 0)".eslint.config.js, the ref-wiring paragraph indocs/rules/design-system.md, the header oftests/guards/form-atom-refs.test.tsx, and thepnpm lintrow in the README.ESLint ignores
.claude/**(review blocker)..claude/worktrees/, and ESLint, unlike Prettier, does not read.gitignore. Under--max-warnings 0, runningpnpm lintin any checkout that holds such a worktree failed on that worktree's own warnings: the reviewer saw 503 warnings and exit 1 from one nested worktree of main. Runningeslint . --fixthere would also rewrite another session's work.eslint.config.js:129. Nothing tracked under.claude/is JS or TS, so no linted file leaves the lint set..claude/worktrees/other/lib/probe.tsadded (an unused const, aconsole.log, a missing blank line).pnpm lintpasses on it. With the ignore line removed, the same copy fails on the probe (1 error, 2 warnings, exit 1).tests/guards/lint-scope.test.ts, which fails without the line.F5, the new
.prettierignorecovers:server/payload-types.ts(pnpm types:cms),lib/translations.en.json(pnpm sync:translations) andpnpm-lock.yaml.lib/legacy-redirects/map.generated.jsonanddata/legacy-redirects/. They are listed before they reach main so that PR needs no edit here. Itsbuild.test.tscompares the map with the generator's output, so a reformat would break it.sydevs/claude-workflow:docs/rules/code-comments.md, whose canonical blockaudit-contractscompares..github/workflows/workflow-state.yml..claude/and.mcp.json(review should_fix). Claude Code's Protected Paths guard holds every write to these for approval, so an unattendedprettier --write .either stalls or answers that prompt with nobody present..npmrc, the third tracked protected path, needs no entry: Prettier infers no parser for it, whichpnpm exec prettier --check .npmrcreports as an error rather than a reformat.eslint-plugin-prettier reads the same ignore file, so
server/payload-types.tsis also in ESLint'signores(eslint.config.js:125). Without that,--fixstrips the file's generated/* eslint-disable */as unused.Markdown is left out of Prettier (review should_fix).
DESIGN_SYSTEM.md,className="bg-linear-to-b …"becameclassName = '…'. Six samples gained an ASI guard, for example;<Icon icon={HeartIcon} size="md" />indocs/rules/design-system.md, a rule that is injected into every component session.prettier --checkis not in CI.*.mdjoins.prettierignore, and no.mdfile changes in the mechanical commit.lint-scope.test.tspins this withAGENTS.mdanddocs/rules/design-system.md.server/AGENTS.mdlong-line nit moot, because Prettier no longer touches that file.F5, the autofix. I ran
pnpm exec eslint . --fixand thenpnpm exec prettier --write .on current main c4a7927, with the hand-written commits applied first.perfectionist/sort-jsx-props, 64padding-line-between-statements) to 0, andprettier --check .from 110 failing files to 0. The diff is 138 files, +1,458/−1,312.perfectionistreorders props only within a run between spreads, so no override order changes.dist/clientCSS is byte-identical with and without the mechanical commit: sha256 of all 9 CSS assets.wrangler.design.jsoncgains trailing commas, whichpnpm check:wrangleraccepts.F5,
no-console. Under--max-warnings 0,warnno longer means "tolerated", so each tree got an explicit decision:scripts/**:off(eslint.config.js:338). A script's log is its output: stdout,::warning::lines, and the URL CI reads.warn, so a stray debug log now blocks a merge.server/**: falls under the repo-wide rule, which allows onlyerrorandwarn. Its log sites:withRetry's "Request failed (attempt n/m) … retrying" becomesconsole.warn(server/error-utils.ts:179), the same level Sentry already records it at.server/error-utils.ts:160) and the[PayloadCMS]request log (server/sahajcloud-fetch.ts:91) stayconsole.log. Each has a disable that gives the reason. The server specs spy onconsole.logfor the request log.offhad hidden a render-time log of the Mapbox token's length and first 8 characters inLocationSearch.stories.tsx, the same kind of log as fix(location-search): drop the leftover debug console.log of the Mapbox token #105.eslint-disable-next-line no-console -- <reason>, which is howdocs/rules/design-system.mdasks a disable to be written.F5, unused variables.
StoryGridfromLeafDivider.stories.tsxandReactNodefromMasonryGrid.tsx. Neither was used.Logo.tsx, the destructure that only keeps anchor props off the<div>gets a disable with its reason.LayoutBlock.tsx,useColumnsOnDesktopleaves the destructure. There is no rest spread, so behaviour does not change.import.meta.envtyping, found through an unused-vars warning.types/vike.d.tsimports types, it is a module, and its top-levelinterface ImportMetaEnvnever merged into Vite's global. Everyimport.meta.env.Xwas thereforeany.declare global, and the redundantImportMetagoes.const a: number = import.meta.env.SAHAJCLOUD_API_KEYcompiles on main and is TS2322 here.tsc --noEmitpasses with the narrower types.@seetag, so JSDoc no longer folds it into the tag.F5,
dom-no-script-url.Badge.test.tsxandDropdown.test.tsxpass ajavascript:URL to atoms that delegate toLink. Both join the existing file-scopedoffblock forLinkandSocialIcon.The regeneration recipe no longer names SHAs (review should_fix). The earlier recipe cherry-picked four SHAs, and the first force-push of a regeneration orphans them. The recipe now selects the hand-written commits by subject, so it survives a review commit landing on top of the mechanical one, which is what happened here.
Not in this PR
CI's step text stays
pnpm lint. The flag lives in the script, for the reason given above. Adding--max-warnings 0to the step as well would be a harmless duplicate, and ESLint accepts the repeated flag.Logo.tsx's typed split belongs toclaude/chore-remove-unused-components.What
useColumnsOnDesktop: falseshould draw belongs toclaude/feat-layout-block-parity.This PR only silences the warnings for those two, with no change in behaviour. If those branches land first, drop these hunks at regeneration.
No browser or visual check. No visual change is intended. The CSS is byte-identical, and props move only between spreads.
.claude/skills/pr-prep/check.sh's header still implies that lint passes on warnings. It is a protected path, and the script works unchanged because it just runspnpm lint.Markdown formatting is deliberately not enforced. If it is wanted later, a
*.mdoverride withembeddedLanguageFormatting: 'off'would keep the code samples intact.No translation keys are needed upstream.
.git-blame-ignore-revs(review consider): not added. This repo squash-merges —git log --merges origin/mainis empty, and every subject on main ends in(#n). So every commit here collapses into one on main, and that one commit carries the 16 hand-written files as well as the 138 reformatted ones. An entry for it would hide real changes from blame, and its SHA cannot be known before the merge. Splitting the mechanical commit into a PR of its own is what would make the entry work; that is the reviewer's call, not this PR's.The
.mcp.jsonreformat in b4496bd is not reverted. Reverting it means writing a protected path, which an unattended run cannot do. The regeneration recipe drops that commit and.prettierignorethen excludes the file, so the reformat disappears without anyone editing it.Reconciled with open PRs
Main moved during this step: #285 and #306 merged. I regenerated the branch onto c4a7927 with the recipe above, and the hand-written commits replayed without conflict.
Main then moved again, to 73b7553 (#296 and #295). Rather than regenerate a second time, I merged
origin/maininto the branch: it auto-merged, and the 18 files it brought need no reformat, so no second mechanical commit follows it. The table below is unchanged by that merge.Main has since moved to e238e3a, and two further merges followed, again rather than a regeneration. The first brought #315, #320 and #294 in, and
lib/content-blocks.tsconflicted: #294 removed the localSplashBlockFieldsthis branch had only re-wrapped, so main's line stands. The second brought #298 in, andhooks/audio/usePlaylistAudioPlayer.test.tsconflicted: both sides broke the one-linevi.hoistedrecorder into a multi-line object, and main's side carries both changes. Neither merge needs a second mechanical commit, becausepnpm lintexits 0 on the head as it stands. The tables below are unchanged by both.Method:
git diff --name-only origin/main...<branch>, intersected with this branch's 149 files.git merge-tree --write-tree.Branches that share a hand-written file:
claude/feat-layout-block-parity(wave 2, not yet open, stacked on #302)MasonryGrid.tsx,LayoutBlock.tsx,docs/rules/design-system.md,package.jsonMasonryGrid.tsxandLayoutBlock.tsx, which that branch rewrites. At regeneration, keep its side.claude/chore-remove-unused-components(not yet open)Logo.tsx,types/vike.d.tsLogo.tsx: its typed split replaces this disable.types/vike.d.ts: it rewrites the@see env.tsline, while this branch moves the interface intodeclare global. Keep both changes.eslint.config.js(it edits the dangerouslySetInnerHTML block),package.jsoneslint.config.js(a different block)server/error-utils.ts(nearby lines, not the log lines)README.md,package.jsonLogo.tsxLayoutBlock.tsxLayoutBlock.tsx,docs/rules/design-system.mdpackage.jsonBranches that share only mechanically reformatted files. Regenerating this PR absorbs these overlaps. If this merges first, the PR re-runs the two fixers instead.
claude/feat-splash-loader-and-map-searchclaude/feat-discover-and-shareclaude/fix-image-credits-and-galleryclaude/fix-unknown-locale-prefix-404Test results
Run before the two merges recorded above, based on main 73b7553. On the current head d0da7eb the lean gate is green: 0 errors, 0 warnings,
tsc --noEmitclean, and 1,462 of 1,462 tests in 149 files.pnpm buildhas not been re-run since those merges.pnpm lint(eslint . --max-warnings 0 && prettier --check .)tsc --noEmitpnpm build.claude/skills/pr-prep/check.sh --full(covers the four rows above)pnpm exec prettier --check .(now part ofpnpm lint)pnpm ladle:build, thenWRANGLER_SEND_METRICS=false pnpm check:wranglerdist/clientCSS assets have identical sha256 with and without the mechanical committests/guards/lint-scope.test.ts.claude/**and*.mdignores are removedBaseline on main c4a7927, for comparison:
eslint .: 0 errors, 1,087 warnings in 141 files:prettier --list-different .(no ignore file): 137 files.🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjZcE8bs5uRJ6dsg6kw