From e4ca640d24f9831f3ecdd6a1d4d2cdd75c62a1f8 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 7 Nov 2022 19:38:35 -0800 Subject: [PATCH 1/4] http: add JSDoc property descriptions --- lib/http.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/http.js b/lib/http.js index d7acafe4f317b8..6835789836d66b 100644 --- a/lib/http.js +++ b/lib/http.js @@ -62,28 +62,28 @@ function createServer(opts, requestListener) { /** * @typedef {object} HTTPRequestOptions - * @property {httpAgent.Agent | boolean} [agent] - * @property {string} [auth] - * @property {Function} [createConnection] - * @property {number} [defaultPort] - * @property {number} [family] - * @property {object} [headers] - * @property {number} [hints] - * @property {string} [host] - * @property {string} [hostname] - * @property {boolean} [insecureHTTPParser] - * @property {string} [localAddress] - * @property {number} [localPort] - * @property {Function} [lookup] - * @property {number} [maxHeaderSize] - * @property {string} [method] - * @property {string} [path] - * @property {number} [port] - * @property {string} [protocol] - * @property {boolean} [setHost] - * @property {string} [socketPath] - * @property {number} [timeout] - * @property {AbortSignal} [signal] + * @property {httpAgent.Agent | boolean} [agent] Controls Agent behavior. + * @property {string} [auth] Basic authentication ('user:password') to compute an Authorization header. + * @property {Function} [createConnection] Produces a socket/stream to use when the agent option is not used. + * @property {number} [defaultPort] Default port for the protocol. + * @property {number} [family] IP address family to use when resolving host or hostname. + * @property {object} [headers] An object containing request headers. + * @property {number} [hints] Optional dns.lookup() hints. + * @property {string} [host] A domain name or IP address of the server to issue the request to. + * @property {string} [hostname] Alias for host. + * @property {boolean} [insecureHTTPParser] Use an insecure HTTP parser that accepts invalid HTTP headers when true. + * @property {string} [localAddress] Local interface to bind for network connections. + * @property {number} [localPort] Local port to connect from. + * @property {Function} [lookup] Custom lookup function. Default: dns.lookup(). + * @property {number} [maxHeaderSize] Overrides the --max-http-header-size value for responses received from the server. + * @property {string} [method] A string specifying the HTTP request method. + * @property {string} [path] Request path. + * @property {number} [port] Port of remote server. + * @property {string} [protocol] Protocol to use. + * @property {boolean} [setHost] Specifies whether or not to automatically add the Host header. + * @property {AbortSignal} [signal] An AbortSignal that may be used to abort an ongoing request. + * @property {string} [socketPath] Unix domain socket. + * @property {number} [timeout] A number specifying the socket timeout in milliseconds. */ /** From 7cd42af0111face53d990a768326af24042ca3d1 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 7 Nov 2022 19:39:29 -0800 Subject: [PATCH 2/4] esm: add JSDoc property descriptions for fetch --- lib/internal/modules/esm/fetch_module.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/modules/esm/fetch_module.js b/lib/internal/modules/esm/fetch_module.js index 7638f94b3fe525..073ec13562097c 100644 --- a/lib/internal/modules/esm/fetch_module.js +++ b/lib/internal/modules/esm/fetch_module.js @@ -21,9 +21,9 @@ const { once } = require('events'); const { compose } = require('stream'); /** * @typedef CacheEntry - * @property {Promise | string} resolvedHREF - * @property {Record} headers - * @property {Promise | Buffer} body + * @property {Promise | string} resolvedHREF Parsed HREF of the request. + * @property {Record} headers HTTP headers of the response. + * @property {Promise | Buffer} body Response body. */ /** From 7e0294979e7e500293ebeb075acbd8e3653f23d1 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 7 Nov 2022 19:39:44 -0800 Subject: [PATCH 3/4] esm: add JSDoc property descriptions for loader --- lib/internal/modules/esm/loader.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/internal/modules/esm/loader.js b/lib/internal/modules/esm/loader.js index 0f23d48084abe8..55c17d97ec5695 100644 --- a/lib/internal/modules/esm/loader.js +++ b/lib/internal/modules/esm/loader.js @@ -58,9 +58,9 @@ const { getOptionValue } = require('internal/options'); /** * @typedef {object} ExportedHooks - * @property {Function} globalPreload - * @property {Function} resolve - * @property {Function} load + * @property {Function} globalPreload Global preload hook. + * @property {Function} resolve Resolve hook. + * @property {Function} load Load hook. */ /** @@ -69,14 +69,14 @@ const { getOptionValue } = require('internal/options'); /** * @typedef {object} KeyedExports - * @property {ModuleExports} exports - * @property {URL['href']} url + * @property {ModuleExports} exports The contents of the module. + * @property {URL['href']} url The URL of the module. */ /** * @typedef {object} KeyedHook - * @property {Function} fn - * @property {URL['href']} url + * @property {Function} fn The hook function. + * @property {URL['href']} url The URL of the module. */ /** From 67637f1a3729bcf8997f642f0d4ae993dfd44f39 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 7 Nov 2022 19:41:12 -0800 Subject: [PATCH 4/4] tools: enable jsdoc/require-property-description rule --- .eslintrc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2a10875dd34ebd..64d35736b9ce77 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -311,7 +311,6 @@ module.exports = { 'jsdoc/require-param': 'off', 'jsdoc/check-tag-names': 'off', 'jsdoc/require-returns': 'off', - 'jsdoc/require-property-description': 'off', // Custom rules from eslint-plugin-node-core 'node-core/no-unescaped-regexp-dot': 'error',