-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
docs: improve nullable/nullish type definitions #1008
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
commit: |
I don't think I want to merge this PR. I agree that your changes make it clearer, but the current approach is consistent across all of our actions. In simple words: We use almost exactly the same description template for every JSDoc, and I think I prefer consistency in this case. If we decide to change the JSDocs it should be consistent across all actions and probably all other functions too. |
Ok, I agree it's good to have consistent docs, i.e., it would be better to add examples to all the functions. But what about the latest code suggestion with just minor wording improvements?
Alternatively, for consistency, we could just add parentheses (they don't have to be everywhere):
|
Your ideas are good. I will come back to this and other similar issues and PRs after V1 is available. |
Updates the JSDoc documentation for
nullable()
andnullish()
functions to better illustrate their type behavior.Changes:
T | null
vsT | null | undefined
) to clearly show the differenceThis change makes it easier for developers to quickly understand (especially non english speaking) when to use each function based on their TypeScript type requirements.
P.S.: Is it only me who keeps googling "nullable vs nullish difference" every other week? 😅