Skip to content

Commit cb6ed80

Browse files
committed
meta: enable jsdoc/check-tag-names rule
1 parent dd205c9 commit cb6ed80

24 files changed

+46
-43
lines changed

benchmark/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ function getUrlData(withBase) {
386386
* @param {number} e The repetition of the data, as exponent of 2
387387
* @param {boolean} withBase Whether to include a base URL
388388
* @param {boolean} asUrl Whether to return the results as URL objects
389-
* @return {string[] | string[][] | URL[]}
389+
* @returns {string[] | string[][] | URL[]}
390390
*/
391391
function bakeUrlData(type, e = 0, withBase = false, asUrl = false) {
392392
let result = [];

eslint.config.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,16 +262,15 @@ export default [
262262
// ESLint recommended rules that we disable.
263263
'no-inner-declarations': 'off',
264264

265-
// JSDoc recommended rules that we disable.
265+
// JSDoc rules that we enable.
266266
'jsdoc/require-jsdoc': 'off',
267267
'jsdoc/require-param-description': 'off',
268-
'jsdoc/newline-after-description': 'off',
269268
'jsdoc/require-returns-description': 'off',
270269
'jsdoc/valid-types': 'off',
271270
'jsdoc/no-defaults': 'off',
272271
'jsdoc/no-undefined-types': 'off',
273272
'jsdoc/require-param': 'off',
274-
'jsdoc/check-tag-names': 'off',
273+
'jsdoc/check-tag-names': 'error',
275274
'jsdoc/require-returns': 'off',
276275

277276
// Stylistic rules.

lib/https.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function createConnection(port, host, options) {
201201
* maxCachedSessions?: number;
202202
* servername?: string;
203203
* }} [options]
204-
* @constructor
204+
* @class
205205
*/
206206
function Agent(options) {
207207
if (!(this instanceof Agent))

lib/internal/crypto/random.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ const numberToHexCharCode = (number) => (number < 10 ? 48 : 87) + number;
509509

510510
/**
511511
* @param {ArrayBuffer} buf An ArrayBuffer.
512-
* @return {bigint}
512+
* @returns {bigint}
513513
*/
514514
function arrayBufferToUnsignedBigInt(buf) {
515515
const length = ArrayBufferPrototypeGetByteLength(buf);

lib/internal/event_target.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,9 +373,11 @@ function isCustomEvent(value) {
373373
return isEvent(value) && (value?.[kDetail] !== undefined);
374374
}
375375

376+
/**
377+
* @class
378+
*/
376379
class CustomEvent extends Event {
377380
/**
378-
* @constructor
379381
* @param {string} type
380382
* @param {{
381383
* bubbles?: boolean,

lib/internal/navigator.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ class Navigator {
9393
}
9494

9595
/**
96-
* @return {number}
96+
* @returns {number}
9797
*/
9898
get hardwareConcurrency() {
9999
this.#availableParallelism ??= getAvailableParallelism();
100100
return this.#availableParallelism;
101101
}
102102

103103
/**
104-
* @return {string}
104+
* @returns {string}
105105
*/
106106
get language() {
107107
// The default locale might be changed dynamically, so always invoke the
@@ -110,23 +110,23 @@ class Navigator {
110110
}
111111

112112
/**
113-
* @return {Array<string>}
113+
* @returns {Array<string>}
114114
*/
115115
get languages() {
116116
this.#languages ??= ObjectFreeze([this.language]);
117117
return this.#languages;
118118
}
119119

120120
/**
121-
* @return {string}
121+
* @returns {string}
122122
*/
123123
get userAgent() {
124124
this.#userAgent ??= `Node.js/${StringPrototypeSlice(nodeVersion, 1, StringPrototypeIndexOf(nodeVersion, '.'))}`;
125125
return this.#userAgent;
126126
}
127127

128128
/**
129-
* @return {string}
129+
* @returns {string}
130130
*/
131131
get platform() {
132132
this.#platform ??= getNavigatorPlatform(arch, platform);

lib/internal/source_map/source_map.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ const VLQ_CONTINUATION_MASK = 1 << 5;
8686

8787
const kMappings = Symbol('kMappings');
8888

89+
/**
90+
* @class
91+
*/
8992
class StringCharIterator {
9093
/**
91-
* @constructor
9294
* @param {string} string
9395
*/
9496
constructor(string) {
@@ -97,28 +99,29 @@ class StringCharIterator {
9799
}
98100

99101
/**
100-
* @return {string}
102+
* @returns {string}
101103
*/
102104
next() {
103105
return StringPrototypeCharAt(this._string, this._position++);
104106
}
105107

106108
/**
107-
* @return {string}
109+
* @returns {string}
108110
*/
109111
peek() {
110112
return StringPrototypeCharAt(this._string, this._position);
111113
}
112114

113115
/**
114-
* @return {boolean}
116+
* @returns {boolean}
115117
*/
116118
hasNext() {
117119
return this._position < this._string.length;
118120
}
119121
}
120122

121123
/**
124+
* @class
122125
* Implements Source Map V3 model.
123126
* See https://github.com/google/closure-compiler/wiki/Source-Maps
124127
* for format description.
@@ -131,7 +134,6 @@ class SourceMap {
131134
#lineLengths = undefined;
132135

133136
/**
134-
* @constructor
135137
* @param {SourceMapV3} payload
136138
*/
137139
constructor(payload, { lineLengths } = { __proto__: null }) {
@@ -150,7 +152,7 @@ class SourceMap {
150152
}
151153

152154
/**
153-
* @return {object} raw source map v3 payload.
155+
* @returns {object} raw source map v3 payload.
154156
*/
155157
get payload() {
156158
return cloneSourceMapV3(this.#payload);
@@ -161,7 +163,7 @@ class SourceMap {
161163
}
162164

163165
/**
164-
* @return {number[] | undefined} line lengths of generated source code
166+
* @returns {number[] | undefined} line lengths of generated source code
165167
*/
166168
get lineLengths() {
167169
if (this.#lineLengths) {
@@ -192,7 +194,7 @@ class SourceMap {
192194
/**
193195
* @param {number} lineOffset 0-indexed line offset in compiled resource
194196
* @param {number} columnOffset 0-indexed column offset in compiled resource
195-
* @return {object} representing start of range if found, or empty object
197+
* @returns {object} representing start of range if found, or empty object
196198
*/
197199
findEntry(lineOffset, columnOffset) {
198200
let first = 0;
@@ -229,7 +231,7 @@ class SourceMap {
229231
/**
230232
* @param {number} lineNumber 1-indexed line number in compiled resource call site
231233
* @param {number} columnNumber 1-indexed column number in compiled resource call site
232-
* @return {object} representing origin call site if found, or empty object
234+
* @returns {object} representing origin call site if found, or empty object
233235
*/
234236
findOrigin(lineNumber, columnNumber) {
235237
const range = this.findEntry(lineNumber - 1, columnNumber - 1);
@@ -319,15 +321,15 @@ class SourceMap {
319321

320322
/**
321323
* @param {string} char
322-
* @return {boolean}
324+
* @returns {boolean}
323325
*/
324326
function isSeparator(char) {
325327
return char === ',' || char === ';';
326328
}
327329

328330
/**
329331
* @param {SourceMap.StringCharIterator} stringCharIterator
330-
* @return {number}
332+
* @returns {number}
331333
*/
332334
function decodeVLQ(stringCharIterator) {
333335
// Read unsigned value.
@@ -359,7 +361,7 @@ function decodeVLQ(stringCharIterator) {
359361

360362
/**
361363
* @param {SourceMapV3} payload
362-
* @return {SourceMapV3}
364+
* @returns {SourceMapV3}
363365
*/
364366
function cloneSourceMapV3(payload) {
365367
validateObject(payload, 'payload');
@@ -377,7 +379,7 @@ function cloneSourceMapV3(payload) {
377379
* @param {Array} entry1 source map entry [lineNumber, columnNumber, sourceURL,
378380
* sourceLineNumber, sourceColumnNumber]
379381
* @param {Array} entry2 source map entry.
380-
* @return {number}
382+
* @returns {number}
381383
*/
382384
function compareSourceMapEntry(entry1, entry2) {
383385
const { 0: lineNumber1, 1: columnNumber1 } = entry1;

lib/internal/validators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ const validateInternalField = hideStackFrames((object, fieldKey, className) => {
534534

535535
/**
536536
* @param {any} hints
537-
* @return {string}
537+
* @returns {string}
538538
*/
539539
const validateLinkHeaderValue = hideStackFrames((hints) => {
540540
if (typeof hints === 'string') {

tools/eslint-rules/crypto-check.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @fileoverview Check that common.hasCrypto is used if crypto, tls,
2+
* @file Check that common.hasCrypto is used if crypto, tls,
33
* https, or http2 modules are required.
44
* @author Daniel Bevenius <daniel.bevenius@gmail.com>
55
*/

tools/eslint-rules/eslint-check.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @fileoverview Check that common.skipIfEslintMissing is used if
2+
* @file Check that common.skipIfEslintMissing is used if
33
* the eslint module is required.
44
*/
55
'use strict';

0 commit comments

Comments
 (0)