lib,test,tools: use consistent JSDoc types · nodejs/node@cf6379a · GitHub
Skip to content

Commit cf6379a

Browse files
Trottdanielleadams
authored andcommitted
lib,test,tools: use consistent JSDoc types
This could be in preparation of implementing the jsdoc/check-types ESLint rule. PR-URL: #40989 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 06b775c commit cf6379a

10 files changed

Lines changed: 26 additions & 26 deletions

File tree

lib/fs.js

Lines changed: 6 additions & 6 deletions

lib/http.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ function createServer(opts, requestListener) {
6060
}
6161

6262
/**
63-
* @typedef {Object} HTTPRequestOptions
63+
* @typedef {object} HTTPRequestOptions
6464
* @property {httpAgent.Agent | boolean} [agent]
6565
* @property {string} [auth]
6666
* @property {Function} [createConnection]
6767
* @property {number} [defaultPort]
6868
* @property {number} [family]
69-
* @property {Object} [headers]
69+
* @property {object} [headers]
7070
* @property {number} [hints]
7171
* @property {string} [host]
7272
* @property {string} [hostname]

lib/internal/errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ const captureLargerStackTrace = hideStackFrames(
474474
* The goal is to migrate them to ERR_* errors later when compatibility is
475475
* not a concern.
476476
*
477-
* @param {Object} ctx
477+
* @param {object} ctx
478478
* @returns {Error}
479479
*/
480480
const uvException = hideStackFrames(function uvException(ctx) {

lib/internal/modules/esm/loader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ class ESMLoader {
5454
/**
5555
* Prior to ESM loading. These are called once before any modules are started.
5656
* @private
57-
* @property {function[]} globalPreloaders First-in-first-out list of
57+
* @property {Function[]} globalPreloaders First-in-first-out list of
5858
* preload hooks.
5959
*/
6060
#globalPreloaders = [];
6161

6262
/**
6363
* Phase 2 of 2 in ESM loading.
6464
* @private
65-
* @property {function[]} loaders First-in-first-out list of loader hooks.
65+
* @property {Function[]} loaders First-in-first-out list of loader hooks.
6666
*/
6767
#loaders = [
6868
defaultLoad,
@@ -71,7 +71,7 @@ class ESMLoader {
7171
/**
7272
* Phase 1 of 2 in ESM loading.
7373
* @private
74-
* @property {function[]} resolvers First-in-first-out list of resolver hooks
74+
* @property {Function[]} resolvers First-in-first-out list of resolver hooks
7575
*/
7676
#resolvers = [
7777
defaultResolve,
@@ -341,8 +341,8 @@ class ESMLoader {
341341
* The internals of this WILL change when chaining is implemented,
342342
* depending on the resolution/consensus from #36954
343343
* @param {string} url The URL/path of the module to be loaded
344-
* @param {Object} context Metadata about the module
345-
* @returns {Object}
344+
* @param {object} context Metadata about the module
345+
* @returns {object}
346346
*/
347347
async load(url, context = {}) {
348348
const defaultLoader = this.#loaders[0];

lib/internal/source_map/source_map.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class SourceMap {
148148
}
149149

150150
/**
151-
* @return {Object} raw source map v3 payload.
151+
* @return {object} raw source map v3 payload.
152152
*/
153153
get payload() {
154154
return cloneSourceMapV3(this.#payload);

lib/internal/util/inspect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function getUserOptions(ctx, isCrossContext) {
280280
* in the best way possible given the different types.
281281
*
282282
* @param {any} value The value to print out.
283-
* @param {Object} opts Optional options object that alters the output.
283+
* @param {object} opts Optional options object that alters the output.
284284
*/
285285
/* Legacy: value, showHidden, depth, colors */
286286
function inspect(value, opts) {

lib/v8.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class DefaultSerializer extends Serializer {
269269
/**
270270
* Used to write some kind of host object, i.e. an
271271
* object that is created by native C++ bindings.
272-
* @param {Object} abView
272+
* @param {object} abView
273273
* @returns {void}
274274
*/
275275
_writeHostObject(abView) {

test/async-hooks/hook-checks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const assert = require('assert');
88
*
99
* @name checkInvocations
1010
* @function
11-
* @param {Object} activity including timestamps for each life time event,
11+
* @param {object} activity including timestamps for each life time event,
1212
* i.e. init, before ...
13-
* @param {Object} hooks the expected life time event invocations with a count
13+
* @param {object} hooks the expected life time event invocations with a count
1414
* indicating how often they should have been invoked,
1515
* i.e. `{ init: 1, before: 2, after: 2 }`
16-
* @param {String} stage the name of the stage in the test at which we are
16+
* @param {string} stage the name of the stage in the test at which we are
1717
* checking the invocations
1818
*/
1919
exports.checkInvocations = function checkInvocations(activity, hooks, stage) {

tools/eslint-rules/require-common-first.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ module.exports = function(context) {
1717

1818
/**
1919
* Function to check if the path is a module and return its name.
20-
* @param {String} str The path to check
21-
* @returns {String} module name
20+
* @param {string} str The path to check
21+
* @returns {string} module name
2222
*/
2323
function getModuleName(str) {
2424
if (str === '../common/index.mjs') {
@@ -32,7 +32,7 @@ module.exports = function(context) {
3232
* Function to check if a node has an argument that is a module and
3333
* return its name.
3434
* @param {ASTNode} node The node to check
35-
* @returns {undefined|String} module name or undefined
35+
* @returns {undefined | string} module name or undefined
3636
*/
3737
function getModuleNameFromCall(node) {
3838
// Node has arguments and first argument is string

tools/eslint-rules/required-modules.js

Lines changed: 3 additions & 3 deletions

0 commit comments

Comments
 (0)