Skip to content

Comments

Use Zod for schemas and add TypeScript linting with ESLint#81

Merged
sergeychernyshev merged 2 commits intomainfrom
74-use-zod-library-for-defining-and-validating-data-schemas-as-well-as-typescript-types
Feb 23, 2026
Merged

Use Zod for schemas and add TypeScript linting with ESLint#81
sergeychernyshev merged 2 commits intomainfrom
74-use-zod-library-for-defining-and-validating-data-schemas-as-well-as-typescript-types

Conversation

@sergeychernyshev
Copy link
Member

@sergeychernyshev sergeychernyshev commented Feb 23, 2026

Integrated Zod for data validation and ESLint for TypeScript linting.

Zod Integration

  • Created modular schemas in src/schemas/ (account.ts, admin.ts, billing.ts, credential.ts, membership.ts, session.ts, user.ts).
  • Refactored Durable Objects (UserDO, AccountDO, SystemDO, CredentialDO) to use these schemas.
  • Enhanced Worker API handlers with strict Zod validation for all request.json() payloads.
  • Fixed a bug in SystemDO.updateAccount where it incorrectly targeted the users table.

ESLint Integration

  • Added ESLint with TypeScript support using a modern flat configuration (eslint.config.mjs).
  • Configured rules for code quality (prefer-const, no-unused-vars with underscore ignore pattern).
  • Cleaned up existing lint issues across the codebase (prefixed unused variables, fixed empty blocks).
  • Added npm run lint and npm run lint:fix scripts.

Other Changes

  • Ensured all TypeScript types are imported using import type.
  • Verified all changes with the full test suite (51 tests passing).

Closes #74

✨ Assisted by AI: Gemini

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 23, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
startup-api c121abb Feb 23 2026, 01:09 AM

@sergeychernyshev sergeychernyshev changed the title Use Zod library for defining and validating data schemas Use Zod for schemas and add TypeScript linting with ESLint Feb 23, 2026
@sergeychernyshev sergeychernyshev merged commit f71be18 into main Feb 23, 2026
2 checks passed
@sergeychernyshev sergeychernyshev deleted the 74-use-zod-library-for-defining-and-validating-data-schemas-as-well-as-typescript-types branch February 23, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use zod library for defining and validating data schemas as well as TypeScript types

1 participant