chore: add prettier for markdown and astro formatting#2153
Conversation
…provider, context, hooks, and query utilities are now exported from `@namehash/namehash-ui`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 44 minutes and 46 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
This PR introduces Prettier into the monorepo to standardize formatting for Markdown at the root and Astro files within the docs workspaces, complementing Biome (which handles the rest of the codebase).
Changes:
- Add Prettier (and Astro plugin) to the pnpm catalog/lockfile and introduce root-level
.prettierrc.json/.prettierignore. - Update root
lint/lint:cito run Prettier on Markdown and run workspace-level Astro format checks where available. - Add docs workspace Prettier configs and
format/format:checkscripts for.astrofiles.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Adds prettier and prettier-plugin-astro to the shared catalog. |
| pnpm-lock.yaml | Locks new Prettier dependencies and updates related Astro dependency snapshots. |
| package.json | Updates lint scripts to include Prettier checks/writes and adds Prettier devDependency. |
| docs/ensrainbow.io/package.json | Adds format scripts and Prettier devDependencies for .astro formatting. |
| docs/ensrainbow.io/.prettierrc.json | Adds Astro-specific Prettier configuration via prettier-plugin-astro. |
| docs/ensrainbow.io/.prettierignore | Excludes build artifacts from Prettier in the docs workspace. |
| docs/ensnode.io/package.json | Adds format scripts and Prettier devDependencies for .astro formatting. |
| docs/ensnode.io/.prettierrc.json | Adds Astro-specific Prettier configuration via prettier-plugin-astro. |
| docs/ensnode.io/.prettierignore | Excludes build artifacts from Prettier in the docs workspace. |
| .prettierrc.json | Introduces root Prettier defaults for Markdown/prose formatting. |
| .prettierignore | Excludes generated/owned files (e.g. lockfile, changelogs) from Prettier. |
| .changeset/upset-kids-drop.md | Adds a changeset entry (content currently appears unrelated to this PR). |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
docs/ensnode.io/.prettierrc.json (1)
1-13:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd base Prettier options to avoid config drift.
Line 1 introduces a workspace-local config that can diverge from root defaults; this risks inconsistent formatting in
docs/ensnode.io. Please include the shared base options here (printWidth,proseWrap) so this package stays aligned.Proposed patch
{ "plugins": ["prettier-plugin-astro"], + "printWidth": 100, + "proseWrap": "preserve", "overrides": [ { "files": "*.astro", "options": { "parser": "astro" } } ], "bracketSameLine": true, "astroSkipFrontmatter": true }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/ensnode.io/.prettierrc.json` around lines 1 - 13, Add the shared base Prettier options to this package's .prettierrc.json to prevent config drift: add top-level "printWidth" and "proseWrap" keys to the existing JSON using the workspace's canonical values (e.g., set "printWidth" to the repo/monorepo default and "proseWrap" to the repo default like "preserve" or "always"), keeping the existing "plugins", "overrides", "bracketSameLine", and "astroSkipFrontmatter" entries intact so the file remains a superset of the root config.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CONTRIBUTING.md`:
- Around line 27-30: Replace the unclear NOTE that begins "NOTE (Windows users):
After running these steps, you may see many diffs with Contents have differences
only in line separators comment." with a concise, user-facing explanation that
Windows line endings (CRLF) can cause many harmless diffs and that those changes
are not included in the final commit; instruct the reader to either ignore those
diffs for self-review or normalize line endings by running the existing
suggested command (git add --all) or configuring Git line-ending handling (e.g.,
core.autocrlf), and keep the guidance brief and action-oriented so it's easy to
understand.
In `@docs/ensrainbow.io/package.json`:
- Around line 15-17: The package CI lint script "lint:ci" only runs Biome and
therefore skips the Astro Prettier check; update the "lint:ci" script to invoke
the existing "lint:prettier:ci" before (or in parallel with) Biome so CI will
fail on unformatted Astro files — for example, change "lint:ci" to run
"lint:prettier:ci" and then "biome ci" (reference script names: "lint:ci" and
"lint:prettier:ci").
---
Duplicate comments:
In `@docs/ensnode.io/.prettierrc.json`:
- Around line 1-13: Add the shared base Prettier options to this package's
.prettierrc.json to prevent config drift: add top-level "printWidth" and
"proseWrap" keys to the existing JSON using the workspace's canonical values
(e.g., set "printWidth" to the repo/monorepo default and "proseWrap" to the repo
default like "preserve" or "always"), keeping the existing "plugins",
"overrides", "bracketSameLine", and "astroSkipFrontmatter" entries intact so the
file remains a superset of the root config.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: a45f2baf-b5f8-44a4-ae07-db6be6b72c0b
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (11)
.prettierignore.prettierrc.jsonCONTRIBUTING.mddocs/ensnode.io/.prettierignoredocs/ensnode.io/.prettierrc.jsondocs/ensnode.io/package.jsondocs/ensrainbow.io/.prettierignoredocs/ensrainbow.io/.prettierrc.jsondocs/ensrainbow.io/package.jsonpackage.jsonpnpm-workspace.yaml
| link: "/docs/reference/contributing/building", | ||
| }, | ||
| { label: "Creating a Release", link: "/docs/reference/contributing/releases" }, | ||
| { label: "Format & Lint", link: "/docs/reference/contributing/formatting" }, |
There was a problem hiding this comment.
| { label: "Format & Lint", link: "/docs/reference/contributing/formatting" }, | |
| { label: "Formatting", link: "/docs/reference/contributing/formatting" }, |
What do we think? I'm not a fan of Format & Lint, or Formatting & Linting.
| link: "/docs/reference/contributing/building", | ||
| }, | ||
| { label: "Creating a Release", link: "/docs/reference/contributing/releases" }, | ||
| { label: "Format & Lint", link: "/docs/reference/contributing/formatting" }, |
There was a problem hiding this comment.
| { label: "Format & Lint", link: "/docs/reference/contributing/formatting" }, | |
| { label: "Linting", link: "/docs/reference/contributing/formatting" }, |
Maybe just Linting?
| "lint": "pnpm run lint:biome && pnpm run lint:prettier", | ||
| "lint:ci": "pnpm run lint:biome:ci && pnpm run lint:prettier:ci", | ||
| "lint:prettier": "pnpm exec prettier --write \"**/*.{md,mdx}\" && pnpm -r lint:prettier", | ||
| "lint:prettier:ci": "pnpm exec prettier --check \"**/*.{md,mdx}\" && pnpm -r lint:prettier:ci", |
Lite PR
Tip: Review docs on the ENSNode PR process
Summary
**/*.astroinsidedocs/ensnode.ioanddocs/ensrainbow.ioviaprettier-plugin-astro, withastroSkipFrontmatter: trueso Biome still owns the---block.The new root scripts, thanks @shrugs 🫶
Each docs site exposes its own
lint:prettier/lint:prettier:cifor**/*.astro.pnpm run "/regex/"runs the matched scripts in parallel.Why
CONTRIBUTING.md,.changeset/, both docs sites.).astrosupport only covers the frontmatter. Prettier withprettier-plugin-astrohandles the template;astroSkipFrontmatter: trueprevents the two from clashing.Testing
pnpm installsucceeds.pnpm lintruns Prettier and Biome in parallel and writes locally.pnpm lint:ciruns both check-only; failures exit non-zero..astrofrontmatter survives a Prettier pass untouched.CHANGELOG.mdfiles survive a Prettier pass untouched.Notes for Reviewer (Optional)
Keeping both
.prettierrc.jsonand.prettierignoreat root.We already have a root Biome config; Prettier deserves the same treatment given how much of our docs it covers. -
.prettierignoreis required to keep Prettier offCHANGELOG.md(changesets-owned) (package.json#prettierhas no equivalent for ignore patterns.)CHANGELOG.mdignored (owned by changesets)astroSkipFrontmatterlets biome keep formatting.astroscript blocksdocs/ensnode.io and docs/ensrainbow.ioown.astroviaprettier-plugin-astroPre-Review Checklist (Blocking)