Scope oxfmt to TypeScript and JavaScript - #15
Merged
Conversation
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>
Merged
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.
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, allpackage.jsonfiles, and the commented.oxlintrc.jsonandconfig/*.jsonc. That is why the formatter has only ever been invoked asoxfmt packages/*/src— the safe scope lived in people's heads rather than in the config.ignorePatternswrites 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 undersingleQuotestarts a fight the CLI always wins. This actually bit theolive-clouds-repeatchangeset.**/*.md,**/*.mdx— authored prose. Reflowing hand-written documentation is a content change, not formatting.**/*.json,**/*.jsonc—package.jsonfield order plus the deliberately commented.oxlintrc.jsonandconfig/*.jsoncdeploy files. oxfmt'ssortPackageJsonbehaviour is not wanted here..github/**— workflow YAML, where layout is deliberate.Build output needs no entry: oxfmt reads
.gitignoreby default, which already coversdist/,packages/cli/agent/, andnode_modules/.Verified four ways, since the failure mode of an over-broad ignore is a formatter that silently does nothing:
oxfmt --check .is clean (118 files matched, down from 185)..tsprobe is still caught repo-wide.oxfmt --check packages/*/src.--check.Re-verified after rebasing onto the v0.3.3 release commit, which bumped every
package.jsonand 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, sopackages/*/srcis no longer load-bearing. A rootformatscript 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