Repository navigation
Format the repository with Oxfmt #253
Description
Story
As an effectionx contributor, I want the existing formatting commands to use Oxfmt, so the repository can adopt the Oxc toolchain without changing my local or CI workflow.
The contributor commands remain:
pnpm fmt
pnpm fmt:checkpnpm fmt writes the canonical format. pnpm fmt:check verifies it without modifying files.
Current gap
Biome currently owns both formatting and linting. We intend to adopt Oxlint as the host for Effection-specific policy rules, but changing formatting and policy enforcement together would mix mechanical formatting churn with changes in lint behavior.
Moving formatting to Oxfmt first establishes the formatter boundary independently. Biome continues to provide linting until the separate Oxlint migration is delivered.
Contract
Oxfmt becomes the repository’s sole formatter without changing the public formatting commands.
The committed Oxfmt configuration preserves the repository’s effective formatting conventions where Oxfmt defaults differ from Biome. In particular:
- Formatting uses two-space indentation and an 80-column print width.
- Oxfmt-only import sorting and
package.jsonsorting remain disabled. Reordering is a separate policy decision. - Markdown is excluded. README and policy documents are intended to become executable XMD sources, and formatting fenced code can change their behavior.
- Generated output, vendored sources, dependency directories, build output, and fixtures whose exact text is under test are excluded.
- Oxfmt is pinned to an exact version so formatter upgrades produce deliberate, reviewable changes.
- Editor and CI integrations use the committed Oxfmt configuration rather than independent defaults.
Differences inherent to the two formatter engines are applied as one isolated mechanical migration.
Acceptance
pnpm fmtformats the declared source surface with Oxfmt and no longer invokes Biome formatting.pnpm fmt:checkchecks the same source surface with Oxfmt, performs no writes, and remains the formatting command used by CI.- Running
pnpm fmttwice is idempotent: the second run produces no tracked changes. - A deliberate formatting mutation in a TypeScript file makes
pnpm fmt:checkfail, andpnpm fmtrestores the accepted form. - A deliberate whitespace mutation inside an excluded Markdown code fence neither makes
pnpm fmt:checkfail nor gets rewritten bypnpm fmt. - Existing build, typecheck, and test commands continue to pass after the mechanical formatting change.
- Biome’s lint configuration and lint behavior remain unchanged in this story.
Evidence
The implementation records the output of:
pnpm fmt
pnpm fmt:check
pnpm check
pnpm test
pnpm test:nodeCI runs pnpm fmt:check from a clean checkout. The pull request separates configuration and command changes from the mechanical formatting pass so reviewers can distinguish the formatter contract from generated churn.
Dependencies
This story precedes replacing Biome linting with Oxlint. The Oxlint migration then precedes publishing Effection policy rules from @effectionx/lint and migrating the remaining policies to XMD.
Out of scope
- Compatibility with
deno fmt - Replacing Biome linting with Oxlint
- Adding or changing Effection policy rules
- Migrating policy documents or the README to XMD
- Formatting Markdown or executable code fences
- Enabling import or
package.jsonsorting
Activity
[-]Format the repository with Deno-aligned Oxfmt settings[/-][+]Format the repository with Oxfmt[/+]