Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Dependencies and build output (prettier ignores node_modules by default; listed for clarity)
node_modules
dist
build
.next
.astro
.ponder
generated

# Lockfiles
pnpm-lock.yaml

# Generated changelogs — owned by changesets, do not reformat
**/CHANGELOG.md
15 changes: 15 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"printWidth": 100,
"proseWrap": "preserve",
"plugins": ["prettier-plugin-astro"],
"overrides": [
{
"files": "*.astro",
"options": {
"parser": "astro",
"bracketSameLine": true,
"astroSkipFrontmatter": true
}
}
]
}
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@ For detailed contribution guidelines and setup instructions:
- **ENSNode**: Visit [ENSNode Contributing Guide](https://ensnode.io/docs/contributing)
- **ENSRainbow**: Visit [ENSRainbow Contributing Guide](https://ensnode.io/ensrainbow/contributing)

## Using Biome and Prettier together

We use Biome as our primary code formatter, and our long-term goal is to rely on it exclusively.

However, support for Astro files is still experimental. Currently, Biome only formats the frontmatter section of .astro files, so we use Prettier to format the JSX portions.

### Applying both formatters

To ensure CI checks pass and the codebase is formatted correctly, run `pnpm lint` command from the repository root. This will run both Biome and Prettier formatting.

- Prettier formats `**/*.md` at the monorepo root.
- Each docs site (`docs/ensnode.io`, `docs/ensrainbow.io`) uses `prettier-plugin-astro` to format the template portion of its `.astro` files. The `astroSkipFrontmatter: true` option keeps Biome in charge of the frontmatter so the two formatters don't fight over the same code.

Run `pnpm lint` from the monorepo root to apply both. CI runs `pnpm lint:ci` (check-only).

> NOTE (Windows users): After running these steps, you may see many diffs with Contents have differences only in line separators comment.
>
> These files won't be included in your commit. For easier self-review either ignore them or (if valid in your case) run the git add --all command. This normalizes line endings and removes those entries from the diff.
Comment on lines +27 to +29
Comment on lines +27 to +29
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
> NOTE (Windows users): After running these steps, you may see many diffs with Contents have differences only in line separators comment.
>
> These files won't be included in your commit. For easier self-review either ignore them or (if valid in your case) run the git add --all command. This normalizes line endings and removes those entries from the diff.
> NOTE (Windows users): After running the formatting steps, you may see many diffs showing differences only in line endings (CRLF vs LF).
>
> This happens because the formatters normalize line endings to LF (Unix-style), while Git on Windows may use CRLF (Windows-style). These line-ending-only changes won't be included in your commit by default. To fix this and remove these diffs from your staging area, run: `git add --all`. This command stages the line ending changes without affecting your actual code changes.

CONTRIBUTING.md contains unclear line-ending guidance with confusing tool output terminology that doesn't explain the CRLF vs LF issue or provide clear actionable steps

Fix on Vercel


Comment on lines +27 to +30
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 21, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clarify the Windows line-ending note to avoid confusion.

The current wording is hard to parse and reads like an editor-specific status message rather than guidance.

Suggested rewrite
-> NOTE (Windows users): After running these steps, you may see many diffs with Contents have differences only in line separators comment.
+> NOTE (Windows users): After running these steps, you may see many diffs where the only change is line separators (CRLF/LF).
 >
-> These files won't be included in your commit. For easier self-review either ignore them or (if valid in your case) run the git add --all command. This normalizes line endings and removes those entries from the diff.
+> These files usually won't be included in your commit. For easier self-review, ignore those entries or run `git add --all` to normalize line endings and clear them from the diff.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
> NOTE (Windows users): After running these steps, you may see many diffs with Contents have differences only in line separators comment.
>
> These files won't be included in your commit. For easier self-review either ignore them or (if valid in your case) run the git add --all command. This normalizes line endings and removes those entries from the diff.
> NOTE (Windows users): After running these steps, you may see many diffs where the only change is line separators (CRLF/LF).
>
> These files usually won't be included in your commit. For easier self-review, ignore those entries or run `git add --all` to normalize line endings and clear them from the diff.
🤖 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 `@CONTRIBUTING.md` around lines 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.

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.

@Y3drk thoughts? I copied this from ENSAwards.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@notrab

Not a native speaker, so I can't really judge much, but to me the second part of the current version of the note is 100% legit.

This suggestion from coderabbit:

NOTE (Windows users): After running these steps, you may see many diffs where the only change is line separators (CRLF/LF)

about the first paragraph seems smoother than what we currently have, while still true, so feel free to use it if you like it

## Getting Help

If you have questions or need help, please:
Expand Down
4 changes: 4 additions & 0 deletions docs/ensnode.io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"astro": "astro",
"lint": "biome check --write",
"lint:ci": "biome ci",
"lint:prettier": "prettier --write \"**/*.astro\"",
"lint:prettier:ci": "prettier --check \"**/*.astro\"",
"omnigraph-examples:refresh-responses": "tsx --tsconfig tsconfig.json scripts/fetch-omnigraph-example-responses.mts",
"test": "vitest",
"generate:openapi": "pnpm --filter ensapi exec tsx --tsconfig tsconfig.json ../../scripts/generate-ensapi-openapi.mts"
Expand Down Expand Up @@ -56,6 +58,8 @@
"devDependencies": {
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"prettier": "catalog:",
"prettier-plugin-astro": "catalog:",
"tsx": "^4.19.3",
"vitest": "catalog:"
}
Expand Down
8 changes: 6 additions & 2 deletions docs/ensrainbow.io/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"preview": "astro preview",
"astro": "astro",
"lint": "biome check --write .",
"lint:ci": "biome ci"
"lint:ci": "biome ci",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The lint:ci script in workspace subdirectories only runs Biome checks and skips Prettier formatting checks for .astro files, allowing unformatted Astro files to pass CI checks.

Fix on Vercel

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The workspace package lint:ci scripts in docs/ensrainbow.io and docs/ensnode.io only run Biome checks and skip Prettier checks for .astro files

Fix on Vercel

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The lint:ci script in workspace packages only runs biome ci, skipping prettier formatting checks for .astro files

Fix on Vercel

"lint:prettier": "prettier --write \"**/*.astro\"",
"lint:prettier:ci": "prettier --check \"**/*.astro\""
Comment on lines +15 to +17
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 21, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Include Prettier check in package-level CI lint entrypoint.

At Line 15, lint:ci runs only Biome, so Astro formatting can be skipped when CI/job tooling invokes just pnpm run lint:ci in this package. Wire lint:prettier:ci into lint:ci to preserve the “block unformatted files” guarantee.

Suggested patch
-    "lint:ci": "biome ci",
+    "lint:ci": "pnpm run lint:prettier:ci && biome ci",
     "lint:prettier": "prettier --write \"**/*.astro\"",
     "lint:prettier:ci": "prettier --check \"**/*.astro\""
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"lint:ci": "biome ci",
"lint:prettier": "prettier --write \"**/*.astro\"",
"lint:prettier:ci": "prettier --check \"**/*.astro\""
"lint:ci": "pnpm run lint:prettier:ci && biome ci",
"lint:prettier": "prettier --write \"**/*.astro\"",
"lint:prettier:ci": "prettier --check \"**/*.astro\""
🤖 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/ensrainbow.io/package.json` around lines 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").

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.

What do we think?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@notrab — the suggestion is worth keeping, in my view. Here's the reasoning:

The root package.json already dispatches both formatters via the regex pattern pnpm run "/^lint:(prettier|biome):ci$/", so workspace-wide CI is covered. However, if any CI job (or developer) targets this package directly with:

pnpm --filter `@docs/ensrainbow` run lint:ci

…only Biome runs and the Prettier check for .astro files is silently skipped. That breaks the "block unformatted files" guarantee at the package level.

The fix is minimal — it just chains the already-existing lint:prettier:ci script:

"lint:ci": "pnpm run lint:prettier:ci && biome ci",

It might also be worth checking whether docs/ensnode.io/package.json has the same gap for consistency, since both packages follow the same pattern.


🧠 Learnings used
Learnt from: tk-o
Repo: namehash/ensnode PR: 1752
File: packages/ensnode-schema/package.json:19-23
Timestamp: 2026-03-12T11:05:50.976Z
Learning: In pnpm monorepos (identified by catalog references in package.json), use publishConfig.exports to override the top-level exports for the published artifact (e.g., ./dist/*.js) while keeping top-level exports for local development (e.g., ./src/*.ts). Treat this pattern as intentional and not broken. Apply this guideline to package.json files in monorepos (e.g., packages/**/package.json) or any package.json where catalog references indicate a monorepo layout.

},
"dependencies": {
"@astrojs/react": "catalog:",
Expand All @@ -30,6 +32,8 @@
},
"devDependencies": {
"@types/react": "catalog:",
"@types/react-dom": "catalog:"
"@types/react-dom": "catalog:",
"prettier": "catalog:",
"prettier-plugin-astro": "catalog:"
}
}
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
"private": true,
"packageManager": "pnpm@10.33.0",
"scripts": {
"lint": "biome check --write .",
"lint:ci": "biome ci",
"lint": "pnpm run \"/^lint:(prettier|biome)$/\"",
"lint:ci": "pnpm run \"/^lint:(prettier|biome):ci$/\"",
"lint:prettier": "pnpm exec prettier --write \"**/*.md\" && pnpm -r lint:prettier",
"lint:prettier:ci": "pnpm exec prettier --check \"**/*.md\" && pnpm -r lint:prettier:ci",
Comment on lines +9 to +10
"lint:biome": "biome check --write .",
"lint:biome:ci": "biome ci",
Comment on lines +7 to +12
"test": "vitest --silent passed-only",
"test:integration": "vitest --config vitest.integration.config.ts --silent passed-only",
"test:integration:ci": "pnpm -F @ensnode/integration-test-env start",
Expand Down Expand Up @@ -36,6 +40,8 @@
"@changesets/cli": "^2.29.8",
"@typescript/native-preview": "7.0.0-dev.20260128.1",
"jsdom": "^27.0.1",
"prettier": "catalog:",
"prettier-plugin-astro": "catalog:",
"tsup": "catalog:",
"typescript": "catalog:",
"vitest": "catalog:"
Expand Down
68 changes: 61 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ catalog:
pino: 10.1.0
ponder: 0.16.6
postcss: 8.5.12
prettier: 3.6.2
prettier-plugin-astro: 0.14.1
react: 19.2.1
react-dom: 19.2.1
tailwind-merge: ^3.4.0
Expand Down
Loading