-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
chore: use oxfmt instead of prettier #5617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds Oxfmt formatting support and config, updates CI to run a format check, swaps formatting tooling in package/lint configs, adjusts workspace dependencies, and applies minor formatting edits and dependency tweaks across templates and plugin manifests. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer / PR
participant CI as GitHub Actions (ci.yml)
participant TypecheckJob as typecheck job
participant Lint as Lint/Dedupe/Typecheck steps
participant FmtCheck as "Run format check" (pnpm run fmtcheck)
participant Build as Build step
Dev->>CI: push PR
CI->>TypecheckJob: start
TypecheckJob->>Lint: run lint/dedupe/typecheck
Lint-->>TypecheckJob: success
TypecheckJob->>FmtCheck: run pnpm run fmtcheck
alt fmtcheck succeeds
FmtCheck-->>TypecheckJob: success
else fmtcheck fails
FmtCheck-->>TypecheckJob: fallback echo "fmtcheck failed, ignore before it stable"
end
TypecheckJob->>Build: proceed to build
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)pnpm-workspace.yaml📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
🔇 Additional comments (1)
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. Comment |
There was a problem hiding this 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 replaces Prettier with oxfmt as the code formatter for the Eggjs monorepo. The change introduces oxfmt configuration and adds a format check step to the CI pipeline while maintaining Prettier as a dependency (likely for backward compatibility or gradual migration).
Key changes:
- Adds oxfmt as a new dependency with configuration file
- Introduces a new
fmtcheckscript to validate code formatting in CI - Applies formatting changes (blank line addition) to existing test files
Reviewed Changes
Copilot reviewed 5 out of 37 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Adds oxfmt v0.5.0 to the catalog of shared dependencies |
| package.json | Adds oxfmt as a dev dependency and introduces fmtcheck script |
| .oxfmtrc.json | Configures oxfmt with project-specific formatting rules (2-space indent, 120 line width, single quotes, etc.) |
| .github/workflows/ci.yml | Adds format check step to CI pipeline before the build step |
| tools/egg-bin/test/commands/cov.test.ts | Adds blank line (formatting change applied by oxfmt) |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## next #5617 +/- ##
=======================================
Coverage 80.93% 80.93%
=======================================
Files 266 266
Lines 6526 6526
Branches 948 948
=======================================
Hits 5282 5282
Misses 1165 1165
Partials 79 79 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
| logger, | ||
| messenger, | ||
| }: { | ||
| { log, logger, messenger }: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prettier format should be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 9 out of 41 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/cluster/src/utils/mode/base/app.ts (1)
96-104: Constructor param typing reflowed; behavior intact.No issues. Optional: extract a named
BaseAppUtilsInittype for the second param to aid reuse and public API stability across base/agent utils..github/workflows/ci.yml (1)
51-53: Suggested refactor is valid and aligns with GitHub Actions best practices; no blocking issues found.The verification confirms:
scripts.fmtcheckexists and is properly wired:oxfmt --check .oxfmtandoxlintare configured via pnpm catalog + lint-staged- No downstream steps depend on fmtcheck outcome; all subsequent steps (build, site:build) are unconditional
Both the current
|| echoapproach and the proposedcontinue-on-errorapproach allow the job to proceed even if fmtcheck fails. However, the refactored version is clearer and more maintainable:
- Makes failure explicit in workflow UI rather than masking it
- Enables structured, conditional handling of outcomes
- Follows GitHub Actions documented patterns
The review comment's suggestion is sound and recommended.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (32)
packages/core/test/fixtures/agent/node_modules/a/app/extend/agent.jsis excluded by!**/node_modules/**packages/core/test/fixtures/agent/node_modules/b/app/extend/agent.jsis excluded by!**/node_modules/**packages/core/test/fixtures/application/node_modules/a/app/extend/application.jsis excluded by!**/node_modules/**packages/core/test/fixtures/application/node_modules/b/app/extend/application.jsis excluded by!**/node_modules/**packages/core/test/fixtures/extend/node_modules/b/app/extend/request.jsis excluded by!**/node_modules/**packages/core/test/fixtures/extend/node_modules/b/app/extend/response.jsis excluded by!**/node_modules/**packages/core/test/fixtures/helper/node_modules/a/app/extend/helper.jsis excluded by!**/node_modules/**packages/core/test/fixtures/helper/node_modules/b/app/extend/helper.jsis excluded by!**/node_modules/**packages/core/test/fixtures/middleware-override/node_modules/a/app/middleware/a.jsis excluded by!**/node_modules/**packages/core/test/fixtures/middleware-override/node_modules/a/app/middleware/custom.jsis excluded by!**/node_modules/**packages/core/test/fixtures/middleware-override/node_modules/b/app/middleware/b.jsis excluded by!**/node_modules/**packages/core/test/fixtures/middleware-override/node_modules/b/app/middleware/custom.jsis excluded by!**/node_modules/**packages/core/test/fixtures/middleware-override/node_modules/b/app/middleware/status.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin-pkg-exports/node_modules/a/foo_dist/esm/config/config.default.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/a/app.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/b/agent.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/b/app.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/b/app/service/bar2.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/c/agent.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/c/app.jsis excluded by!**/node_modules/**packages/egg/test/fixtures/apps/loader-plugin/node_modules/a/app.jsis excluded by!**/node_modules/**packages/egg/test/fixtures/apps/loader-plugin/node_modules/b/app.jsis excluded by!**/node_modules/**packages/egg/test/fixtures/apps/loader-plugin/node_modules/b/app/service/bar2.jsis excluded by!**/node_modules/**packages/egg/test/fixtures/apps/loader-plugin/node_modules/c/app.jsis excluded by!**/node_modules/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yamltools/egg-bin/test/fixtures/demo-app-esm/node_modules/aliyun-egg/index.jsis excluded by!**/node_modules/**tools/egg-bin/test/fixtures/demo-app/node_modules/aliyun-egg/index.jsis excluded by!**/node_modules/**tools/egg-bin/test/fixtures/egg-require/node_modules/aliyun-egg/index.jsis excluded by!**/node_modules/**tools/egg-bin/test/fixtures/egg-revert/node_modules/aliyun-egg/index.jsis excluded by!**/node_modules/**tools/egg-bin/test/fixtures/example-declarations/node_modules/aliyun-egg/index.jsis excluded by!**/node_modules/**tools/egg-bin/test/fixtures/example-ts-cluster/node_modules/egg/index.jsis excluded by!**/node_modules/**tools/scripts/test/fixtures/pkg-config-esm/node_modules/custom-framework/index.jsis excluded by!**/node_modules/**
📒 Files selected for processing (9)
.github/workflows/ci.yml(1 hunks).oxfmtrc.json(1 hunks)package.json(3 hunks)packages/cluster/src/utils/mode/base/agent.ts(1 hunks)packages/cluster/src/utils/mode/base/app.ts(1 hunks)packages/koa/test/application/index.test.ts(1 hunks)pnpm-workspace.yaml(1 hunks)site/.vitepress/config.mts(1 hunks)tools/egg-bin/test/commands/cov.test.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
packages/**/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use TypeScript for all source files in packages (no JavaScript source files)
Files:
packages/cluster/src/utils/mode/base/app.tspackages/cluster/src/utils/mode/base/agent.ts
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/*.ts: Prefer TypeScript and ESM: write sources and exports in .ts (ESM-first) rather than CommonJS
Use two-space indentation, trailing commas, and semicolons (Prettier/oxlint defaults)
Name files in lowercase with hyphens (e.g., loader-context.ts)
Name classes in PascalCase
Name functions and variables in camelCase
Re-export types thoughtfully to keep the public API stable
Files:
packages/cluster/src/utils/mode/base/app.tspackages/koa/test/application/index.test.tstools/egg-bin/test/commands/cov.test.tspackages/cluster/src/utils/mode/base/agent.ts
{packages,plugins,tools}/**/src/**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
{packages,plugins,tools}/**/src/**/*.ts: All exported functions, methods, and getters must have explicit return type annotations (isolatedDeclarations)
Avoid computed property names with symbols in class declarations; prefer explicit methods (isolatedDeclarations)
Provide explicit type annotations for class properties when needed (do not rely on implicit inference for exported members)
Exported symbol constants must be annotated with unique symbol type
Files:
packages/cluster/src/utils/mode/base/app.tspackages/cluster/src/utils/mode/base/agent.ts
packages/**/test/**/*.test.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
packages/**/test/**/*.test.ts: Name test files as test/**/*.test.ts and run them with Vitest
Use import { describe, it } from 'vitest' in tests
Use Node.js built-in assert module for test assertions
Files:
packages/koa/test/application/index.test.ts
**/test/**/*.test.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/test/**/*.test.ts: Place test suites following Vitest discovery: /test//*.test.ts
Mirror the repository test pattern when adding new suitesTest files should follow the pattern test/**/*.test.ts
Files:
packages/koa/test/application/index.test.tstools/egg-bin/test/commands/cov.test.ts
{packages,plugins}/**/test/**/*.test.ts
📄 CodeRabbit inference engine (CLAUDE.md)
For Vitest packages, import tests from 'vitest' and use Node's built-in assert for assertions
Files:
packages/koa/test/application/index.test.ts
tools/egg-bin/test/**/*.test.ts
📄 CodeRabbit inference engine (CLAUDE.md)
egg-bin tests use Mocha; test files should be under test/**/*.test.ts
Files:
tools/egg-bin/test/commands/cov.test.ts
{package.json,packages/**/package.json,plugins/**/package.json,tools/**/package.json}
📄 CodeRabbit inference engine (CLAUDE.md)
{package.json,packages/**/package.json,plugins/**/package.json,tools/**/package.json}: All packages must require Node.js >= 22.18.0 via the engines.node field
Each package must include scripts: typecheck as "tsc --noEmit" and lint as "oxlint --type-aware"
External dependencies should reference catalog entries using "catalog:" and internal workspace dependencies should use "workspace:*"
Files:
package.json
pnpm-workspace.yaml
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Define dependency versions via the catalog section in pnpm-workspace.yaml and reference them with "catalog:"
Use pnpm catalog mode: dependencies declared in pnpm-workspace.yaml catalog and referenced as "catalog:" in package manifests
Files:
pnpm-workspace.yaml
🧠 Learnings (2)
📚 Learning: 2025-10-15T12:53:09.198Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-15T12:53:09.198Z
Learning: Applies to {package.json,packages/**/package.json,plugins/**/package.json,tools/**/package.json} : Each package must include scripts: typecheck as "tsc --noEmit" and lint as "oxlint --type-aware"
Applied to files:
package.json
📚 Learning: 2025-09-18T07:56:17.417Z
Learnt from: CR
PR: eggjs/egg#0
File: AGENTS.md:0-0
Timestamp: 2025-09-18T07:56:17.417Z
Learning: Applies to **/*.ts : Use two-space indentation, trailing commas, and semicolons (Prettier/oxlint defaults)
Applied to files:
.oxfmtrc.json
🪛 Biome (2.1.2)
.oxfmtrc.json
[error] 6-6: Expected a property but instead found '// "jsxQuoteStyle": "double",'.
Expected a property here.
(parse)
[error] 7-7: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 7-7: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 7-7: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 7-7: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 8-8: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 8-8: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 8-8: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 8-9: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: Test (macos-latest, 24, 4/5)
- GitHub Check: Test (macos-latest, 22, 5/5)
- GitHub Check: Test (macos-latest, 24, 1/5)
- GitHub Check: Test (macos-latest, 22, 4/5)
- GitHub Check: Test (windows-latest, 24, 1/5)
- GitHub Check: Test (windows-latest, 22, 3/5)
- GitHub Check: Test (windows-latest, 22, 5/5)
- GitHub Check: Test (macos-latest, 24, 3/5)
- GitHub Check: Test (windows-latest, 22, 2/5)
- GitHub Check: Test bin (windows-latest, 22, 0/5)
- GitHub Check: Test bin (windows-latest, 22, 1/5)
- GitHub Check: Test bin (ubuntu-latest, 22, 0/5)
- GitHub Check: Test bin (ubuntu-latest, 22, 1/5)
- GitHub Check: Test bin (ubuntu-latest, 22, 2/5)
- GitHub Check: Test bin (windows-latest, 22, 2/5)
- GitHub Check: Test bin (windows-latest, 22, 3/5)
- GitHub Check: Test scripts (ubuntu-latest, 22, 3/5)
- GitHub Check: Test scripts (ubuntu-latest, 22, 4/5)
- GitHub Check: Test scripts (ubuntu-latest, 22, 1/5)
- GitHub Check: typecheck
🔇 Additional comments (8)
tools/egg-bin/test/commands/cov.test.ts (1)
164-176: Formatting-only; no behavior change. LGTM.packages/koa/test/application/index.test.ts (1)
143-147: Formatting-only; behavior unchanged. LGTM.site/.vitepress/config.mts (1)
18-21: Inline head meta entries — OK.Cosmetic reformat aligning with oxfmt; no behavior change.
pnpm-workspace.yaml (1)
154-155: Catalog entries correctly added for oxfmt migration.The oxfmt and updated oxlint versions are properly added to the catalog and follow the established pattern for workspace-managed dependencies.
packages/cluster/src/utils/mode/base/agent.ts (1)
66-72: Formatting change consistent with oxfmt standards.The constructor parameter destructuring has been reformatted to align with oxfmt's style guidelines. No logic or type information has changed, and this aligns with the tooling migration objectives.
package.json (2)
22-22: oxfmt integration correctly added to dependencies and scripts.The oxfmt catalog dependency and fmtcheck script properly support the migration to oxfmt as the primary formatter.
Also applies to: 38-38
65-72: Lint-staged configuration properly refactored for oxfmt/oxlint toolchain.The lint-staged rules have been split into two patterns: non-code files continue using Prettier, while TypeScript/JavaScript files are now routed through oxfmt and oxlint. This separation aligns with the PR objectives and maintains consistency with the workspace's linting strategy.
Please verify that the negated glob pattern
!(*.{ts,mts,cts,js,mjs,cjs,jsx,tsx})works reliably across your CI/CD environments (GitHub Actions, local development, etc.), as complex glob negation can behave inconsistently across different shells and platforms..oxfmtrc.json (1)
1-23: Review comment verified as correct.The review accurately identifies the problem: the
.oxfmtrc.jsonfile contains JSON comments (lines 6, 9, 11–22), which violates the JSON specification and will cause parse failure. The two solutions provided are both valid:
- Remove all comments (as shown in the diff)
- Rename the file to
.oxfmtrc.jsoncto enable JSONC format—oxfmt v0.5.0+ supports.oxfmtrc.jsoncconfiguration files with commentsThe developer now has clear, actionable guidance to resolve the invalid configuration file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
packages/cluster/src/utils/mode/base/agent.ts (1)
66-73: Formatting change conflicts with previous review feedback.A past review comment on Line 68 stated "prettier format should be better," yet this PR reformats the constructor parameter destructuring to a single-line style via oxfmt. While this aligns with the PR's objective to migrate to oxfmt, please confirm that the previous preference for multi-line formatting is no longer applicable, or consider adjusting the oxfmt configuration if multi-line parameter destructuring should be preserved for readability.
Based on past review comments.
🧹 Nitpick comments (1)
package.json (1)
66-72: Simplify the negated glob pattern in lint-staged.The negated glob pattern
!(*.{ts,mts,cts,js,mjs,cjs,jsx,tsx})on Line 66 may not work consistently across different environments and shells. This was previously flagged as complex.Consider explicitly listing the file extensions that should use Prettier instead of using negation:
- "!(*.{ts,mts,cts,js,mjs,cjs,jsx,tsx})": [ + "*.{json,md,yml,yaml,html,xml,css,scss}": [ "prettier --ignore-unknown --write" ],This approach is more explicit and portable. Adjust the extensions list based on the non-code file types in your repository.
Based on past review comments.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (32)
packages/core/test/fixtures/agent/node_modules/a/app/extend/agent.jsis excluded by!**/node_modules/**packages/core/test/fixtures/agent/node_modules/b/app/extend/agent.jsis excluded by!**/node_modules/**packages/core/test/fixtures/application/node_modules/a/app/extend/application.jsis excluded by!**/node_modules/**packages/core/test/fixtures/application/node_modules/b/app/extend/application.jsis excluded by!**/node_modules/**packages/core/test/fixtures/extend/node_modules/b/app/extend/request.jsis excluded by!**/node_modules/**packages/core/test/fixtures/extend/node_modules/b/app/extend/response.jsis excluded by!**/node_modules/**packages/core/test/fixtures/helper/node_modules/a/app/extend/helper.jsis excluded by!**/node_modules/**packages/core/test/fixtures/helper/node_modules/b/app/extend/helper.jsis excluded by!**/node_modules/**packages/core/test/fixtures/middleware-override/node_modules/a/app/middleware/a.jsis excluded by!**/node_modules/**packages/core/test/fixtures/middleware-override/node_modules/a/app/middleware/custom.jsis excluded by!**/node_modules/**packages/core/test/fixtures/middleware-override/node_modules/b/app/middleware/b.jsis excluded by!**/node_modules/**packages/core/test/fixtures/middleware-override/node_modules/b/app/middleware/custom.jsis excluded by!**/node_modules/**packages/core/test/fixtures/middleware-override/node_modules/b/app/middleware/status.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin-pkg-exports/node_modules/a/foo_dist/esm/config/config.default.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/a/app.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/b/agent.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/b/app.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/b/app/service/bar2.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/c/agent.jsis excluded by!**/node_modules/**packages/core/test/fixtures/plugin/node_modules/c/app.jsis excluded by!**/node_modules/**packages/egg/test/fixtures/apps/loader-plugin/node_modules/a/app.jsis excluded by!**/node_modules/**packages/egg/test/fixtures/apps/loader-plugin/node_modules/b/app.jsis excluded by!**/node_modules/**packages/egg/test/fixtures/apps/loader-plugin/node_modules/b/app/service/bar2.jsis excluded by!**/node_modules/**packages/egg/test/fixtures/apps/loader-plugin/node_modules/c/app.jsis excluded by!**/node_modules/**pnpm-lock.yamlis excluded by!**/pnpm-lock.yamltools/egg-bin/test/fixtures/demo-app-esm/node_modules/aliyun-egg/index.jsis excluded by!**/node_modules/**tools/egg-bin/test/fixtures/demo-app/node_modules/aliyun-egg/index.jsis excluded by!**/node_modules/**tools/egg-bin/test/fixtures/egg-require/node_modules/aliyun-egg/index.jsis excluded by!**/node_modules/**tools/egg-bin/test/fixtures/egg-revert/node_modules/aliyun-egg/index.jsis excluded by!**/node_modules/**tools/egg-bin/test/fixtures/example-declarations/node_modules/aliyun-egg/index.jsis excluded by!**/node_modules/**tools/egg-bin/test/fixtures/example-ts-cluster/node_modules/egg/index.jsis excluded by!**/node_modules/**tools/scripts/test/fixtures/pkg-config-esm/node_modules/custom-framework/index.jsis excluded by!**/node_modules/**
📒 Files selected for processing (12)
.github/workflows/ci.yml(1 hunks).oxfmtrc.json(1 hunks)package.json(3 hunks)packages/cluster/src/utils/mode/base/agent.ts(1 hunks)packages/cluster/src/utils/mode/base/app.ts(1 hunks)packages/koa/test/application/index.test.ts(1 hunks)plugins/mock/package.json(0 hunks)pnpm-workspace.yaml(1 hunks)site/.vitepress/config.mts(1 hunks)tools/create-egg/src/templates/egg3-tegg/package.json(0 hunks)tools/create-egg/src/templates/tegg/package.json(1 hunks)tools/egg-bin/test/commands/cov.test.ts(1 hunks)
💤 Files with no reviewable changes (2)
- plugins/mock/package.json
- tools/create-egg/src/templates/egg3-tegg/package.json
🧰 Additional context used
📓 Path-based instructions (9)
{package.json,packages/**/package.json,plugins/**/package.json,tools/**/package.json}
📄 CodeRabbit inference engine (CLAUDE.md)
{package.json,packages/**/package.json,plugins/**/package.json,tools/**/package.json}: All packages must require Node.js >= 22.18.0 via the engines.node field
Each package must include scripts: typecheck as "tsc --noEmit" and lint as "oxlint --type-aware"
External dependencies should reference catalog entries using "catalog:" and internal workspace dependencies should use "workspace:*"
Files:
tools/create-egg/src/templates/tegg/package.jsonpackage.json
packages/**/test/**/*.test.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
packages/**/test/**/*.test.ts: Name test files as test/**/*.test.ts and run them with Vitest
Use import { describe, it } from 'vitest' in tests
Use Node.js built-in assert module for test assertions
Files:
packages/koa/test/application/index.test.ts
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/*.ts: Prefer TypeScript and ESM: write sources and exports in .ts (ESM-first) rather than CommonJS
Use two-space indentation, trailing commas, and semicolons (Prettier/oxlint defaults)
Name files in lowercase with hyphens (e.g., loader-context.ts)
Name classes in PascalCase
Name functions and variables in camelCase
Re-export types thoughtfully to keep the public API stable
Files:
packages/koa/test/application/index.test.tspackages/cluster/src/utils/mode/base/agent.tspackages/cluster/src/utils/mode/base/app.tstools/egg-bin/test/commands/cov.test.ts
**/test/**/*.test.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/test/**/*.test.ts: Place test suites following Vitest discovery: /test//*.test.ts
Mirror the repository test pattern when adding new suitesTest files should follow the pattern test/**/*.test.ts
Files:
packages/koa/test/application/index.test.tstools/egg-bin/test/commands/cov.test.ts
{packages,plugins}/**/test/**/*.test.ts
📄 CodeRabbit inference engine (CLAUDE.md)
For Vitest packages, import tests from 'vitest' and use Node's built-in assert for assertions
Files:
packages/koa/test/application/index.test.ts
packages/**/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use TypeScript for all source files in packages (no JavaScript source files)
Files:
packages/cluster/src/utils/mode/base/agent.tspackages/cluster/src/utils/mode/base/app.ts
{packages,plugins,tools}/**/src/**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
{packages,plugins,tools}/**/src/**/*.ts: All exported functions, methods, and getters must have explicit return type annotations (isolatedDeclarations)
Avoid computed property names with symbols in class declarations; prefer explicit methods (isolatedDeclarations)
Provide explicit type annotations for class properties when needed (do not rely on implicit inference for exported members)
Exported symbol constants must be annotated with unique symbol type
Files:
packages/cluster/src/utils/mode/base/agent.tspackages/cluster/src/utils/mode/base/app.ts
pnpm-workspace.yaml
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Define dependency versions via the catalog section in pnpm-workspace.yaml and reference them with "catalog:"
Use pnpm catalog mode: dependencies declared in pnpm-workspace.yaml catalog and referenced as "catalog:" in package manifests
Files:
pnpm-workspace.yaml
tools/egg-bin/test/**/*.test.ts
📄 CodeRabbit inference engine (CLAUDE.md)
egg-bin tests use Mocha; test files should be under test/**/*.test.ts
Files:
tools/egg-bin/test/commands/cov.test.ts
🧠 Learnings (1)
📚 Learning: 2025-10-15T12:53:09.198Z
Learnt from: CR
PR: eggjs/egg#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-15T12:53:09.198Z
Learning: Applies to {package.json,packages/**/package.json,plugins/**/package.json,tools/**/package.json} : Each package must include scripts: typecheck as "tsc --noEmit" and lint as "oxlint --type-aware"
Applied to files:
package.json
🪛 Biome (2.1.2)
.oxfmtrc.json
[error] 6-6: Expected a property but instead found '// "jsxQuoteStyle": "double",'.
Expected a property here.
(parse)
[error] 7-7: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 7-7: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 7-7: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 7-7: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 8-8: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 8-8: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 8-8: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 8-9: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 10-10: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 11-23: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: Socket Security: Pull Request Alerts
- GitHub Check: Test (windows-latest, 24, 3/5)
- GitHub Check: Test (macos-latest, 22, 5/5)
- GitHub Check: Test (ubuntu-latest, 22, 3/5)
- GitHub Check: Test (ubuntu-latest, 24, 1/5)
- GitHub Check: Test (ubuntu-latest, 22, 2/5)
- GitHub Check: Test (ubuntu-latest, 24, 4/5)
- GitHub Check: Test (windows-latest, 24, 4/5)
- GitHub Check: Test (ubuntu-latest, 22, 5/5)
- GitHub Check: Test (macos-latest, 24, 5/5)
- GitHub Check: Test (macos-latest, 22, 1/5)
- GitHub Check: Test bin (ubuntu-latest, 22, 2/5)
- GitHub Check: Test bin (windows-latest, 22, 3/5)
- GitHub Check: Test bin (windows-latest, 22, 1/5)
- GitHub Check: Test bin (windows-latest, 22, 0/5)
- GitHub Check: Test bin (ubuntu-latest, 22, 1/5)
- GitHub Check: Test bin (windows-latest, 22, 2/5)
- GitHub Check: Test scripts (ubuntu-latest, 22, 1/5)
- GitHub Check: Test scripts (ubuntu-latest, 22, 3/5)
- GitHub Check: typecheck
🔇 Additional comments (9)
site/.vitepress/config.mts (1)
18-18: Formatting changes look good.The reformatting of meta tag entries from multi-line to single-line format is consistent with oxfmt conventions and maintains the same configuration semantics.
Also applies to: 20-20
tools/create-egg/src/templates/tegg/package.json (1)
26-26: LGTM! Dependency version alignment with beta.The version change for
@eggjs/scriptsfrom^4.0.0to"beta"aligns with other@eggjsdependencies in this template, ensuring consistency across the generated project.tools/egg-bin/test/commands/cov.test.ts (1)
164-164: LGTM! Minor formatting adjustment.The added blank line improves readability and aligns with the new formatter configuration.
packages/cluster/src/utils/mode/base/app.ts (1)
96-104: LGTM! Formatting change consistent with oxfmt migration.The constructor parameter destructuring has been reformatted to a single-line style, consistent with similar changes in
packages/cluster/src/utils/mode/base/agent.ts. No functional changes.packages/koa/test/application/index.test.ts (1)
143-147: LGTM! Test formatting refactored for consistency.The
createContextcall has been reformatted to a single line while maintaining semantic equivalence. This aligns with the new formatter configuration..github/workflows/ci.yml (1)
51-52: LGTM! Graceful format check introduction with fallback.The new format check step runs
fmtcheckbut includes a fallback that allows CI to pass even if formatting fails. This is a sensible approach for the migration period, allowing the team to gradually adopt oxfmt without blocking development.Consider removing the fallback (
|| echo "fmtcheck failed, ignore before it stable") once the codebase is fully formatted and the team is confident in the formatter configuration.package.json (2)
22-22: LGTM! Oxfmt dependency added.The
oxfmtdevelopment dependency has been added from the catalog, aligning with the PR objective to migrate from Prettier to oxfmt.
38-38: LGTM! Format check script added.The
fmtcheckscript runsoxfmt --check .to verify code formatting, which is used by the new CI workflow step..oxfmtrc.json (1)
6-22: The review comment is incorrect; Oxfmt supports comments in configuration files.Oxfmt supports JSONC config files (you can use comments) and as of v0.5.0 it accepts both
.oxfmtrc.jsonand.oxfmtrc.jsonc. The configuration file shown with comments will parse correctly—no changes are needed. The file is properly formatted for Oxfmt's configuration requirements.Likely an incorrect or invalid review comment.
close #5604
Summary by CodeRabbit
New Features
Chores
Style