Skip to content

refactor(formatter_core): purify core and define rules#22952

Merged
graphite-app[bot] merged 1 commit into
mainfrom
06-04-refactor_formatter_core_purify_core_and_define_rules
Jun 4, 2026
Merged

refactor(formatter_core): purify core and define rules#22952
graphite-app[bot] merged 1 commit into
mainfrom
06-04-refactor_formatter_core_purify_core_and_define_rules

Conversation

@leaysgur

@leaysgur leaysgur commented Jun 4, 2026

Copy link
Copy Markdown
Member

The Printer never consumes these; they belong with each language formatter.

  • Evict Quote (each formatter owns QuoteStyle)
    • normalize_string takes a quote byte
  • Evict Expand / BracketSpacing / TrailingCommas into oxc_formatter and oxc_formatter_json
  • JSON's TrailingCommas is now two-variant (Always/Never)
    • collapse Prettier's all/es5 at each translation layer
  • Rename util/ -> spec/ (pure shared helpers)
  • Split SourceText: mechanical access stays in core, JS/TS lexis moves to SourceTextExt
  • Drop the oxc_syntax dependency from core

All behaviros, Prettier conformance are unchanged.

leaysgur commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions Bot added A-cli Area - CLI A-formatter Area - Formatter labels Jun 4, 2026
@leaysgur leaysgur force-pushed the 06-04-refactor_formatter_core_purify_core_and_define_rules branch from 08d0d74 to 60dc0ad Compare June 4, 2026 06:39
@oxc-guard

oxc-guard Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Oxfmt Ecosystem CI

suite oxfmt@latest refs/pull/22952/head branch
fastify/fastify-vite
vuejs/pinia
actualbudget/actual
cnpm/cnpmcore
monkeytypegame/monkeytype
eggjs/egg
formatjs/formatjs
tale/headplane
dyad-sh/dyad
vercel/turborepo
Comfy-Org/ComfyUI_frontend
AmanVarshney01/create-better-t-stack
lichess-org/lila
openclaw/openclaw
getsentry/sentry-javascript
aidenybai/react-grab
npmx-dev/npmx.dev
mastodon/mastodon
vuejs/core
rolldown/rolldown
fuma-nama/fumadocs
huggingface/huggingface.js
cloudflare/agents

@leaysgur leaysgur force-pushed the 06-04-refactor_formatter_core_purify_core_and_define_rules branch from 60dc0ad to b323a76 Compare June 4, 2026 06:43
@codspeed-hq

codspeed-hq Bot commented Jun 4, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 52 untouched benchmarks
⏩ 14 skipped benchmarks1


Comparing 06-04-refactor_formatter_core_purify_core_and_define_rules (12a7397) with main (27a6db8)2

Open in CodSpeed

Footnotes

  1. 14 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (c786f0d) during the generation of this report, so 27a6db8 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@graphite-app graphite-app Bot force-pushed the 06-02-feat_oxfmt_format_parser_jsonc_files_by_oxc_formatter_json branch 2 times, most recently from 22f2b16 to ca58ed7 Compare June 4, 2026 06:50
@graphite-app graphite-app Bot force-pushed the 06-04-refactor_formatter_core_purify_core_and_define_rules branch from b323a76 to e483a3a Compare June 4, 2026 06:50
@graphite-app graphite-app Bot changed the base branch from 06-02-feat_oxfmt_format_parser_jsonc_files_by_oxc_formatter_json to graphite-base/22952 June 4, 2026 06:54
@graphite-app graphite-app Bot force-pushed the 06-04-refactor_formatter_core_purify_core_and_define_rules branch from e483a3a to 73bb51e Compare June 4, 2026 06:58
@graphite-app graphite-app Bot force-pushed the graphite-base/22952 branch from ca58ed7 to c786f0d Compare June 4, 2026 06:58
@graphite-app graphite-app Bot changed the base branch from graphite-base/22952 to main June 4, 2026 06:59
@graphite-app graphite-app Bot force-pushed the 06-04-refactor_formatter_core_purify_core_and_define_rules branch from 73bb51e to 12a7397 Compare June 4, 2026 06:59
@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Jun 4, 2026

leaysgur commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

Merge activity

The Printer never consumes these; they belong with each language formatter.

- Evict `Quote` (each formatter owns `QuoteStyle`)
  - `normalize_string` takes a quote byte
- Evict `Expand` / `BracketSpacing` / `TrailingCommas` into oxc_formatter and oxc_formatter_json
- JSON's `TrailingCommas` is now two-variant (`Always`/`Never`)
  - collapse Prettier's `all`/`es5` at each translation layer
- Rename `util/` -> `spec/` (pure shared helpers)
- Split `SourceText`: mechanical access stays in core, JS/TS lexis moves to `SourceTextExt`
- Drop the `oxc_syntax` dependency from core

All behaviros, Prettier conformance are unchanged.
@graphite-app graphite-app Bot force-pushed the 06-04-refactor_formatter_core_purify_core_and_define_rules branch from 12a7397 to 5778a2d Compare June 4, 2026 07:03
@graphite-app graphite-app Bot merged commit 5778a2d into main Jun 4, 2026
30 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label Jun 4, 2026
@graphite-app graphite-app Bot deleted the 06-04-refactor_formatter_core_purify_core_and_define_rules branch June 4, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-formatter Area - Formatter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant