Skip to content

Commit 4165c4f

Browse files
committed
meta: enable jsdoc/no-defaults rule
1 parent e9c45db commit 4165c4f

File tree

14 files changed

+34
-35
lines changed

14 files changed

+34
-35
lines changed

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export default [
267267
'jsdoc/require-param-description': 'off',
268268
'jsdoc/require-returns-description': 'off',
269269
'jsdoc/valid-types': 'off',
270-
'jsdoc/no-defaults': 'off',
270+
'jsdoc/no-defaults': 'error',
271271
'jsdoc/no-undefined-types': 'off',
272272
'jsdoc/require-param': 'off',
273273
'jsdoc/check-tag-names': 'error',

lib/internal/data_url.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ function isASCIIWhitespace(char) {
295295
/**
296296
* @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace
297297
* @param {string} str
298-
* @param {boolean} [leading=true]
299-
* @param {boolean} [trailing=true]
298+
* @param {boolean} [leading]
299+
* @param {boolean} [trailing]
300300
*/
301301
function removeASCIIWhitespace(str, leading = true, trailing = true) {
302302
return removeChars(str, leading, trailing, isASCIIWhitespace);

lib/internal/dns/promises.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,11 @@ function createLookupPromise(family, hostname, all, hints, dnsOrder) {
185185
* Get the IP address for a given hostname.
186186
* @param {string} hostname - The hostname to resolve (ex. 'nodejs.org').
187187
* @param {object} [options] - Optional settings.
188-
* @param {boolean} [options.all=false] - Whether to return all or just the first resolved address.
189-
* @param {0 | 4 | 6} [options.family=0] - The record family. Must be 4, 6, or 0 (for both).
188+
* @param {boolean} [options.all] - Whether to return all or just the first resolved address.
189+
* @param {0 | 4 | 6} [options.family] - The record family. Must be 4, 6, or 0 (for both).
190190
* @param {number} [options.hints] - One or more supported getaddrinfo flags (supply multiple via
191191
* bitwise OR).
192-
* @param {string} [options.order='verbatim'] - Return results in same order DNS resolved them;
193-
* Must be `ipv4first`, `ipv6first` or `verbatim`.
192+
* @param {'ipv4first' | 'ipv6first' | 'verbatim'} [options.order] - Return results in same order DNS resolved them;
194193
* New code should supply `verbatim`.
195194
*/
196195
function lookup(hostname, options) {

lib/internal/modules/esm/create_dynamic_module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import.meta.exports[${nameStringLit}] = {
4141
* Creates a dynamic module with the given imports, exports, URL, and evaluate function.
4242
* @param {string[]} imports - An array of imports.
4343
* @param {string[]} exports - An array of exports.
44-
* @param {string} [url=''] - The URL of the module.
44+
* @param {string} [url] - The URL of the module.
4545
* @param {(reflect: DynamicModuleReflect) => void} evaluate - The function to evaluate the module.
4646
* @typedef {object} DynamicModuleReflect
4747
* @property {Record<string, Record<string, any>>} imports - The imports of the module.

lib/internal/modules/esm/resolve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,7 @@ function throwIfInvalidParentURL(parentURL) {
931931
* Resolves the given specifier using the provided context, which includes the parent URL and conditions.
932932
* Attempts to resolve the specifier and returns the resulting URL and format.
933933
* @param {string} specifier - The specifier to resolve.
934-
* @param {object} [context={}] - The context object containing the parent URL and conditions.
934+
* @param {object} [context] - The context object containing the parent URL and conditions.
935935
* @param {string} [context.parentURL] - The URL of the parent module.
936936
* @param {string[]} [context.conditions] - The conditions for resolving the specifier.
937937
*/

lib/internal/modules/esm/translators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ const cjsCache = new SafeMap();
176176
* @param {string} source - The source code of the module.
177177
* @param {boolean} isMain - Whether the module is the main module.
178178
* @param {string} format - Format of the module.
179-
* @param {typeof loadCJSModule} [loadCJS=loadCJSModule] - The function to load the CommonJS module.
179+
* @param {typeof loadCJSModule} [loadCJS] - The function to load the CommonJS module.
180180
* @returns {ModuleWrap} The ModuleWrap object for the CommonJS module.
181181
*/
182182
function createCJSModuleWrap(url, source, isMain, format, loadCJS = loadCJSModule) {

lib/internal/modules/esm/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ let _forceDefaultLoader = false;
283283
* Initializes handling of ES modules.
284284
* This is configured during pre-execution. Specifically it's set to true for
285285
* the loader worker in internal/main/worker_thread.js.
286-
* @param {boolean} [forceDefaultLoader=false] - A boolean indicating disabling custom loaders.
286+
* @param {boolean} [forceDefaultLoader] - A boolean indicating disabling custom loaders.
287287
*/
288288
function initializeESM(forceDefaultLoader = false) {
289289
_forceDefaultLoader = forceDefaultLoader;

lib/internal/modules/esm/worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ module.exports = function setupModuleWorker(workerData, syncCommPort) {
242242
/**
243243
* Handles errors that occur in the worker thread.
244244
* @param {Error} err - The error that occurred.
245-
* @param {string} [origin='unhandledRejection'] - The origin of the error.
245+
* @param {string} [origin] - The origin of the error.
246246
*/
247247
function errorHandler(err, origin = 'unhandledRejection') {
248248
AtomicsAdd(lock, WORKER_TO_MAIN_THREAD_NOTIFICATION, 1);

lib/internal/test_runner/mock/mock.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class MockTracker {
302302
* @param {Function} [original] - The original function to be tracked.
303303
* @param {Function} [implementation] - An optional replacement function for the original one.
304304
* @param {object} [options] - Additional tracking options.
305-
* @param {number} [options.times=Infinity] - The maximum number of times the mock function can be called.
305+
* @param {number} [options.times] - The maximum number of times the mock function can be called.
306306
* @returns {ProxyConstructor} The mock function tracker.
307307
*/
308308
fn(
@@ -334,9 +334,9 @@ class MockTracker {
334334
* @param {string} methodName - The name of the method to be tracked.
335335
* @param {Function} [implementation] - An optional replacement function for the original method.
336336
* @param {object} [options] - Additional tracking options.
337-
* @param {boolean} [options.getter=false] - Indicates whether this is a getter method.
338-
* @param {boolean} [options.setter=false] - Indicates whether this is a setter method.
339-
* @param {number} [options.times=Infinity] - The maximum number of times the mock method can be called.
337+
* @param {boolean} [options.getter] - Indicates whether this is a getter method.
338+
* @param {boolean} [options.setter] - Indicates whether this is a setter method.
339+
* @param {number} [options.times] - The maximum number of times the mock method can be called.
340340
* @returns {ProxyConstructor} The mock method tracker.
341341
*/
342342
method(
@@ -425,9 +425,9 @@ class MockTracker {
425425
* @param {string} methodName - The name of the getter method to be mocked.
426426
* @param {Function} [implementation] - An optional replacement function for the targeted method.
427427
* @param {object} [options] - Additional tracking options.
428-
* @param {boolean} [options.getter=true] - Indicates whether this is a getter method.
429-
* @param {boolean} [options.setter=false] - Indicates whether this is a setter method.
430-
* @param {number} [options.times=Infinity] - The maximum number of times the mock method can be called.
428+
* @param {boolean} [options.getter] - Indicates whether this is a getter method.
429+
* @param {boolean} [options.setter] - Indicates whether this is a setter method.
430+
* @param {number} [options.times] - The maximum number of times the mock method can be called.
431431
* @returns {ProxyConstructor} The mock method tracker.
432432
*/
433433
getter(
@@ -465,9 +465,9 @@ class MockTracker {
465465
* @param {string} methodName - The setter method to be mocked.
466466
* @param {Function} [implementation] - An optional replacement function for the targeted method.
467467
* @param {object} [options] - Additional tracking options.
468-
* @param {boolean} [options.getter=false] - Indicates whether this is a getter method.
469-
* @param {boolean} [options.setter=true] - Indicates whether this is a setter method.
470-
* @param {number} [options.times=Infinity] - The maximum number of times the mock method can be called.
468+
* @param {boolean} [options.getter] - Indicates whether this is a getter method.
469+
* @param {boolean} [options.setter] - Indicates whether this is a setter method.
470+
* @param {number} [options.times] - The maximum number of times the mock method can be called.
471471
* @returns {ProxyConstructor} The mock method tracker.
472472
*/
473473
setter(

lib/internal/test_runner/mock/mock_timers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ class MockTimers {
666666
/**
667667
* Advances the virtual time of MockTimers by the specified duration (in milliseconds).
668668
* This method simulates the passage of time and triggers any scheduled timers that are due.
669-
* @param {number} [time=1] - The amount of time (in milliseconds) to advance the virtual time.
669+
* @param {number} [time] - The amount of time (in milliseconds) to advance the virtual time.
670670
* @throws {ERR_INVALID_STATE} If MockTimers are not enabled.
671671
* @throws {ERR_INVALID_ARG_VALUE} If a negative time value is provided.
672672
*/

0 commit comments

Comments
 (0)