Skip to content

Scope oxfmt to TypeScript and JavaScript - #15

Merged
antstanley merged 1 commit into
mainfrom
chore/scope-oxfmt
Jul 25, 2026
Merged

Scope oxfmt to TypeScript and JavaScript#15
antstanley merged 1 commit into
mainfrom
chore/scope-oxfmt

Conversation

@antstanley

Copy link
Copy Markdown
Owner

A bare oxfmt . wanted to rewrite 34 files, none of them TS or JS: the Starlight docs prose, the specs, every README, the GitHub workflows, all package.json files, and the commented .oxlintrc.json and config/*.jsonc. That is why the formatter has only ever been invoked as oxfmt packages/*/src — the safe scope lived in people's heads rather than in the config.

ignorePatterns writes it down, grouped by why:

  • .changeset/** + **/CHANGELOG.md — owned by changesets. The CLI emits frontmatter with double quotes and rewrites these on every release, so oxfmt flipping them under singleQuote starts a fight the CLI always wins. This actually bit the olive-clouds-repeat changeset.
  • **/*.md, **/*.mdx — authored prose. Reflowing hand-written documentation is a content change, not formatting.
  • **/*.json, **/*.jsoncpackage.json field order plus the deliberately commented .oxlintrc.json and config/*.jsonc deploy files. oxfmt's sortPackageJson behaviour is not wanted here.
  • .github/** — workflow YAML, where layout is deliberate.

Build output needs no entry: oxfmt reads .gitignore by default, which already covers dist/, packages/cli/agent/, and node_modules/.

Verified four ways, since the failure mode of an over-broad ignore is a formatter that silently does nothing:

  1. oxfmt --check . is clean (118 files matched, down from 185).
  2. A deliberately misformatted .ts probe is still caught repo-wide.
  3. The same probe is still caught via oxfmt --check packages/*/src.
  4. A probe changeset keeps its double quotes through a real write pass, not just --check.

Re-verified after rebasing onto the v0.3.3 release commit, which bumped every package.json and added CHANGELOG entries — both categories are correctly ignored.

No changeset: tooling config only, internal per DEVELOPMENT.md.

Follow-up worth considering: oxfmt . is now safe to run bare, so packages/*/src is no longer load-bearing. A root format script plus a CI check would stop drift accumulating — nothing currently enforces formatting, which is how the earlier 13-file drift built up.

🤖 Generated with Claude Code

A bare `oxfmt .` wanted to rewrite 34 files, none of them TS or JS: the
Starlight docs prose, the specs, every README, the GitHub workflows, all
package.json files, and the commented .oxlintrc.json and config/*.jsonc.
That is why the formatter has only ever been run as `oxfmt packages/*/src` —
the safe scope was carried in peoples heads instead of the config.

ignorePatterns writes it down. The changesets directory matters most: the
changesets CLI emits frontmatter with double quotes and rewrites those files
on every release, so oxfmt flipping them to single quotes under singleQuote
starts a fight the CLI always wins.

Build output needs no entry — oxfmt reads .gitignore by default, which
already covers dist/, packages/cli/agent/, and node_modules/.

Verified: `oxfmt --check .` is clean; a deliberately misformatted .ts is still
caught both repo-wide and via packages/*/src; and a probe changeset keeps its
double quotes through a real write pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antstanley
antstanley merged commit 0b59587 into main Jul 25, 2026
1 check passed
@antstanley
antstanley deleted the chore/scope-oxfmt branch July 25, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant