Skip to content

chore: add oxfmt as prettier plugin#1066

Merged
zerob13 merged 1 commit intodevfrom
chore/oxfmt-support
Oct 30, 2025
Merged

chore: add oxfmt as prettier plugin#1066
zerob13 merged 1 commit intodevfrom
chore/oxfmt-support

Conversation

@zerob13
Copy link
Copy Markdown
Collaborator

@zerob13 zerob13 commented Oct 30, 2025

add oxfmt as prettier plugin

Summary by CodeRabbit

  • Chores
    • Enhanced code formatting tooling for JavaScript and TypeScript files
    • Improved formatting script performance through caching

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 30, 2025

Walkthrough

The pull request adds support for the @prettier/plugin-oxc to handle formatting of JavaScript and TypeScript files using the oxc and oxc-ts parsers respectively. The format script is updated to include caching, and the plugin is added as a new dev dependency.

Changes

Cohort / File(s) Change Summary
Prettier Configuration
\.prettierrc\.yaml
Adds overrides section specifying @prettier/plugin-oxc plugin with oxc parser for JS files (js/mjs/cjs/jsx) and oxc-ts parser for TS files (ts/mts/cts/tsx)
Build & Dependencies
package\.json
Adds --cache flag to format script; introduces new devDependency @prettier/plugin-oxc@^0.0.4

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify @prettier/plugin-oxc version compatibility and configuration syntax
  • Confirm the oxc/oxc-ts parser settings align with project requirements
  • Check that cache flag addition doesn't conflict with existing development workflows

Poem

🐰 Faster hops with oxc now,
Prettier formats, take a bow,
Cache makes builds so fleet,
TypeScript and JS, complete!
Hop hop hop—formatting's sweet! 🎨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "chore: add oxfmt as prettier plugin" clearly and accurately describes the primary changes in this pull request. The changeset adds the @prettier/plugin-oxc dependency to package.json and configures it with the oxc and oxc-ts parsers in .prettierrc.yaml for formatting JavaScript and TypeScript files. The title is concise, specific, and uses appropriate terminology that a teammate would immediately understand when scanning pull request history. It avoids vague language and directly conveys the intent of the change.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/oxfmt-support

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df534b8 and 875afa8.

📒 Files selected for processing (2)
  • .prettierrc.yaml (1 hunks)
  • package.json (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx,vue,css,scss,md,json,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Prettier style: single quotes, no semicolons, print width 100; run pnpm run format

Files:

  • package.json
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: AGENTS.md:0-0
Timestamp: 2025-10-14T08:02:59.495Z
Learning: Applies to **/*.{ts,tsx,js,jsx,vue} : Use OxLint for JS/TS code; keep lint clean
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/development-setup.mdc:0-0
Timestamp: 2025-07-21T01:45:40.036Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : 使用 OxLint 进行代码检查
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: AGENTS.md:0-0
Timestamp: 2025-10-14T08:02:59.495Z
Learning: Applies to **/*.{ts,tsx,js,jsx,vue,css,scss,md,json,yml,yaml} : Prettier style: single quotes, no semicolons, print width 100; run pnpm run format
📚 Learning: 2025-10-14T08:02:59.495Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: AGENTS.md:0-0
Timestamp: 2025-10-14T08:02:59.495Z
Learning: Applies to **/*.{ts,tsx,js,jsx,vue} : Use OxLint for JS/TS code; keep lint clean

Applied to files:

  • .prettierrc.yaml
  • package.json
📚 Learning: 2025-07-21T01:45:40.036Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/development-setup.mdc:0-0
Timestamp: 2025-07-21T01:45:40.036Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : 使用 OxLint 进行代码检查

Applied to files:

  • .prettierrc.yaml
  • package.json
📚 Learning: 2025-10-14T08:02:59.495Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: AGENTS.md:0-0
Timestamp: 2025-10-14T08:02:59.495Z
Learning: Applies to **/*.{ts,tsx,js,jsx,vue,css,scss,md,json,yml,yaml} : Prettier style: single quotes, no semicolons, print width 100; run pnpm run format

Applied to files:

  • .prettierrc.yaml
  • package.json
📚 Learning: 2025-07-21T01:46:19.702Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.702Z
Learning: Applies to **/*.{ts,tsx} : 优雅降级处理

Applied to files:

  • .prettierrc.yaml
📚 Learning: 2025-09-06T03:07:23.817Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-06T03:07:23.817Z
Learning: Applies to **/*.{ts,tsx,vue} : Enable and adhere to strict TypeScript typing (avoid implicit any, prefer precise types)

Applied to files:

  • .prettierrc.yaml
📚 Learning: 2025-09-06T03:07:23.817Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-06T03:07:23.817Z
Learning: Applies to **/*.{ts,tsx,js,vue} : Use English for all logs and comments

Applied to files:

  • .prettierrc.yaml
📚 Learning: 2025-10-14T08:02:59.495Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: AGENTS.md:0-0
Timestamp: 2025-10-14T08:02:59.495Z
Learning: After completing a feature, run pnpm run format and pnpm run lint to keep formatting and lint status clean

Applied to files:

  • package.json
📚 Learning: 2025-10-12T00:58:06.513Z
Learnt from: zerob13
PR: ThinkInAIXYZ/deepchat#977
File: package.json:137-137
Timestamp: 2025-10-12T00:58:06.513Z
Learning: In this Electron project, renderer process dependencies (used only in src/renderer/) should be placed in devDependencies because they are bundled by electron-vite during the build process. Only main process dependencies (used in src/main/) need to be in the dependencies section.

Applied to files:

  • package.json
🔇 Additional comments (3)
.prettierrc.yaml (1)

5-17: Configuration aligns with official Prettier documentation.

The overrides configuration matches the official Prettier documentation for @prettier/plugin-oxc, correctly specifying the oxc parser for JS/MJS/CJS/JSX files and oxc-ts parser for TS/MTS/CTS/TSX files. The plugin provides JavaScript and TypeScript parsing capabilities via the oxc and oxc-ts parsers.

package.json (2)

23-23: Format script caching optimization.

The addition of the --cache flag improves build performance by avoiding re-formatting unchanged files on subsequent runs. This is compatible with the new @prettier/plugin-oxc plugin.


107-107: Plugin added correctly as dev dependency.

The @prettier/plugin-oxc is an official Prettier plugin provided separately from Prettier's core. Placement in devDependencies is appropriate since this is a development tool.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zerob13 zerob13 merged commit 5f90491 into dev Oct 30, 2025
2 checks passed
@zerob13 zerob13 deleted the chore/oxfmt-support branch November 6, 2025 10:52
@coderabbitai coderabbitai bot mentioned this pull request Mar 26, 2026
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