Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: fix JSDoc issues #45243

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/https.js
Original file line number Diff line number Diff line change
@@ -178,7 +178,7 @@ function createConnection(port, host, options) {
* maxCachedSessions?: number;
* servername?: string;
* }} [options]
* @returns {Agent}
* @constructor
*/
function Agent(options) {
if (!(this instanceof Agent))
2 changes: 1 addition & 1 deletion lib/internal/modules/esm/assert.js
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ function validateAssertions(url, format,
// `type` wasn't specified at all.
throw new ERR_IMPORT_ASSERTION_TYPE_MISSING(url, validType);
}
handleInvalidType(url, importAssertions.type);
return handleInvalidType(url, importAssertions.type);
}
}

58 changes: 42 additions & 16 deletions lib/internal/modules/esm/resolve.js
Original file line number Diff line number Diff line change
@@ -277,8 +277,8 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
* @param {URL} packageJSONUrl
* @param {string | URL | undefined} base
*/
function throwImportNotDefined(specifier, packageJSONUrl, base) {
throw new ERR_PACKAGE_IMPORT_NOT_DEFINED(
function importNotDefined(specifier, packageJSONUrl, base) {
return new ERR_PACKAGE_IMPORT_NOT_DEFINED(
specifier, packageJSONUrl && fileURLToPath(new URL('.', packageJSONUrl)),
fileURLToPath(base));
}
@@ -288,8 +288,8 @@ function throwImportNotDefined(specifier, packageJSONUrl, base) {
* @param {URL} packageJSONUrl
* @param {string | URL | undefined} base
*/
function throwExportsNotFound(subpath, packageJSONUrl, base) {
throw new ERR_PACKAGE_PATH_NOT_EXPORTED(
function exportsNotFound(subpath, packageJSONUrl, base) {
return new ERR_PACKAGE_PATH_NOT_EXPORTED(
fileURLToPath(new URL('.', packageJSONUrl)), subpath,
base && fileURLToPath(base));
}
@@ -310,14 +310,14 @@ function throwInvalidSubpath(request, match, packageJSONUrl, internal, base) {
base && fileURLToPath(base));
}

function throwInvalidPackageTarget(
function invalidPackageTarget(
subpath, target, packageJSONUrl, internal, base) {
if (typeof target === 'object' && target !== null) {
target = JSONStringify(target, null, '');
} else {
target = `${target}`;
}
throw new ERR_INVALID_PACKAGE_TARGET(
return new ERR_INVALID_PACKAGE_TARGET(
fileURLToPath(new URL('.', packageJSONUrl)), subpath, target,
internal, base && fileURLToPath(base));
}
@@ -327,6 +327,19 @@ const deprecatedInvalidSegmentRegEx = /(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o
const invalidPackageNameRegEx = /^\.|%|\\/;
const patternRegEx = /\*/g;

/**
*
* @param {string} target
* @param {*} subpath
* @param {*} match
* @param {*} packageJSONUrl
* @param {*} base
* @param {*} pattern
* @param {*} internal
* @param {*} isPathMap
* @param {*} conditions
* @returns {URL}
*/
function resolvePackageTargetString(
target,
subpath,
@@ -340,7 +353,7 @@ function resolvePackageTargetString(
) {

if (subpath !== '' && !pattern && target[target.length - 1] !== '/')
throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base);
throw invalidPackageTarget(match, target, packageJSONUrl, internal, base);

if (!StringPrototypeStartsWith(target, './')) {
if (internal && !StringPrototypeStartsWith(target, '../') &&
@@ -360,7 +373,7 @@ function resolvePackageTargetString(
exportTarget, packageJSONUrl, conditions);
}
}
throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base);
throw invalidPackageTarget(match, target, packageJSONUrl, internal, base);
}

if (RegExpPrototypeExec(invalidSegmentRegEx, StringPrototypeSlice(target, 2)) !== null) {
@@ -375,7 +388,7 @@ function resolvePackageTargetString(
emitInvalidSegmentDeprecation(resolvedTarget, request, match, packageJSONUrl, internal, base, true);
}
} else {
throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base);
throw invalidPackageTarget(match, target, packageJSONUrl, internal, base);
}
}

@@ -384,7 +397,7 @@ function resolvePackageTargetString(
const packagePath = new URL('.', packageJSONUrl).pathname;

if (!StringPrototypeStartsWith(resolvedPath, packagePath))
throwInvalidPackageTarget(match, target, packageJSONUrl, internal, base);
throw invalidPackageTarget(match, target, packageJSONUrl, internal, base);

if (subpath === '') return resolved;

@@ -421,6 +434,19 @@ function isArrayIndex(key) {
return keyNum >= 0 && keyNum < 0xFFFF_FFFF;
}

/**
*
* @param {*} packageJSONUrl
* @param {string|[string]} target
* @param {*} subpath
* @param {*} packageSubpath
* @param {*} base
* @param {*} pattern
* @param {*} internal
* @param {*} isPathMap
* @param {*} conditions
* @returns {URL|null}
*/
function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath,
base, pattern, internal, isPathMap, conditions) {
if (typeof target === 'string') {
@@ -485,8 +511,8 @@ function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath,
} else if (target === null) {
return null;
}
throwInvalidPackageTarget(packageSubpath, target, packageJSONUrl, internal,
base);
throw invalidPackageTarget(packageSubpath, target, packageJSONUrl, internal,
base);
}

/**
@@ -543,7 +569,7 @@ function packageExportsResolve(
);

if (resolveResult == null) {
throwExportsNotFound(packageSubpath, packageJSONUrl, base);
throw exportsNotFound(packageSubpath, packageJSONUrl, base);
}

return resolveResult;
@@ -594,12 +620,12 @@ function packageExportsResolve(
conditions);

if (resolveResult == null) {
throwExportsNotFound(packageSubpath, packageJSONUrl, base);
throw exportsNotFound(packageSubpath, packageJSONUrl, base);
}
return resolveResult;
}

throwExportsNotFound(packageSubpath, packageJSONUrl, base);
throw exportsNotFound(packageSubpath, packageJSONUrl, base);
}

function patternKeyCompare(a, b) {
@@ -679,7 +705,7 @@ function packageImportsResolve(name, base, conditions) {
}
}
}
throwImportNotDefined(name, packageJSONUrl, base);
throw importNotDefined(name, packageJSONUrl, base);
}

/**
1 change: 0 additions & 1 deletion lib/internal/validators.js
Original file line number Diff line number Diff line change
@@ -325,7 +325,6 @@ function validateBooleanArray(value, name) {
}
}

// eslint-disable-next-line jsdoc/require-returns-check
/**
* @param {*} signal
* @param {string} [name='signal']
37 changes: 29 additions & 8 deletions tools/node_modules/eslint/lib/cli.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/node_modules/eslint/lib/config/default-config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

282 changes: 199 additions & 83 deletions tools/node_modules/eslint/lib/eslint/eslint-helpers.js
53 changes: 20 additions & 33 deletions tools/node_modules/eslint/lib/eslint/flat-eslint.js
1 change: 1 addition & 0 deletions tools/node_modules/eslint/lib/linter/linter.js
22 changes: 14 additions & 8 deletions tools/node_modules/eslint/lib/rules/getter-return.js
5 changes: 5 additions & 0 deletions tools/node_modules/eslint/lib/rules/no-implicit-globals.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions tools/node_modules/eslint/node_modules/@babel/core/package.json
316 changes: 236 additions & 80 deletions tools/node_modules/eslint/node_modules/@babel/generator/lib/printer.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,241 changes: 692 additions & 549 deletions tools/node_modules/eslint/node_modules/@babel/parser/lib/index.js

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion tools/node_modules/eslint/node_modules/acorn/dist/acorn.js
2 changes: 1 addition & 1 deletion tools/node_modules/eslint/node_modules/acorn/package.json
5 changes: 0 additions & 5 deletions tools/node_modules/eslint/node_modules/array-union/index.js

This file was deleted.

38 changes: 0 additions & 38 deletions tools/node_modules/eslint/node_modules/array-union/package.json

This file was deleted.

34 changes: 0 additions & 34 deletions tools/node_modules/eslint/node_modules/array-union/readme.md

This file was deleted.

21 changes: 0 additions & 21 deletions tools/node_modules/eslint/node_modules/braces/LICENSE

This file was deleted.

170 changes: 0 additions & 170 deletions tools/node_modules/eslint/node_modules/braces/index.js

This file was deleted.

57 changes: 0 additions & 57 deletions tools/node_modules/eslint/node_modules/braces/lib/compile.js

This file was deleted.

57 changes: 0 additions & 57 deletions tools/node_modules/eslint/node_modules/braces/lib/constants.js

This file was deleted.

113 changes: 0 additions & 113 deletions tools/node_modules/eslint/node_modules/braces/lib/expand.js

This file was deleted.

333 changes: 0 additions & 333 deletions tools/node_modules/eslint/node_modules/braces/lib/parse.js

This file was deleted.

32 changes: 0 additions & 32 deletions tools/node_modules/eslint/node_modules/braces/lib/stringify.js

This file was deleted.

112 changes: 0 additions & 112 deletions tools/node_modules/eslint/node_modules/braces/lib/utils.js

This file was deleted.

Loading