Repository navigation
style(repo): format the tree with prettier and gate it - #408
Conversation
#402 added a prettier config matched to the house style but reformatted nothing, leaving format:check red on 188 files and therefore ungateable. This runs it and turns the check on, in both places the gate is enforced: the test:release chain and the workflow's lint-and-type-check step. Mechanical, with two exceptions that are not. Eleven eslint-disable directives went stale. Every mobile-nav header wrote its effect as a single line — useEffect(() => { setOpen(false) }, [pathname]) — with "// eslint-disable-next-line react-hooks/set-state-in-effect" above it. Prettier expands the body, so the directive came to sit above "useEffect(() => {" while the setState it suppresses moved two lines down: eleven unused-directive warnings and eleven now-unsuppressed errors. Each directive moved to the line it actually governs, which is also a narrower suppression than before. One integration assertion pinned a line break rather than a fact. fumadocs-site.int.spec.ts asserts the blog routes re-declare "twitter: { card: 'summary_large_image'", guarding a real trap — Next does not inherit nested openGraph/twitter fields from the root layout, and no e2e covers those fields. In [slug]/page.tsx that literal was 126 columns, so prettier split it and the assertion failed while the metadata it guards was untouched. It now matches against whitespace-collapsed source, so it tests the re-declaration instead of the formatting. Nothing else changed behaviour. The full release gate passed on this tree — 391 e2e tests across all five batches, including every visual baseline (102 template snapshots, the blog and landing sets), so the JSX reflow is render-neutral and no baseline needs re-minting on either platform. 379/380 int tests pass, eslint clean, tsc clean, format:check clean. Co-Authored-By: Claude Opus 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedToo many files! This PR contains 189 files, which is 89 over the limit of 100. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (189)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…r adoption, template a11y (#409) Brings main level with dev (137 commits). Headline items: - the component wall no longer crops blocks: per-breakpoint zoom pins the twins' inner layout width at 1280px (#392), and the 640-1023px band gets a 256px frame plus a widened fade (#399). Production was cutting content-quote, content-feature-media and content-feature-split by 88/79/78px on a tablet; measured on the live site, not inferred. Three viewport tests now assert the fit so a curated-at-one-width regression cannot recur silently. - prettier is adopted: config matched to the house style (#402), the tree formatted, and format:check gated in test:release and the CI lint step (#408). - template a11y and layout fixes (#394, #398, #404), consent gate split by provider (#400), axe now waits for the consent banner (#405), CodeQL double-escaping fix (#391). Tree is identical to dev by construction: branched from dev, reparented onto main, so the diff is exactly the main..dev delta with no squash-divergence conflicts.
format:check gates on prettier as of #402/#408, and `pnpm lint` does not cover it — so the privacy page landed unformatted. Reformatted. The intro also still claimed "Nothing loads until you accept", which the cookieless split made false: Vercel Analytics and Speed Insights load for everyone. Now scoped to "nothing that stores anything on your device". Co-Authored-By: Claude Opus 5 <[email protected]>
* privacy(fix): delete GA's cookies when consent is withdrawn Found by checking the live site rather than the code: after resetting consent to a first-visit state, GA4 correctly did not load — but `_ga` and `_ga_EMGRZ0H9R9` were still sitting in the browser from the earlier opt-in. Withdrawal stopped collection and cleared our own pc_distinct_id, but never touched GA's cookies, so the visitor stayed identifiable to Google on their next visit. That is the cookie analogue of the stale-identifier bug fixed earlier, and under GDPR withdrawal should remove the identifiers rather than merely stop processing. clearAnalyticsCookies() expires the `_ga` / `_ga_*` pair (plus legacy `_gid` / `_gat*`) on both denial paths: explicit withdrawal and a GPC/DNT signal arriving after an opt-in. A cookie can only be removed by re-setting it with a matching domain and path, and script cannot read which domain a cookie came from — GA writes `_ga` on the registrable domain — so each plausible domain is tried and the misses are inert. It runs before the existing reload so the tag cannot re-set them on the way out. The spec seeds the cookies by hand instead of waiting for a real googletagmanager fetch, which keeps it deterministic rather than network-flaky, and asserts an unrelated cookie on the same domain survives so the sweep cannot grow into deleting everything. /privacy and contributing.mdx now say withdrawal deletes rather than just stops. Verified: lint clean, tsc clean, 379 int tests, consent + a11y e2e 20/20. Co-Authored-By: Claude Opus 5 <[email protected]> * style(privacy): satisfy prettier and correct the page intro format:check gates on prettier as of #402/#408, and `pnpm lint` does not cover it — so the privacy page landed unformatted. Reformatted. The intro also still claimed "Nothing loads until you accept", which the cookieless split made false: Vercel Analytics and Speed Insights load for everyone. Now scoped to "nothing that stores anything on your device". Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
Follow-up to #402, which added a prettier config matched to the house style but reformatted nothing — leaving
format:checkred on 188 files and therefore impossible to gate. This runs it and turns the check on in both places the gate is enforced: thetest:releasechain and the workflow's lint-and-type-check step.189 files: 93 tsx, 68 ts, 11 md, 11 css, 2 json, 2 html, 1 yml, 1 mjs.
Mechanical, with two exceptions that are not — and both are the argument for doing this deliberately instead of letting it happen inside someone's feature PR.
11 eslint-disable directives went stale
Every mobile-nav header wrote its effect on one line:
Prettier expands the body, so the directive ends up above
useEffect(() => {while thesetStateit suppresses moves two lines down — 11 unused-directive warnings and 11 now-unsuppressed errors. Each directive moved to the line it actually governs, which is also a narrower suppression than before:One integration assertion pinned a line break, not a fact
fumadocs-site.int.spec.tsasserts the blog routes re-declaretwitter: { card: 'summary_large_image'. That guards a real trap: Next does not inherit nestedopenGraph/twitterfields from the root layout, and no e2e covers those fields, so a silent social-card regression is possible.In
[slug]/page.tsxthat literal was 126 columns, so prettier split it across lines and the assertion failed — while the metadata it guards was completely untouched. It now matches against whitespace-collapsed source, testing the re-declaration rather than the formatting.Verification
The full release gate passed on this exact tree (
RELEASE EXIT=0, verified from the captured log rather than a piped exit code):format:checkcleanNote for anyone with an open PR
This touches 189 files, so open branches will need a rebase. The resolution is mechanical: take your own version of the conflicting hunk, then run
pnpm format.