Conversation
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.
Why oxfmt?
The repo currently uses Prettier to format JSON files. Prettier is a great tool, but it has some limitations in our context:
.prettierrcand.prettierignoreoxfmt is an alternative formatter, written in Rust and distributed via npm. It is compatible with Prettier's configuration (same options:
singleQuote,trailingComma,semi, etc.) but offers dramatically better performance.Concrete result: oxfmt formats every file in the repo in a few milliseconds, whereas Prettier takes several seconds.
What this PR changes
prettieroxfmt.prettierrc+.prettierignore.oxfmtrc.jsonformatjob in the GitHub Actions workflowModified files
package.json— replacesprettierwithoxfmtindevDependenciesand theformatscript.oxfmtrc.json— new config file (equivalent to the previous.prettierrc).prettierrc/.prettierignore— removed.github/workflows/format.yml— adds aformatjob that installs dependencies and checks formatting on every PR.github/labeler.yml— updates the.prettierrcreference to.oxfmtrc.jsonIDE integration
oxfmt ships a drop-in replacement for Prettier's CLI — it registers itself as
node_modules/.bin/prettierafterpnpm install. This means existing IDE integrations pick it up automatically, with no reconfiguration needed:prettierbinary (e.g. the official Prettier extension) will transparently use oxfmt insteadconform.nvimornull-lsthat invokenode_modules/.bin/prettierwill work as-isIn short: run
pnpm install, and your editor formats with oxfmt automatically.CI
A
formatjob is added to.github/workflows/format.yml. It runs on every PR and verifies that all files are properly formatted using oxfmt (pnpm format --check). If a file is not formatted, the PR is blocked with a clear diff.Open questions for the team
.md/.mdxfiles in addition to.json?main?