-
Notifications
You must be signed in to change notification settings - Fork 438
Fix typos and update correct answer in validation test #680
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
Corrected typos and improved clarity in the validation documentation.
WalkthroughThe validation tutorial documentation was updated to showcase the newly exported Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/tutorial/getting-started/validation/index.md(2 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/tutorial/getting-started/validation/index.md
133-133: Hard tabs
Column: 1
(MD010, no-hard-tabs)
134-134: Hard tabs
Column: 1
(MD010, no-hard-tabs)
135-135: Hard tabs
Column: 1
(MD010, no-hard-tabs)
136-136: Hard tabs
Column: 1
(MD010, no-hard-tabs)
137-137: Hard tabs
Column: 1
(MD010, no-hard-tabs)
138-138: Hard tabs
Column: 1
(MD010, no-hard-tabs)
139-139: Hard tabs
Column: 1
(MD010, no-hard-tabs)
140-140: Hard tabs
Column: 1
(MD010, no-hard-tabs)
141-141: Hard tabs
Column: 1
(MD010, no-hard-tabs)
142-142: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🔇 Additional comments (3)
docs/tutorial/getting-started/validation/index.md (3)
92-92: Verify grammar for type inference statement.Line 92 uses "infer type" which appears incomplete. The phrasing should be either "infer types" (plural) or "infer the type" (with article).
Please confirm the intended phrasing:
- "Elysia will infer types for you, so you don't have to define a separate schema in TypeScript."
- "Elysia will infer the type for you, so you don't have to define a separate schema in TypeScript."
97-99: Grammatical and stylistic improvements are well-executed.The changes to line 97 ("type-check the response") and line 99 ("specify which status code") improve clarity and consistency with style guidelines.
123-123: Typo fix looks good.Line 123 correctly fixes the typo from "execrise" to "exercise".
| import { Elysia, t } from 'elysia' | ||
|
|
||
| new Elysia() | ||
| .get('/', ({ status, set }) => { | ||
| set.headers['x-powered-by'] = 'Elysia' | ||
|
|
||
| return status(418, 'Hello Elysia!') | ||
| }) | ||
| .get('/docs', ({ redirect }) => redirect('https://elysiajs.com')) | ||
| .post( | ||
| '/user', | ||
| ({ body: { name } }) => `Hello ${name}!`, | ||
| { | ||
| body: t.Object({ | ||
| name: t.String(), | ||
| age: t.Number() | ||
| }) | ||
| } | ||
| ) |
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.
Update assignment answer with proper schema, but fix indentation.
The assignment answer has been appropriately updated to showcase the t named export with t.Object, t.String(), and t.Number() validation. However, the code block uses hard tabs instead of spaces, which violates the project's Markdown style guidelines (markdownlint MD010).
Replace hard tabs with spaces (typically 2 or 4 spaces per indentation level to match the rest of the codebase):
```typescript
-import { Elysia, t } from 'elysia'
+import { Elysia, t } from 'elysia'
new Elysia()
- .post(
+ .post(
- '/user',
+ '/user',
- ({ body: { name } }) => `Hello ${name}!`,
+ ({ body: { name } }) => `Hello ${name}!`,
- {
+ {
- body: t.Object({
+ body: t.Object({
- name: t.String(),
+ name: t.String(),
- age: t.Number()
+ age: t.Number()
- })
+ })
- }
+ }
- )
+ )
.listen(3000)🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
133-133: Hard tabs
Column: 1
(MD010, no-hard-tabs)
134-134: Hard tabs
Column: 1
(MD010, no-hard-tabs)
135-135: Hard tabs
Column: 1
(MD010, no-hard-tabs)
136-136: Hard tabs
Column: 1
(MD010, no-hard-tabs)
137-137: Hard tabs
Column: 1
(MD010, no-hard-tabs)
138-138: Hard tabs
Column: 1
(MD010, no-hard-tabs)
139-139: Hard tabs
Column: 1
(MD010, no-hard-tabs)
140-140: Hard tabs
Column: 1
(MD010, no-hard-tabs)
141-141: Hard tabs
Column: 1
(MD010, no-hard-tabs)
142-142: Hard tabs
Column: 1
(MD010, no-hard-tabs)
🤖 Prompt for AI Agents
In docs/tutorial/getting-started/validation/index.md around lines 130 to 142,
the example uses hard tabs for indentation which violates the Markdown style
guide; replace all hard tabs with spaces (use 2 spaces per indent to match the
repository style), re-indent the chained .post call, its route, handler, options
object and nested t.Object properties consistently with 2-space indentation, and
ensure the closing parentheses and the final .listen(3000) line align with the
adjusted indentation.
Corrected typos and improved clarity in the validation documentation.
Summary by CodeRabbit