Skip to content

Format the codebase with oxfmt - #10

Merged
mathhulk merged 1 commit into
developfrom
claude/vibrant-faraday-ux7zgr-formatter
Nov 23, 2026
Merged

mathhulk merged 1 commit into
developfrom
claude/vibrant-faraday-ux7zgr-formatter

Conversation

@mathhulk

Copy link
Copy Markdown
Collaborator

Follow-up to the formatter comment on #1.

Why oxfmt

oxfmt is the Oxc project's formatter. Its output is Prettier-compatible, and it formats everything in this repo: Vue SFCs (template, script and style), TypeScript, SCSS/CSS, JSON, YAML and Markdown.

I compared it with Prettier 3.10 on this codebase. Apart from the default line width (100 vs 80), the output matched, including Prettier's whitespace-safe handling of inline template text. It checks the whole repo in about 10 ms.

It's still pre-1.0 (0.79). Because the output is Prettier-compatible, switching to Prettier later would only change the command and config file, not the code.

Changes

  • .oxfmtrc.json:
    • 4-space indent (the codebase's existing style) and a 100-column width;
    • JSON, YAML and Markdown use 2 spaces;
    • bun.lock and public/ are skipped.
  • Scripts: bun run format formats in place, and bun run format:check only checks. CI now checks formatting on every PR, before linting.
  • ESLint: vue/html-self-closing is off. Formatting is now oxfmt's job, and the two disagreed about void elements like <br />.
  • VS Code: .vscode/ recommends the Oxc extension and turns on format-on-save. Only these two shared files are un-ignored.
  • The rest of the diff is the one-time reformat. It also replaces the original ( ) spacing style with standard formatting.

Verification

  • format:check, lint and nuxt typecheck pass.
  • The pre-rendered pages are pixel-identical to develop's at 390, 800 and 1500px, and their visible text is unchanged. Reformatting templates can't change what renders.

Independent of #9; it can merge before or after it.


Generated by Claude Code

oxfmt is the Oxc project's formatter: Prettier-compatible output (Vue,
TypeScript, SCSS/CSS, JSON, YAML, Markdown), written in Rust and checking
the whole repo in ~10 ms.

- .oxfmtrc.json: 4-space indent (the codebase's existing style) and a
  100-column width; JSON/YAML/Markdown use 2 spaces; bun.lock and public/
  are skipped. Templates keep Prettier's whitespace-sensitive handling,
  so rendered pages are unchanged
- `bun run format` / `bun run format:check`; CI checks formatting on every
  pull request before linting
- ESLint's vue/html-self-closing is off, since formatting is now oxfmt's
  job and the two disagreed on void elements like <br />
- .vscode/ recommends the Oxc extension and formats on save (the folder
  stays ignored apart from these two shared files)
- The rest of the diff is the one-time reformat (this also replaces the
  original `( )` spacing style with standard formatting)

Verified: lint and type-check pass; pre-rendered pages are pixel-identical
at 390/800/1500px and their visible text is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DxVDmLPux3Tx7RV1v4yznD
@mathhulk
mathhulk merged commit ddfca6f into develop Nov 23, 2026
2 checks passed
@mathhulk
mathhulk deleted the claude/vibrant-faraday-ux7zgr-formatter branch November 23, 2026 00:05
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.

2 participants