Uh oh!
There was an error while loading. Please reload this page.
lib: improve hideStackFrames intellisense - #44181
Conversation
aduh95
commented
Aug 16, 2022
Why do you say it was invalid? What warning do you see? |
targos
commented
Aug 16, 2022
In TypeScript, the return type for this kind of functions is |
anonrig
commented
Aug 16, 2022
@aduh95 The previous error for all functions that use
@targos Most of our validate functions does not return a value, but throw's an error if assertion fails. In that scenario, |
targos
commented
Aug 16, 2022
@anonrig Note the |
anonrig
commented
Aug 16, 2022
aduh95
commented
Aug 16, 2022
Can we not use the Closure Compiler syntax? We should be using JSDoc instead: /** * @callback myCallback * @param {number} mandatory * @param {number} [optional] *//** @type {myCallback} */varcb; |
anonrig
commented
Aug 16, 2022
I did not really quite understand your point since JSDoc lacks certain functionality. JSDoc does not have /** * @function validateOneOf * @template T * @param {T} value * @param {string} name * @param {T[]} oneOf */ |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
anonrig
commented
Aug 17, 2022
Thanks for the review @aduh95. I've fixed them all. |
aduh95
left a comment
There was a problem hiding this comment.
LGTM, there's just one parameter that should be documented as optional
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
aduh95
left a comment
There was a problem hiding this comment.
Sorry for the back and forth, I still have some questions/suggestions
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
aduh95
commented
Aug 17, 2022
Landed in ab9b590, thanks for the contribution 🎉 |
PR-URL: #44181 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #44181 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #44181 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #44181 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #44181 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: nodejs/node#44181 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: nodejs/node#44181 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>


This is a draft pull request to improve the developer experience by fixing internal function's JSDoc declarations. I wanted to receive some feedback before investing time on this.
Previously, all functions that uses hideStackFrames was invalidly typed and was shown as a warning in IDEs (On WebStorm and Sublime).
I wanted to introduce
T is booleankind of type guards into the functions but could not find a solution for functions that does not return any boolean, but throws an error.