Files
publisher-dashboard/.ast-grep/rules/no-void-output.yml
RevIQ 1bf05465c3 Replace void returns with { success: true } across all API endpoints
- Add successResponseSchema to common.ts for explicit success responses
- Update all auth, me, orgs, and admin procedures to return { success: true }
- Update contract.ts to use successResponseSchema instead of z.void()
- Add ast-grep rule to prevent future z.void() usage in contracts
- Add build:packages script to root package.json
- Fix test file lint errors with eslint-disable comments

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 16:30:22 +08:00

16 lines
513 B
YAML

id: no-void-output
language: typescript
severity: error
message: Do not use z.void() for output - use successResponseSchema instead
note: |
Endpoints should return `{ success: true }` instead of void.
This makes the API more explicit and avoids issues with TypeScript
expecting void-returning Promises.
Replace `.output(z.void())` with `.output(successResponseSchema)` and ensure
the handler returns `{ success: true }`.
rule:
pattern: $EXPR.output(z.void())
files:
- packages/api-contract/**/*.ts