| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
I have a preference for keeping the default import for assert (assert.throws, assert.ok, assert.fail, etc.), but not blocking.
Sorry, something went wrong.
|
@nodejs/documentation @nodejs/assert @nodejs/modules |
Sorry, something went wrong.
|
I hesitate to say this because I know doing this was a lot of work to begin with, but I'm with @aduh95 on the named imports. I'd prefer we do default exports because assert.throws() is a lot more clear than throws() if someone is searching through the documentation. If we want to switch to named imports/destructuring, that could be a separate PR. It would have the benefit of reducing the churn in this too. (Full disclosure: I happen to think destructuring/named imports are a bit of an anti-pattern. If I have two modules with a get() function, it sure is a lot more clear if I'm using http.get() and https.get() at invocation rather than just get() and having to go to the require/import statement to figure out which one I'm using. So on the one hand, this is just my personal preference. But on the other hand, our example code is going to become other people's production code, so since I happen to believe that one way of doing it is actually generally better, I'd prefer we do the better thing in our example code.) |
Sorry, something went wrong.
|
What?! Lol... I'm not worried about the work involved, it's really not that much. |
Sorry, something went wrong.
Signed-off-by: James M Snell <jasnell@gmail.com>
|
There, I fixed it for you picky folk 😁🤣 |
Sorry, something went wrong.
|
altho tbh the AssertionError case is the one where named imports seem clearer to me :-p fine as-is ofc! |
Sorry, something went wrong.
Sorry, something went wrong.
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #37607 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Danielle Adams <adamzdanielle@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #37607 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Danielle Adams <adamzdanielle@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
| Back | FazBrowse Home | New Git URL |
ESM example variants in preparation for #37162
/cc @aduh95
Signed-off-by: James M Snell jasnell@gmail.com