-
Notifications
You must be signed in to change notification settings - Fork 4k
improve(ts): colocate TS typings #1246
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
improve(ts): colocate TS typings #1246
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nextauthjs/next-auth/8y4bjqz6u |
| getUser(id: string): Promise<TUser | null> | ||
| getUserByEmail(email: string): Promise<TUser | null> | ||
| getUserByProviderAccountId( | ||
| createUser: (profile: TProfile) => Promise<TUser> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I disagree with this change by the linter. It changes autocompletion. It makes these appear as properties instead of methods (the icon) at least in VSCode. The problem is that properties can be callable or not. It just makes the autocomplete less usable, because it is harder to know the callables from the non-callables in the API.
|
So after our internal discussion, I don't want to accept this PR in this form, but I would be very happy if you started typing params and return types on internal functions with JSDoc notation, and maybe some of the user-facing ones as well. If you want to be sure everything is typed in a file, just add a temporary Interfaces can be added in .d.ts files, but I would like to wait with adding them to Also, I am very open to adding some kind of a script that extracts interfaces/JSDoc comments from the codebase and keeps our docs updated! Right now we have to explain the same functions over and over again, which can lead to inconsistencies really fast! Thanks again for the chat! |
|
@balazsorban44 yep! Thanks for your time as well! |
What:
Colocate the TS typings originally found here.
Why:
Incremental migration to TS. Reboot/Redo of #516.
How:
Have started by copying what's currently published on npm. We can continue to iterate after an initial release with this colocated.
Checklist: