feat: add oxfmt as a formatter option#40
Open
stevan-borus wants to merge 1 commit intocode-forge-io:mainfrom
Open
feat: add oxfmt as a formatter option#40stevan-borus wants to merge 1 commit intocode-forge-io:mainfrom
stevan-borus wants to merge 1 commit intocode-forge-io:mainfrom
Conversation
Add support for oxfmt (the Oxc formatter) alongside the existing biome and prettier options. oxfmt >=0.36.0 supports stdin formatting via --stdin-filepath, which follows the same pipe-in/pipe-out pattern used by biome and prettier. Add oxfmt as a devDependency and tests verifying stdin formatting works for both TypeScript and HTML/SVG files.
|
You could try my fork, I added oxfmt support already |
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.
Description
Add support for oxfmt (the Oxc formatter) as a third formatter option alongside biome and prettier.
oxfmt >=0.36.0 supports stdin formatting via
--stdin-filepath, which follows the same pipe-in/pipe-out pattern already used by biome and prettier. It can format both TypeScript and HTML/SVG files.Usage
Changes
"oxfmt"to theFormattertype union--stdin-filepath file.ts/--stdin-filepath file.html) inlintFileContentRecord<Formatter, string[]>map for clarityType of change
How Has This Been Tested?
Unit tests:
should format TypeScript via stdin— pipes TS content through oxfmt and verifies semicolons, parenthesizedtypeof, and content preservationshould format HTML/SVG via stdin— pipes SVG content through oxfmt and verifies multi-line formatted outputManual test steps:
iconsSpritesheet({ ..., formatter: 'oxfmt' })invite.config.tsvite devTested with oxfmt 0.36.0, Vite 7.3.1, and React Router 7.13.1.
Reviewer checklist
Screenshots (if appropriate):
N/A — build-time plugin, no UI changes.
Questions (if appropriate):
N/A