Skip to content
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

Update TypeScript API Route example #44517

Merged
merged 4 commits into from
Jan 3, 2023
Merged

Conversation

abir-taheer
Copy link
Contributor

@abir-taheer abir-taheer commented Jan 3, 2023

The existing example causes issues with eslint's eslintimport/no-anonymous-default-export rule that come pre-enabled with create-next-app.

Added a name to the api handler function before setting it as the default export.

Documentation / Examples

  • Make sure the linting passes by running pnpm build && pnpm lint
  • The "examples guidelines" are followed from our contributing doc

Sorry, something went wrong.

The existing example causes issues with eslint's `eslintimport/no-anonymous-default-export` rule that come pre-enabled with `create-next-app`.

Added a name to the api handler function before setting it as the default export.
Copy link
Member

@timneutkens timneutkens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left two changes to use function instead of const to be in line with other examples for e.g. React components.

abir-taheer and others added 3 commits January 3, 2023 05:41

Verified

This commit was signed with the committer’s verified signature.
ijjk JJ Kasper

Verified

This commit was signed with the committer’s verified signature.
ijjk JJ Kasper
Copy link
Member

@ijjk ijjk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kodiakhq kodiakhq bot merged commit 0549a46 into vercel:canary Jan 3, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants