apocas / dockerode

Docker + Node = Dockerode (Node.js module for Docker's Remote API)
Apache License 2.0
4.39k stars 465 forks source link

Improve JSDoc typings for optional parameters #732

Open daniellockyer opened 1 year ago

daniellockyer commented 1 year ago

Hi! Love dockerode 😀

One thing I've noticed is that the JSDoc types for parameters which are optional aren't marked as so, so my editor tends to complain when I use dockerode with no params and Promises. Optional parameters in JSDoc are indicated with square brackets.

For example, container.inspect allows for optional opts and callback: https://github.com/apocas/dockerode/blob/bb88194ff250c4f5b9a0eee2688c5dcc5f623ef9/lib/container.js#L41-L46

CleanShot 2023-05-17 at 10 25 04@2x

In this example, the parameter types should be:

* @param  {Object}   [opts]     Options
* @param  {Function} [callback] Callback
stale[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Open a new issue if needed.