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

minor(api): add return type into createTRPCContext for more type safety #1284

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vinhloc30796
Copy link

Just more type checking, slightly better DevEx

@danielcspaiva
Copy link

I don't think you need to explicitly type the return, since it is already inferred by the return type of the function.

@vinhloc30796
Copy link
Author

@danielcspaiva strange, intellisense didn't work for me out of the box -- it only works after adding the type explicitly

@danielcspaiva
Copy link

@vinhloc30796 it might be something in your environment. This is a fresh project using t3-turbo. No explicit typing, but the type is correctly inferred from the return of the function.

Screenshot 2025-01-14 at 09 56 50

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.

2 participants