feat(oxfmt): Support oxfmtrc overrides config#18068
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
overrides config
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
56eb9f2 to
d9287b9
Compare
34825d3 to
6d0ee5c
Compare
d9287b9 to
f426209
Compare
6d0ee5c to
fba5c1d
Compare
f426209 to
8166c80
Compare
fba5c1d to
c1f1359
Compare
44bf696 to
ce3f6eb
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for .oxfmtrc overrides so users can apply file-specific formatting options.
Changes:
- Extend the oxfmtrc schema/docs to include
overridesandOxfmtOverrideConfig. - Add Rust config structures + parsing for
overrides, and stripoverridesbefore passing config to Prettier. - Implement per-file override resolution in
ConfigResolverusing glob matching.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tasks/website_formatter/src/snapshots/schema_markdown.snap | Documents the new overrides section and nested options in markdown schema output. |
| tasks/website_formatter/src/snapshots/schema_json.snap | Updates the JSON schema snapshot with overrides, FormatConfig, and OxfmtOverrideConfig definitions. |
| npm/oxfmt/configuration_schema.json | Ships the updated JSON schema including overrides for npm consumers. |
| apps/oxfmt/src/core/oxfmtrc.rs | Introduces overrides in Oxfmtrc, adds OxfmtOverrideConfig, and ensures Prettier config stripping removes overrides. |
| apps/oxfmt/src/core/config.rs | Adds override resolution logic (match files/excludeFiles globs, merge options per file). |
| apps/oxfmt/Cargo.toml | Adds fast-glob dependency for glob matching. |
| Cargo.lock | Locks the new fast-glob dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Good milestone for us! |
Merge activity
|
ce3f6eb to
a95b9bb
Compare
Document the new `overrides` field for file-specific formatting options. Ref: oxc-project/oxc#18068 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs(formatter): add overrides configuration section Document the new `overrides` field for file-specific formatting options. Ref: oxc-project/oxc#18068 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Clarify glob pattern resolution in config.md Added clarification on glob pattern resolution in config. Signed-off-by: Yuji Sugiura <6259812+leaysgur@users.noreply.github.com> --------- Signed-off-by: Yuji Sugiura <6259812+leaysgur@users.noreply.github.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Yuji Sugiura <6259812+leaysgur@users.noreply.github.com>

Fixes #17585