Skip to content

Commit 99223e6

Browse files
committed
fix(docs): make TypeScript code blocks parseable by sort-imports plugin
Two code blocks in agent-invite-endpoint-plan.md were bare top-level object literals. prettier-plugin-sort-imports tried to parse them as TS modules to sort imports, which babel rejected as "labeled statement followed by comma" — surfacing as two recurring "import sorting aborted due to babel parsing error" warnings in prettier --check across CI for any PR touching this tree. Wrapping the snippets in declarations (const + type) makes them valid TS, drops the warnings, and keeps the docs readable.
1 parent 541d241 commit 99223e6

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

docs/plans/agent-invite-endpoint-plan.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,18 @@ POST /api/v2/agents/join
6363
Request validation (zod):
6464

6565
```typescript
66-
{
66+
const requestBody = z.object({
6767
slug: z.string().min(1).max(2048),
6868
instructions: z.string().optional(),
69-
}
69+
});
7070
```
7171

7272
Response shape:
7373

7474
```typescript
75-
// Success
76-
{ success: true, joined: boolean }
77-
78-
// Error
79-
{ success: false, error: string, message: string }
75+
type Response =
76+
| { success: true; joined: boolean }
77+
| { success: false; error: string; message: string };
8078
```
8179

8280
Invite URL construction based on `XMTP_ENV`:

0 commit comments

Comments
 (0)