Skip to content

chore: adopt oxfmt for root packages - #330

Open
hyoban wants to merge 1 commit into
LodyAI:mainfrom
hyoban:chore/adopt-oxfmt
Open

chore: adopt oxfmt for root packages#330
hyoban wants to merge 1 commit into
LodyAI:mainfrom
hyoban:chore/adopt-oxfmt

Conversation

@hyoban

@hyoban hyoban commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Related issue

Closes #118

Problem / pressure

Root-owned packages use Prettier through duplicated root and Electron configuration. The split setup can drift, and checking the full root-owned formatter corpus is substantially slower than Oxfmt.

Summary

  • Add one root .oxfmtrc.json with shared defaults, explicit ACP submodule ignores, and an Electron override that preserves its semicolon and trailing-comma style.
  • Switch the root, CLI, cloud API, and Electron format scripts to Oxfmt; update the lockfile, editor recommendation, packaging exclusions, and scope label mapping.
  • Remove obsolete root and Electron Prettier config/ignore files and apply only the mechanical formatting changes required by Oxfmt.
  • Keep Electron's @electron-toolkit/eslint-config-prettier integration and direct Prettier dependency unchanged so ESLint behavior remains outside this migration.

The full-project benchmark recorded in #118 covered 3,094 root-owned files: Oxfmt averaged 1.247 seconds and Prettier averaged 17.786 seconds, a 14.26× speedup on the tested Apple M4 Pro checkout.

Before / after

Before After
Root and Electron maintain separate Prettier configuration. Root-owned packages share .oxfmtrc.json; ACP submodules remain independently formatted.
Root, CLI, cloud API, and Electron scripts invoke Prettier. Those scripts invoke Oxfmt while Electron retains Prettier only for its existing ESLint compatibility layer.

Test plan

  • pnpm install --frozen-lockfile --ignore-scripts
  • pnpm format
  • pnpm format:check
  • pnpm check
  • Confirmed apps/electron/eslint.config.mjs and its Prettier compatibility dependency remain unchanged.

Context handoff

Instructions for reviewing agents

  • Review focus: Check .oxfmtrc.json, workspace format scripts, and package boundaries to ensure root-owned packages share Oxfmt without traversing ACP submodules.
  • Decisions to challenge: Confirm the Electron override preserves its prior style and retaining the existing ESLint Prettier integration is the right incremental boundary.
  • Plausible failures / evidence gaps: Cross-platform Oxfmt bindings are represented only by lockfile metadata here, and the benchmark was run on macOS rather than Windows or Linux.

Authoring context

  • User goal / directives: Replace root-owned Prettier formatting with Oxfmt, centralize configuration, remove obsolete Prettier traces, preserve Electron's ESLint Prettier import, minimize mechanical diff, and use the latest main.
  • Constraints / non-goals: Do not change runtime behavior, ACP submodule formatter ownership, or Electron's current ESLint compatibility layer.
  • Risk-bearing decisions: Oxfmt is a root development dependency, Electron style is expressed as a root override, and native formatter binaries are resolved through the lockfile's optional platform packages.
  • Destructive or irreversible behavior: Four obsolete formatter config/ignore files are deleted; the change has no data migration and can be fully reverted through Git.
  • Deliberately not done or tested: The Electron ESLint Prettier dependency was not removed, application packaging was not run, and benchmark coverage did not include Windows or Linux.
  • Unknowns / confidence: Confidence is high after formatting, type, lint, test, and public-boundary checks; CI remains the cross-platform validation for native Oxfmt bindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Adopt Oxfmt for root-owned packages

1 participant