Skip to content

chore: auto formatter#31018

Open
MohamedH1998 wants to merge 2 commits into
productionfrom
chore/auto-formatter
Open

chore: auto formatter#31018
MohamedH1998 wants to merge 2 commits into
productionfrom
chore/auto-formatter

Conversation

@MohamedH1998
Copy link
Copy Markdown
Contributor

@MohamedH1998 MohamedH1998 commented May 22, 2026

Summary

Adopts Prettier formatting across the MD/MDX/Astro content tree

Screenshots (optional)

Documentation checklist

  • Is there a changelog entry (guidelines)? If you don't add one for something awesome and new (however small) — how will our customers find out? Changelogs are automatically posted to RSS feeds, the Discord, and X.
  • The change adheres to the documentation style guide.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

Open in Devin Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
* @cloudflare/product-owners
/.github/ @cloudflare/content-engineering, @kodster28, @mvvmm, @colbywhite, @ahaywood, @MohamedH1998
package.json @cloudflare/content-engineering
*.astro @cloudflare/content-engineering, @kodster28
/src/content/catalog-models/ @abhishekkankani, @palashgo, @thebongy, @roerohan, @kathayl, @mchenco, @zeke, @superhighfives, @bfirsh, @mattrothenberg, @ethulia, @cloudflare/content-engineering, @cloudflare/product-owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/product-owners
/src/content/compatibility-flags/ @irvinebroque, @mikenomitch, @GregBrimble, @cloudflare/product-owners, @MattieTK
/src/content/docs/logs/ @soheiokamoto, @angelampcosta, @rianvdm, @dcpena, @cloudflare/product-owners
/src/content/docs/realtime/ @cloudflare/product-owners, @cloudflare/realtime, @cloudflare/RealtimeKit, @roerohan, @ravindra-cloudflare
/src/content/docs/support/ @cloudflare/product-owners, @cloudflare/customer-support, @ngayerie, @krys-cf, @stechedo, @zeinjaber, @shanecloudflare
/src/content/release-notes/beacon-min-js.yaml @angelampcosta, @dcpena, @ryantownsend, @cloudflare/product-owners

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpm run format:check currently fails. 3 issues need fixing before merge.

  • CRITICAL: pnpm run format:check fails on 8 files — 7 MDX files merged from production are unformatted, and .opencode/package.json is not ignored. Run pnpm run format and add .opencode/ to .prettierignore.
  • HIGH: Example.astro and PageTitle.astro convert conditional <style> blocks to <style set:html>. This removes Astro's default style scoping, making those styles global. Verify this is intentional.
  • MEDIUM: ~60 files in .prettierignore under "Deferred follow-up work" lack a tracking issue or plan. The previous ignore list referenced FORMATTING-PLAN.md, which no longer exists. Consider creating a follow-up issue to track these.

Comment thread .prettierignore
Comment thread .prettierignore Outdated
Comment thread src/components/Example.astro Outdated
Comment thread src/components/overrides/PageTitle.astro
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 22, 2026

Labels applied: docs engine, documentation.

Summary

PR #31018 adopts Prettier formatting across the MD/MDX/Astro content tree. It:

  • Expands .prettierrc.mjs with additional mdxPreserveElements and disables embeddedLanguageFormatting for Markdown and MDX.
  • Collapses package.json format scripts into a single format / format:check command covering all extensions.
  • Updates CI to run the unified format check.
  • Formats ~3,100 files and fixes Astro/JSX parse errors in several previously ignored components (e.g., adding fragments, replacing HTML comments with JSX comments).

Issues flagged

I posted a review with 4 inline comments. Key issues requiring maintainer attention:

  • CRITICAL: pnpm run format:check currently fails on 8 files. Seven MDX files were merged unformatted from production after the last format pass, and .opencode/package.json is not ignored by Prettier. Needs a fresh pnpm run format pass and .opencode/ added to .prettierignore.
  • HIGH: Semantic change in Example.astro and PageTitle.astro. Conditional <style> blocks were converted to <style set:html>, which removes Astro's default style scoping and makes those styles global. Confirm this is intentional.
  • MEDIUM: The .prettierignore "Deferred follow-up work" list contains ~60 files with no tracking issue or document. The old ignore list referenced FORMATTING-PLAN.md, which no longer exists. Recommend opening a follow-up issue to track these.

No commits were pushed.

github run

@MohamedH1998
Copy link
Copy Markdown
Contributor Author

/bonk review

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous issues addressed: CI enforcement reverted, Example.astro and PageTitle.astro restored to scoped <style> blocks. 2 new issues need fixing before merge.

CRITICAL: .opencode/ missing from .prettierignore
pnpm run format:data attempts to format generated files under .opencode/ (e.g., .opencode/package.json). These files should be ignored.

HIGH: Unnecessary "Deferred follow-up work" entries
I batch-checked every file in this section — Example.astro, PageTitle.astro, and all 65 MDX files — and Prettier parses and formats every one of them correctly. None need to be ignored. Remove the entire block so future edits are checked.

No build, type, lint, or test regressions found.

Comment thread .prettierignore Outdated
Comment thread .prettierignore Outdated
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 22, 2026

Posted a review on PR #31018 with 2 inline comments.

What I found

  • Previous issues were addressed: CI enforcement was reverted and Example.astro/PageTitle.astro were restored to proper scoped <style> blocks.
  • Validation passed: pnpm run check, pnpm run lint, pnpm run test:prebuild, format:core:check, and prettier --check for MDX/Astro all succeed.

New issues flagged

  1. CRITICAL: .opencode/ is missing from .prettierignore. I verified that .opencode/package.json is unformatted and would be touched by pnpm run format:data.
  2. HIGH: The entire "Deferred follow-up work" section in .prettierignore is unnecessary. I batch-checked every file in that section — all 65 MDX files plus Example.astro and PageTitle.astro — and Prettier parses and formats every one of them correctly. None need to remain ignored.

Review link: #31018 (review)

github run

@github-actions
Copy link
Copy Markdown
Contributor

@MohamedH1998
Copy link
Copy Markdown
Contributor Author

/bonk review

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the remaining .opencode/ ignore issue. No other blockers found.

CRITICAL (fixed): Added .opencode/ to .prettierignore to prevent format:data from touching generated agent files.

Validation passed:

  • pnpm run check
  • pnpm run lint
  • pnpm run format:core:check
  • pnpm run test:prebuild

Co-authored-by: MohamedH1998 <MohamedH1998@users.noreply.github.com>
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 22, 2026

Posted a review on PR #31018.

What changed

  • Fixed .prettierignore — added .opencode/ so that pnpm run format:data won't touch generated agent files under .opencode/. This was the last remaining blocker from the previous review round.

Validation

All checks pass after the fix:

  • pnpm run check
  • pnpm run lint
  • pnpm run format:core:check
  • pnpm run test:prebuild

No other issues found. Ready for merge once the auto-push completes.

github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs engine Requires a change to the docs engine documentation Documentation edits product:agents Build and deploy AI-powered Agents on Cloudflare that can act autonomously. product:ai-crawl-control product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ product:ai-search product:analytics Related to Analytics product product:api-shield product:argo-smart-routing product:automatic-platform-optimization product:billing product:bots Related to Bots product product:browser-run product:byoip Related to BYOIP product:cache Issues or PRs related to Cache product:changelog product:china-network product:client-ip-geolocation product:cloudflare-challenges product:cloudflare-for-platforms product:cloudflare-network-firewall product:cloudflare-one product:cloudflare-wan product:constellation product:containers product:d1 D1: https://developers.cloudflare.com/d1/ product:data-localization product:ddos-protection product:dmarc-management product:dns Issues or PRs related to DNS product:durable-objects Durable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/ product:email-routing product:email-security product:firewall Related to Firewall product product:fundamentals product:google-tag-gateway product:health-checks product:hyperdrive Hyperdrive: https://developers.cloudflare.com/hyperdrive/ product:images Related to Image Resizing product product:key-transparency product:kv product:learning-paths product:load-balancing Related to Load Balancing product product:log-explorer product:logs Related to Logs product:magic-transit product:migration-guides product:moq product:multi-cloud-networking product:network product:network-error-logging product:network-flow product:network-interconnect product:notifications product:pages product:pipelines product:privacy-gateway product:pulumi product:queues Cloudflare Queues: https://developers.cloudflare.com/queues product:r2-sql product:r2 R2 object storage: https://developers.cloudflare.com/r2 product:radar product:randomness-beacon product:realtime product:reference-architecture product:registrar Related to Registrar product product:rules Related to rules product:ruleset-engine product:sandbox product:secrets-store product:security product:security-center product:smart-shield product:spectrum Related to Spectrum product product:speed product:ssl Related to SSL product:stream Related to Stream product product:style-guide product:support product:tenant product:terraform Related to Terraform product product:time-services product:tunnel product:turnstile product:use-cases product:vectorize Vectorize: https://developers.cloudflare.com/vectorize/ product:version-management product:waf product:waiting-room Related to Waiting Room product product:warp-client product:web3 product:web-analytics product:workers Related to Workers product product:workers-ai Workers AI: https://developers.cloudflare.com/workers-ai/ product:workers-vpc product:workflows Workflows: https://developers.cloudflare.com/workflows/ product:zaraz product:1.1.1.1 Related to 1.1.1.1 product

Projects

None yet

Development

Successfully merging this pull request may close these issues.