Repository navigation
Format the codebase with oxfmt - #10
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:bun.lockandpublic/are skipped.bun run formatformats in place, andbun run format:checkonly checks. CI now checks formatting on every PR, before linting.vue/html-self-closingis off. Formatting is now oxfmt's job, and the two disagreed about void elements like<br />..vscode/recommends the Oxc extension and turns on format-on-save. Only these two shared files are un-ignored.( )spacing style with standard formatting.Verification
format:check, lint andnuxt typecheckpass.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