Skip to content

Create linter rule or plugin to validate route.[method].config.ts #2

Description

@nico-hyperjump

We need a linter to make sure the exported functions exist and correct:

  • make sure requestValidator is exported and it's zod object with correct properties
  • make sure responseValidator is exported and it's zod object
  • make user handler function is exported with correct signature

requestValidator

It should have the following optional properties:

  • body
  • params
  • searchParams
  • headers
  • user

handler

  • The handler function must be typed with HandlerFunc<typeof requestValidator, typeof responseValidator>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions