Skip to content

chore: add prettier for markdown and astro formatting#2153

Open
notrab wants to merge 15 commits into
mainfrom
chore/prettier-md-astro
Open

chore: add prettier for markdown and astro formatting#2153
notrab wants to merge 15 commits into
mainfrom
chore/prettier-md-astro

Conversation

@notrab
Copy link
Copy Markdown
Member

@notrab notrab commented May 19, 2026

Lite PR

Tip: Review docs on the ENSNode PR process

Summary

The new root scripts, thanks @shrugs 🫶

Each docs site exposes its own lint:prettier / lint:prettier:ci for **/*.astro. pnpm run "/regex/" runs the matched scripts in parallel.


Why

  • Biome stays our primary formatter, but two gaps need filling today:
  • Biome doesn't format Markdown, and we have Markdown everywhere (READMEs, CONTRIBUTING.md, .changeset/, both docs sites.)
  • Leaving it unformatted is the wrong baseline for a repo where docs quality matters.
  • Biome's .astro support only covers the frontmatter. Prettier with prettier-plugin-astro handles the template; astroSkipFrontmatter: true prevents the two from clashing.

Testing

  • pnpm install succeeds.
  • pnpm lint runs Prettier and Biome in parallel and writes locally.
  • pnpm lint:ci runs both check-only; failures exit non-zero.
  • .astro frontmatter survives a Prettier pass untouched.
  • CHANGELOG.md files survive a Prettier pass untouched.

Notes for Reviewer (Optional)

  • Keeping both .prettierrc.json and .prettierignore at root.

  • We already have a root Biome config; Prettier deserves the same treatment given how much of our docs it covers. - .prettierignore is required to keep Prettier off CHANGELOG.md (changesets-owned) ( package.json#prettier has no equivalent for ignore patterns.)

  • CHANGELOG.md ignored (owned by changesets)

  • astroSkipFrontmatter lets biome keep formatting .astro script blocks

  • docs/ensnode.io and docs/ensrainbow.io own .astro via prettier-plugin-astro


Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

notrab added 2 commits May 19, 2026 18:14
…provider, context, hooks, and query utilities are now exported from `@namehash/namehash-ui`.
Copilot AI review requested due to automatic review settings May 19, 2026 17:26
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
enskit-react-example.ensnode.io Ready Ready Preview, Comment May 23, 2026 5:24pm
ensnode.io Ready Ready Preview, Comment May 23, 2026 5:24pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
admin.ensnode.io Skipped Skipped May 23, 2026 5:24pm
ensrainbow.io Skipped Skipped May 23, 2026 5:24pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 19, 2026

⚠️ No Changeset found

Latest commit: a521ac1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 19, 2026

Warning

Review limit reached

@notrab, we couldn't start this review because you've used your available PR reviews for now.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 33fb9cca-7068-45b4-ac3c-279b2205a251

📥 Commits

Reviewing files that changed from the base of the PR and between 164ef19 and a521ac1.

📒 Files selected for processing (2)
  • docs/ensnode.io/config/integrations/starlight/sidebar-topics/reference.ts
  • docs/ensnode.io/src/content/docs/docs/reference/contributing/formatting.mdx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/prettier-md-astro

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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:ci to run Prettier on Markdown and run workspace-level Astro format checks where available.
  • Add docs workspace Prettier configs and format / format:check scripts for .astro files.

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.

Comment thread package.json Outdated
Comment thread package.json Outdated
Comment thread docs/ensnode.io/.prettierrc.json Outdated
Comment thread package.json Outdated
Comment thread package.json Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
docs/ensnode.io/.prettierrc.json (1)

1-13: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add 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

📥 Commits

Reviewing files that changed from the base of the PR and between b37d070 and 4ed57ff.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • .prettierignore
  • .prettierrc.json
  • CONTRIBUTING.md
  • docs/ensnode.io/.prettierignore
  • docs/ensnode.io/.prettierrc.json
  • docs/ensnode.io/package.json
  • docs/ensrainbow.io/.prettierignore
  • docs/ensrainbow.io/.prettierrc.json
  • docs/ensrainbow.io/package.json
  • package.json
  • pnpm-workspace.yaml

Comment thread CONTRIBUTING.md Outdated
Comment thread docs/ensrainbow.io/package.json
Copilot AI review requested due to automatic review settings May 21, 2026 19:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread package.json
Copilot AI review requested due to automatic review settings May 23, 2026 17:23
@vercel vercel Bot temporarily deployed to Preview – ensrainbow.io May 23, 2026 17:23 Inactive
@vercel vercel Bot temporarily deployed to Preview – admin.ensnode.io May 23, 2026 17:23 Inactive
link: "/docs/reference/contributing/building",
},
{ label: "Creating a Release", link: "/docs/reference/contributing/releases" },
{ label: "Format & Lint", link: "/docs/reference/contributing/formatting" },
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
{ 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" },
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
{ label: "Format & Lint", link: "/docs/reference/contributing/formatting" },
{ label: "Linting", link: "/docs/reference/contributing/formatting" },

Maybe just Linting?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread package.json
Comment on lines +7 to +10
"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",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configure lint and formatter for markdown files

5 participants