Skip to content

Conversation

@connorshea
Copy link
Contributor

@connorshea connorshea commented Dec 8, 2025

We should probably also improve the type: string stuff in the output Markdown to serialize enums with their actual values, but that's a separate problem.

This also updates the logic for generating the oxfmtrc configuration_schema.json file so it properly matches the way we generate the configuration_schema.json for oxlint, including with markdownDescription fields. See the oxlintrc file here.

Before:

Screenshot 2025-12-07 at 10 29 13 PM

After:

Screenshot 2025-12-07 at 10 30 07 PM

Copilot AI review requested due to automatic review settings December 8, 2025 04:47
@connorshea connorshea requested a review from Dunqing as a code owner December 8, 2025 04:47
@github-actions github-actions bot added A-formatter Area - Formatter C-docs Category - Documentation. Related to user-facing or internal documentation labels Dec 8, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the documentation formatting for .oxfmtrc.jsonc configuration fields by consistently wrapping default values and special characters in backticks. This enhancement improves readability and ensures proper rendering in markdown-based documentation and JSON schema descriptions.

Key changes:

  • Added backticks around all default values in doc comments (booleans, numbers, and string enums)
  • Wrapped special characters like > in backticks for proper markdown rendering
  • Split long documentation lines for improved readability (e.g., bracketSameLine description)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
crates/oxc_formatter/src/service/oxfmtrc.rs Updated source doc comments to use backticks around default values and special characters
npm/oxfmt/configuration_schema.json Generated JSON schema with improved description formatting
crates/oxc_formatter/tests/snapshots/schema_json.snap Updated test snapshot reflecting schema changes
tasks/website_formatter/src/snapshots/schema_markdown.snap Updated markdown documentation snapshot with improved formatting

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 8, 2025

CodSpeed Performance Report

Merging #16587 will not alter performance

Comparing oxfmt-config-fields-docs (87ca29c) with main (28e0682)1

Summary

✅ 38 untouched
⏩ 7 skipped2

Footnotes

  1. No successful run was found on main (569abe2) during the generation of this report, so 28e0682 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 7 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.

@connorshea connorshea changed the title docs(oxfmt): Improve docs for .oxfmtrc.jsonc config fields docs(oxfmt): Improve docs for .oxfmtrc.jsonc config fields and add markdownDescription fields to JSON Schema Dec 8, 2025
Copy link
Member

@leaysgur leaysgur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! And sorry for the late review.

Can you resolve the merge conflicts?

@connorshea connorshea force-pushed the oxfmt-config-fields-docs branch from 6242c41 to 356a549 Compare December 10, 2025 01:56
@connorshea connorshea requested a review from leaysgur December 10, 2025 01:56
@connorshea
Copy link
Contributor Author

@leaysgur rebased and ready to go :)

Copy link
Member

@leaysgur leaysgur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you~!

@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Dec 10, 2025
Copy link
Member

leaysgur commented Dec 10, 2025

Merge activity

…markdownDescription fields to JSON Schema (#16587)

We should probably also improve the `type: string` stuff in the output Markdown to serialize enums with their actual values, but that's a separate problem.

This also updates the logic for generating the oxfmtrc `configuration_schema.json` file so it properly matches the way we generate the configuration_schema.json for oxlint, including with `markdownDescription` fields. See the oxlintrc file [here](https://github.com/oxc-project/oxc/blob/09ca3864227b30fa271d0ff35c5b5aa657f7c575/crates/oxc_linter/src/config/oxlintrc.rs#L205).

Before:

<img width="633" height="417" alt="Screenshot 2025-12-07 at 10 29 13 PM" src="https://github.com/user-attachments/assets/5cb205e3-2180-445b-a255-10b0831ff38a" />

After:

<img width="807" height="213" alt="Screenshot 2025-12-07 at 10 30 07 PM" src="https://github.com/user-attachments/assets/f5b1eb5b-bcb9-4348-8517-12ef3b91b155" />
@graphite-app graphite-app bot force-pushed the oxfmt-config-fields-docs branch from 87ca29c to 8babdf9 Compare December 10, 2025 02:22
@graphite-app graphite-app bot merged commit 8babdf9 into main Dec 10, 2025
20 checks passed
@graphite-app graphite-app bot deleted the oxfmt-config-fields-docs branch December 10, 2025 02:28
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 10, 2025
Copilot AI pushed a commit that referenced this pull request Dec 10, 2025
…markdownDescription fields to JSON Schema (#16587)

We should probably also improve the `type: string` stuff in the output Markdown to serialize enums with their actual values, but that's a separate problem.

This also updates the logic for generating the oxfmtrc `configuration_schema.json` file so it properly matches the way we generate the configuration_schema.json for oxlint, including with `markdownDescription` fields. See the oxlintrc file [here](https://github.com/oxc-project/oxc/blob/09ca3864227b30fa271d0ff35c5b5aa657f7c575/crates/oxc_linter/src/config/oxlintrc.rs#L205).

Before:

<img width="633" height="417" alt="Screenshot 2025-12-07 at 10 29 13 PM" src="https://github.com/user-attachments/assets/5cb205e3-2180-445b-a255-10b0831ff38a" />

After:

<img width="807" height="213" alt="Screenshot 2025-12-07 at 10 30 07 PM" src="https://github.com/user-attachments/assets/f5b1eb5b-bcb9-4348-8517-12ef3b91b155" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants