From c241ef1a124798c0bc6fe5cde36f8cc7cb37f29e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 4 Dec 2021 19:59:24 -0800 Subject: [PATCH 1/2] lib: use consistent types in JSDoc @returns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/41089 Reviewed-By: Michaël Zasso Reviewed-By: Ruben Bridgewater --- lib/assert.js | 1 - lib/events.js | 2 +- lib/fs.js | 2 +- lib/internal/modules/esm/resolve.js | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/assert.js b/lib/assert.js index 46d6102381a450..1998246e09c15a 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -129,7 +129,6 @@ function innerFail(obj) { * @param {string | Error} [message] * @param {string} [operator] * @param {Function} [stackStartFn] - * @returns {never} */ function fail(actual, expected, message, operator, stackStartFn) { const argsLen = arguments.length; diff --git a/lib/events.js b/lib/events.js index 6d838d6d112dd9..6f5a499083027a 100644 --- a/lib/events.js +++ b/lib/events.js @@ -79,7 +79,7 @@ const kMaxEventTargetListenersWarned = /** * Creates a new `EventEmitter` instance. * @param {{ captureRejections?: boolean; }} [opts] - * @returns {EventEmitter} + * @constructs {EventEmitter} */ function EventEmitter(opts) { EventEmitter.init.call(this, opts); diff --git a/lib/fs.js b/lib/fs.js index aa69abb38a29d0..abdc2f0c39c11b 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -239,7 +239,7 @@ function access(path, mode, callback) { * directory specified by `path`. * @param {string | Buffer | URL} path * @param {number} [mode] - * @returns {void | never} + * @returns {void} */ function accessSync(path, mode) { path = getValidatedPath(path); diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js index de8fa349022700..92570fe4a99d7a 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js @@ -104,7 +104,7 @@ function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { * @param {URL} packageJSONUrl * @param {string | URL | undefined} base * @param {string} main - * @returns + * @returns {void} */ function emitLegacyIndexDeprecation(url, packageJSONUrl, base, main) { const format = defaultGetFormat(url); From e0a587753d1ea6c764f064ddad971a68ff596177 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 4 Dec 2021 19:59:37 -0800 Subject: [PATCH 2/2] tools: enable jsdoc/require-returns-check lint rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/41089 Reviewed-By: Michaël Zasso Reviewed-By: Ruben Bridgewater --- .eslintrc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index e3e198ab2fa6e0..dd7c4ae8cb5f09 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -353,7 +353,6 @@ module.exports = { 'jsdoc/tag-lines': 'off', 'jsdoc/require-returns-type': 'off', 'jsdoc/check-alignment': 'off', - 'jsdoc/require-returns-check': 'off', // Custom rules from eslint-plugin-node-core 'node-core/no-unescaped-regexp-dot': 'error',