docs: fix incorrect code examples in guides#1336
Conversation
- html() does not take event as first argument (response.md) - onError() takes (error, event) not (event, error) (error.md) - Remove undefined variable `body` in onResponse example (middleware.md) - Fix stray closing parenthesis in web handler example (handler.md) - Fix invalid for loop syntax: add missing `i++` (response.md + JSDoc) - Replace deprecated event.path with event.url.pathname (h3.md) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughDocs and examples updated: middleware and hook examples adjusted, handler/response samples fixed for syntax and parameter usage, and iterable response example corrected with a loop increment and minor formatting fixes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The docs file is auto-generated from JSDoc via automd. Fix the source JSDoc formatting (missing semicolon, arrow function parens) so the generated docs pass oxfmt checks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Fix 6 incorrect code examples across the documentation that would cause errors for users copying them:
docs/guide/basics/response.mdhtml(event, "...")→html("...")— html() doesn't take event argdocs/guide/basics/error.mdonError(event, (event, error))→onError((error, event))— wrong signature and param orderdocs/guide/basics/middleware.mdbody→response.status—bodywas undefined variabledocs/guide/basics/handler.md)— syntax errordocs/utils/response.mdfor (let i = 0; i < 1000)→for (let i = 0; i < 1000; i++)— missing incrementsrc/utils/response.ts(JSDoc)docs/guide/api/h3.mdevent.path→event.url.pathname— deprecated propertyTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit