Formatting with Biome and Prettier
We use Biome to format most of the codebase, and Prettier to cover the rest:
- Biome handles JS, TS, JSON, CSS, and the frontmatter of
.astrofiles. - Prettier handles Markdown (
.mdand.mdx) across the repo, and the template portion of.astrofiles indocs/ensnode.ioanddocs/ensrainbow.ioviaprettier-plugin-astro. TheastroSkipFrontmatter: trueoption keeps the frontmatter under Biome’s ownership.
Running the formatters
Section titled “Running the formatters”From the monorepo root:
pnpm lintCI runs pnpm lint:ci (check-only) on every PR.
Windows: line-ending diffs
Section titled “Windows: line-ending diffs”Git on Windows checks files out with CRLF (\r\n) line endings by default. Biome and Prettier write LF (\n). After pnpm lint, files may appear modified, but Git normalizes the endings back to LF when staging, so nothing changes in the resulting commit.
To clear the noise from your working tree:
- One-off: run
git add --all. The index normalizes the endings and the files drop out ofgit status. - Permanent: run
git config --global core.autocrlf input, thengit checkout -- .. Your working tree converts to LF and future checkouts keep it that way.