eslint-plugin-jsdoc 46.8.2 → 46.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WarnSettings.js +1 -2
- package/dist/WarnSettings.js.map +1 -1
- package/dist/alignTransform.js +1 -2
- package/dist/alignTransform.js.map +1 -1
- package/dist/defaultTagOrder.js +1 -2
- package/dist/defaultTagOrder.js.map +1 -1
- package/dist/exportParser.js +6 -12
- package/dist/exportParser.js.map +1 -1
- package/dist/generateRule.js +9 -8
- package/dist/generateRule.js.map +1 -1
- package/dist/getDefaultTagStructureForMode.js +1 -2
- package/dist/getDefaultTagStructureForMode.js.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/iterateJsdoc.js +40 -51
- package/dist/iterateJsdoc.js.map +1 -1
- package/dist/jsdocUtils.js +18 -31
- package/dist/jsdocUtils.js.map +1 -1
- package/dist/rules/checkAccess.js +1 -2
- package/dist/rules/checkAccess.js.map +1 -1
- package/dist/rules/checkAlignment.js +1 -2
- package/dist/rules/checkAlignment.js.map +1 -1
- package/dist/rules/checkExamples.js +4 -5
- package/dist/rules/checkExamples.js.map +1 -1
- package/dist/rules/checkIndentation.js +1 -2
- package/dist/rules/checkIndentation.js.map +1 -1
- package/dist/rules/checkLineAlignment.js +3 -4
- package/dist/rules/checkLineAlignment.js.map +1 -1
- package/dist/rules/checkParamNames.js +1 -2
- package/dist/rules/checkParamNames.js.map +1 -1
- package/dist/rules/checkPropertyNames.js +1 -2
- package/dist/rules/checkPropertyNames.js.map +1 -1
- package/dist/rules/checkSyntax.js +1 -2
- package/dist/rules/checkSyntax.js.map +1 -1
- package/dist/rules/checkTagNames.js +2 -3
- package/dist/rules/checkTagNames.js.map +1 -1
- package/dist/rules/checkTypes.js +3 -6
- package/dist/rules/checkTypes.js.map +1 -1
- package/dist/rules/checkValues.js +1 -2
- package/dist/rules/checkValues.js.map +1 -1
- package/dist/rules/emptyTags.js +1 -2
- package/dist/rules/emptyTags.js.map +1 -1
- package/dist/rules/implementsOnClasses.js +1 -2
- package/dist/rules/implementsOnClasses.js.map +1 -1
- package/dist/rules/importsAsDependencies.js +1 -3
- package/dist/rules/importsAsDependencies.js.map +1 -1
- package/dist/rules/informativeDocs.js +1 -2
- package/dist/rules/informativeDocs.js.map +1 -1
- package/dist/rules/matchDescription.js +1 -2
- package/dist/rules/matchDescription.js.map +1 -1
- package/dist/rules/matchName.js +3 -4
- package/dist/rules/matchName.js.map +1 -1
- package/dist/rules/multilineBlocks.js +3 -4
- package/dist/rules/multilineBlocks.js.map +1 -1
- package/dist/rules/noBadBlocks.js +1 -2
- package/dist/rules/noBadBlocks.js.map +1 -1
- package/dist/rules/noBlankBlockDescriptions.js +1 -2
- package/dist/rules/noBlankBlockDescriptions.js.map +1 -1
- package/dist/rules/noBlankBlocks.js +1 -2
- package/dist/rules/noBlankBlocks.js.map +1 -1
- package/dist/rules/noDefaults.js +1 -2
- package/dist/rules/noDefaults.js.map +1 -1
- package/dist/rules/noMissingSyntax.js +2 -2
- package/dist/rules/noMissingSyntax.js.map +1 -1
- package/dist/rules/noMultiAsterisks.js +1 -2
- package/dist/rules/noMultiAsterisks.js.map +1 -1
- package/dist/rules/noRestrictedSyntax.js +1 -2
- package/dist/rules/noRestrictedSyntax.js.map +1 -1
- package/dist/rules/noTypes.js +1 -2
- package/dist/rules/noTypes.js.map +1 -1
- package/dist/rules/noUndefinedTypes.js +10 -6
- package/dist/rules/noUndefinedTypes.js.map +1 -1
- package/dist/rules/requireAsteriskPrefix.js +1 -2
- package/dist/rules/requireAsteriskPrefix.js.map +1 -1
- package/dist/rules/requireDescription.js +1 -2
- package/dist/rules/requireDescription.js.map +1 -1
- package/dist/rules/requireDescriptionCompleteSentence.js +1 -2
- package/dist/rules/requireDescriptionCompleteSentence.js.map +1 -1
- package/dist/rules/requireExample.js +1 -2
- package/dist/rules/requireExample.js.map +1 -1
- package/dist/rules/requireFileOverview.js +1 -2
- package/dist/rules/requireFileOverview.js.map +1 -1
- package/dist/rules/requireHyphenBeforeParamDescription.js +1 -3
- package/dist/rules/requireHyphenBeforeParamDescription.js.map +1 -1
- package/dist/rules/requireJsdoc.js +7 -14
- package/dist/rules/requireJsdoc.js.map +1 -1
- package/dist/rules/requireParam.js +2 -2
- package/dist/rules/requireParam.js.map +1 -1
- package/dist/rules/requireParamDescription.js +1 -2
- package/dist/rules/requireParamDescription.js.map +1 -1
- package/dist/rules/requireParamName.js +1 -2
- package/dist/rules/requireParamName.js.map +1 -1
- package/dist/rules/requireParamType.js +1 -2
- package/dist/rules/requireParamType.js.map +1 -1
- package/dist/rules/requireProperty.js +1 -2
- package/dist/rules/requireProperty.js.map +1 -1
- package/dist/rules/requirePropertyDescription.js +1 -2
- package/dist/rules/requirePropertyDescription.js.map +1 -1
- package/dist/rules/requirePropertyName.js +1 -2
- package/dist/rules/requirePropertyName.js.map +1 -1
- package/dist/rules/requirePropertyType.js +1 -2
- package/dist/rules/requirePropertyType.js.map +1 -1
- package/dist/rules/requireReturns.js +1 -2
- package/dist/rules/requireReturns.js.map +1 -1
- package/dist/rules/requireReturnsCheck.js +2 -3
- package/dist/rules/requireReturnsCheck.js.map +1 -1
- package/dist/rules/requireReturnsDescription.js +1 -2
- package/dist/rules/requireReturnsDescription.js.map +1 -1
- package/dist/rules/requireReturnsType.js +1 -2
- package/dist/rules/requireReturnsType.js.map +1 -1
- package/dist/rules/requireThrows.js +1 -2
- package/dist/rules/requireThrows.js.map +1 -1
- package/dist/rules/requireYields.js +1 -2
- package/dist/rules/requireYields.js.map +1 -1
- package/dist/rules/requireYieldsCheck.js +1 -2
- package/dist/rules/requireYieldsCheck.js.map +1 -1
- package/dist/rules/sortTags.js +8 -9
- package/dist/rules/sortTags.js.map +1 -1
- package/dist/rules/tagLines.js +3 -4
- package/dist/rules/tagLines.js.map +1 -1
- package/dist/rules/textEscaping.js +1 -2
- package/dist/rules/textEscaping.js.map +1 -1
- package/dist/rules/validTypes.js +1 -3
- package/dist/rules/validTypes.js.map +1 -1
- package/dist/tagNames.js +3 -6
- package/dist/tagNames.js.map +1 -1
- package/dist/utils/hasReturnValue.js +15 -18
- package/dist/utils/hasReturnValue.js.map +1 -1
- package/package.json +35 -35
package/dist/iterateJsdoc.js
CHANGED
|
@@ -128,7 +128,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
128
128
|
* [key: string]: string
|
|
129
129
|
* }} [data]
|
|
130
130
|
*/
|
|
131
|
-
/* eslint-enable jsdoc/valid-types -- Old version */
|
|
132
131
|
|
|
133
132
|
/**
|
|
134
133
|
* @callback GetRegexFromString
|
|
@@ -176,7 +175,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
176
175
|
* ) => import('comment-parser').Line[]} setter
|
|
177
176
|
* @returns {void}
|
|
178
177
|
*/
|
|
179
|
-
/* eslint-enable jsdoc/no-undefined-types -- Bug */
|
|
180
178
|
|
|
181
179
|
/**
|
|
182
180
|
* @callback SetDescriptionLines
|
|
@@ -191,7 +189,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
191
189
|
* @param {...Partial<import('comment-parser').Tokens>} tokens
|
|
192
190
|
* @returns {void}
|
|
193
191
|
*/
|
|
194
|
-
/* eslint-enable jsdoc/no-undefined-types -- TS */
|
|
195
192
|
|
|
196
193
|
/**
|
|
197
194
|
* @callback SetTag
|
|
@@ -201,7 +198,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
201
198
|
* @param {Partial<import('comment-parser').Tokens>} [tokens]
|
|
202
199
|
* @returns {void}
|
|
203
200
|
*/
|
|
204
|
-
/* eslint-enable jsdoc/no-undefined-types -- TS */
|
|
205
201
|
|
|
206
202
|
/**
|
|
207
203
|
* @callback RemoveTag
|
|
@@ -231,7 +227,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
231
227
|
* tokens?: Partial<import('comment-parser').Tokens> | undefined
|
|
232
228
|
* ) => import('comment-parser').Tokens} SeedTokens
|
|
233
229
|
*/
|
|
234
|
-
/* eslint-enable jsdoc/no-undefined-types -- TS */
|
|
235
230
|
|
|
236
231
|
/**
|
|
237
232
|
* Sets tokens to empty string.
|
|
@@ -246,7 +241,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
246
241
|
* @param {Partial<import('comment-parser').Tokens>} tokens
|
|
247
242
|
* @returns {void}
|
|
248
243
|
*/
|
|
249
|
-
/* eslint-enable jsdoc/no-undefined-types -- TS */
|
|
250
244
|
|
|
251
245
|
/**
|
|
252
246
|
* @callback AddLines
|
|
@@ -484,6 +478,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
484
478
|
* contextStr: string
|
|
485
479
|
* }}
|
|
486
480
|
*/
|
|
481
|
+
|
|
487
482
|
/**
|
|
488
483
|
* @typedef {BasicUtils & {
|
|
489
484
|
* isIteratingFunction: IsIteratingFunction,
|
|
@@ -547,6 +542,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
547
542
|
* findContext: FindContext
|
|
548
543
|
* }} Utils
|
|
549
544
|
*/
|
|
545
|
+
|
|
550
546
|
const {
|
|
551
547
|
rewireSpecs,
|
|
552
548
|
seedTokens
|
|
@@ -580,7 +576,6 @@ const {
|
|
|
580
576
|
* }
|
|
581
577
|
* }} StateObject
|
|
582
578
|
*/
|
|
583
|
-
/* eslint-enable jsdoc/valid-types -- Old version */
|
|
584
579
|
|
|
585
580
|
/**
|
|
586
581
|
* The Node AST as supplied by the parser.
|
|
@@ -664,7 +659,6 @@ const getBasicUtils = (context, {
|
|
|
664
659
|
* }} [data]
|
|
665
660
|
* @returns {void}
|
|
666
661
|
*/
|
|
667
|
-
/* eslint-enable jsdoc/valid-types -- Old version of pratt */
|
|
668
662
|
|
|
669
663
|
/**
|
|
670
664
|
* @param {Node|null} node
|
|
@@ -673,13 +667,15 @@ const getBasicUtils = (context, {
|
|
|
673
667
|
* @param {Settings} settings
|
|
674
668
|
* @param {Report} report
|
|
675
669
|
* @param {import('eslint').Rule.RuleContext} context
|
|
670
|
+
* @param {import('eslint').SourceCode} sc
|
|
676
671
|
* @param {boolean|undefined} iteratingAll
|
|
677
672
|
* @param {RuleConfig} ruleConfig
|
|
678
673
|
* @param {string} indent
|
|
679
674
|
* @returns {Utils}
|
|
680
675
|
*/
|
|
681
|
-
const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAll, ruleConfig, indent) => {
|
|
682
|
-
|
|
676
|
+
const getUtils = (node, jsdoc, jsdocNode, settings, report, context, sc, iteratingAll, ruleConfig, indent) => {
|
|
677
|
+
/* istanbul ignore next */
|
|
678
|
+
const ancestors = /** @type {import('eslint').Rule.Node[]} */node ? sc.getAncestors ? sc.getAncestors(node) : context.getAncestors() : [];
|
|
683
679
|
|
|
684
680
|
// istanbul ignore next -- Fallback to deprecated method
|
|
685
681
|
const {
|
|
@@ -878,7 +874,7 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
878
874
|
|
|
879
875
|
/* istanbul ignore else -- Won't be called if missing */
|
|
880
876
|
if (descLines.length) {
|
|
881
|
-
jsdoc.source.splice( /** @type {Integer} */startIdx, /** @type {Integer} */endIdx - /** @type {Integer} */startIdx, ...setter(
|
|
877
|
+
jsdoc.source.splice( /** @type {Integer} */startIdx, /** @type {Integer} */endIdx - ( /** @type {Integer} */startIdx), ...setter(
|
|
882
878
|
/**
|
|
883
879
|
* @type {{
|
|
884
880
|
* delimiter: string,
|
|
@@ -986,12 +982,12 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
986
982
|
tokens
|
|
987
983
|
} = jsdoc.source[spliceIdx];
|
|
988
984
|
for (const item of ['postDelimiter', 'tag', 'postTag', 'type', 'postType', 'name', 'postName', 'description']) {
|
|
989
|
-
tokens[
|
|
985
|
+
tokens[(
|
|
990
986
|
/**
|
|
991
987
|
* @type {"postDelimiter"|"tag"|"type"|"postType"|
|
|
992
988
|
* "postTag"|"name"|"postName"|"description"}
|
|
993
989
|
*/
|
|
994
|
-
item] = '';
|
|
990
|
+
item)] = '';
|
|
995
991
|
}
|
|
996
992
|
} else {
|
|
997
993
|
jsdoc.source.splice(spliceIdx, spliceCount - tagSourceOffset + (spliceIdx ? 0 : jsdoc.source.length));
|
|
@@ -1005,7 +1001,7 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1005
1001
|
return false;
|
|
1006
1002
|
});
|
|
1007
1003
|
for (const [idx, src] of jsdoc.source.slice(lastIndex).entries()) {
|
|
1008
|
-
src.number = firstNumber + /** @type {Integer} */lastIndex + idx;
|
|
1004
|
+
src.number = firstNumber + ( /** @type {Integer} */lastIndex) + idx;
|
|
1009
1005
|
}
|
|
1010
1006
|
|
|
1011
1007
|
// Todo: Once rewiring of tags may be fixed in comment-parser to reflect
|
|
@@ -1061,12 +1057,12 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1061
1057
|
/** @type {EmptyTokens} */
|
|
1062
1058
|
utils.emptyTokens = tokens => {
|
|
1063
1059
|
for (const prop of ['start', 'postDelimiter', 'tag', 'type', 'postType', 'postTag', 'name', 'postName', 'description', 'end', 'lineEnd']) {
|
|
1064
|
-
tokens[
|
|
1060
|
+
tokens[(
|
|
1065
1061
|
/**
|
|
1066
1062
|
* @type {"start"|"postDelimiter"|"tag"|"type"|"postType"|
|
|
1067
1063
|
* "postTag"|"name"|"postName"|"description"|"end"|"lineEnd"}
|
|
1068
1064
|
*/
|
|
1069
|
-
prop] = '';
|
|
1065
|
+
prop)] = '';
|
|
1070
1066
|
}
|
|
1071
1067
|
};
|
|
1072
1068
|
|
|
@@ -1134,7 +1130,7 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1134
1130
|
return false;
|
|
1135
1131
|
});
|
|
1136
1132
|
for (const [idx, src] of jsdoc.source.slice(lastIndex).entries()) {
|
|
1137
|
-
src.number = firstNumber + /** @type {Integer} */lastIndex + idx;
|
|
1133
|
+
src.number = firstNumber + ( /** @type {Integer} */lastIndex) + idx;
|
|
1138
1134
|
}
|
|
1139
1135
|
};
|
|
1140
1136
|
|
|
@@ -1216,11 +1212,12 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1216
1212
|
* import('estree').FunctionExpression}
|
|
1217
1213
|
*/
|
|
1218
1214
|
node.generator || node.type === 'MethodDefinition' && node.value.generator || ['ExportNamedDeclaration', 'ExportDefaultDeclaration'].includes(node.type) && /** @type {import('estree').FunctionDeclaration} */
|
|
1215
|
+
(
|
|
1219
1216
|
/**
|
|
1220
1217
|
* @type {import('estree').ExportNamedDeclaration|
|
|
1221
1218
|
* import('estree').ExportDefaultDeclaration}
|
|
1222
1219
|
*/
|
|
1223
|
-
node.declaration.generator);
|
|
1220
|
+
node.declaration).generator);
|
|
1224
1221
|
};
|
|
1225
1222
|
|
|
1226
1223
|
/** @type {IsConstructor} */
|
|
@@ -1305,10 +1302,10 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1305
1302
|
};
|
|
1306
1303
|
for (const method of ['tagMightHaveNamePosition', 'tagMightHaveTypePosition']) {
|
|
1307
1304
|
/** @type {TagMightHaveNamePositionTypePosition} */
|
|
1308
|
-
utils[/** @type {"tagMightHaveNamePosition"|"tagMightHaveTypePosition"} */
|
|
1309
|
-
method] = (tagName, otherModeMaps) => {
|
|
1310
|
-
const result = _jsdocUtils.default[/** @type {"tagMightHaveNamePosition"|"tagMightHaveTypePosition"} */
|
|
1311
|
-
method](tagName);
|
|
1305
|
+
utils[( /** @type {"tagMightHaveNamePosition"|"tagMightHaveTypePosition"} */
|
|
1306
|
+
method)] = (tagName, otherModeMaps) => {
|
|
1307
|
+
const result = _jsdocUtils.default[( /** @type {"tagMightHaveNamePosition"|"tagMightHaveTypePosition"} */
|
|
1308
|
+
method)](tagName);
|
|
1312
1309
|
if (result) {
|
|
1313
1310
|
return true;
|
|
1314
1311
|
}
|
|
@@ -1316,8 +1313,8 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1316
1313
|
return false;
|
|
1317
1314
|
}
|
|
1318
1315
|
const otherResult = otherModeMaps.some(otherModeMap => {
|
|
1319
|
-
return _jsdocUtils.default[/** @type {"tagMightHaveNamePosition"|"tagMightHaveTypePosition"} */
|
|
1320
|
-
method](tagName, otherModeMap);
|
|
1316
|
+
return _jsdocUtils.default[( /** @type {"tagMightHaveNamePosition"|"tagMightHaveTypePosition"} */
|
|
1317
|
+
method)](tagName, otherModeMap);
|
|
1321
1318
|
});
|
|
1322
1319
|
return otherResult ? {
|
|
1323
1320
|
otherMode: true
|
|
@@ -1340,10 +1337,10 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1340
1337
|
};
|
|
1341
1338
|
for (const method of ['tagMustHaveNamePosition', 'tagMustHaveTypePosition']) {
|
|
1342
1339
|
/** @type {TagMustHave} */
|
|
1343
|
-
utils[/** @type {"tagMustHaveNamePosition"|"tagMustHaveTypePosition"} */
|
|
1344
|
-
method] = (tagName, otherModeMaps) => {
|
|
1345
|
-
const result = _jsdocUtils.default[/** @type {"tagMustHaveNamePosition"|"tagMustHaveTypePosition"} */
|
|
1346
|
-
method](tagName);
|
|
1340
|
+
utils[( /** @type {"tagMustHaveNamePosition"|"tagMustHaveTypePosition"} */
|
|
1341
|
+
method)] = (tagName, otherModeMaps) => {
|
|
1342
|
+
const result = _jsdocUtils.default[( /** @type {"tagMustHaveNamePosition"|"tagMustHaveTypePosition"} */
|
|
1343
|
+
method)](tagName);
|
|
1347
1344
|
if (!result) {
|
|
1348
1345
|
return false;
|
|
1349
1346
|
}
|
|
@@ -1351,8 +1348,8 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1351
1348
|
// if (!otherModeMaps) { return true; }
|
|
1352
1349
|
|
|
1353
1350
|
const otherResult = otherModeMaps.every(otherModeMap => {
|
|
1354
|
-
return _jsdocUtils.default[/** @type {"tagMustHaveNamePosition"|"tagMustHaveTypePosition"} */
|
|
1355
|
-
method](tagName, otherModeMap);
|
|
1351
|
+
return _jsdocUtils.default[( /** @type {"tagMustHaveNamePosition"|"tagMustHaveTypePosition"} */
|
|
1352
|
+
method)](tagName, otherModeMap);
|
|
1356
1353
|
});
|
|
1357
1354
|
return otherResult ? true : {
|
|
1358
1355
|
otherMode: false
|
|
@@ -1361,10 +1358,10 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1361
1358
|
}
|
|
1362
1359
|
for (const method of ['isNamepathDefiningTag', 'isNamepathReferencingTag', 'isNamepathOrUrlReferencingTag', 'tagMightHaveNamepath']) {
|
|
1363
1360
|
/** @type {IsNamepathX} */
|
|
1364
|
-
utils[/** @type {"isNamepathDefiningTag"|"isNamepathReferencingTag"|"isNamepathOrUrlReferencingTag"|"tagMightHaveNamepath"} */
|
|
1365
|
-
method] = tagName => {
|
|
1366
|
-
return _jsdocUtils.default[/** @type {"isNamepathDefiningTag"|"isNamepathReferencingTag"|"isNamepathOrUrlReferencingTag"|"tagMightHaveNamepath"} */
|
|
1367
|
-
method](tagName);
|
|
1361
|
+
utils[( /** @type {"isNamepathDefiningTag"|"isNamepathReferencingTag"|"isNamepathOrUrlReferencingTag"|"tagMightHaveNamepath"} */
|
|
1362
|
+
method)] = tagName => {
|
|
1363
|
+
return _jsdocUtils.default[( /** @type {"isNamepathDefiningTag"|"isNamepathReferencingTag"|"isNamepathOrUrlReferencingTag"|"tagMightHaveNamepath"} */
|
|
1364
|
+
method)](tagName);
|
|
1368
1365
|
};
|
|
1369
1366
|
}
|
|
1370
1367
|
|
|
@@ -1405,7 +1402,7 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1405
1402
|
|
|
1406
1403
|
/** @type {IsAsync} */
|
|
1407
1404
|
utils.isAsync = () => {
|
|
1408
|
-
return 'async' in /** @type {Node} */node && node.async;
|
|
1405
|
+
return 'async' in ( /** @type {Node} */node) && node.async;
|
|
1409
1406
|
};
|
|
1410
1407
|
|
|
1411
1408
|
/** @type {GetTags} */
|
|
@@ -1552,7 +1549,6 @@ const getUtils = (node, jsdoc, jsdocNode, settings, report, context, iteratingAl
|
|
|
1552
1549
|
* contexts?: Context[]
|
|
1553
1550
|
* }} Settings
|
|
1554
1551
|
*/
|
|
1555
|
-
/* eslint-enable jsdoc/valid-types -- Old version */
|
|
1556
1552
|
|
|
1557
1553
|
/**
|
|
1558
1554
|
* @param {import('eslint').Rule.RuleContext} context
|
|
@@ -1623,13 +1619,12 @@ exports.getSettings = getSettings;
|
|
|
1623
1619
|
const makeReport = (context, commentNode) => {
|
|
1624
1620
|
/** @type {Report} */
|
|
1625
1621
|
const report = (message, fix = null, jsdocLoc = null, data = undefined) => {
|
|
1626
|
-
/* eslint-enable jsdoc/valid-types -- Old version */
|
|
1627
1622
|
let loc;
|
|
1628
1623
|
if (jsdocLoc) {
|
|
1629
1624
|
if (!('line' in jsdocLoc)) {
|
|
1630
1625
|
jsdocLoc.line = /** @type {import('comment-parser').Spec & {line?: Integer}} */jsdocLoc.source[0].number;
|
|
1631
1626
|
}
|
|
1632
|
-
const lineNumber = /** @type {import('eslint').AST.SourceLocation} */commentNode.loc.start.line + /** @type {Integer} */jsdocLoc.line;
|
|
1627
|
+
const lineNumber = /** @type {import('eslint').AST.SourceLocation} */commentNode.loc.start.line + ( /** @type {Integer} */jsdocLoc.line);
|
|
1633
1628
|
loc = {
|
|
1634
1629
|
end: {
|
|
1635
1630
|
column: 0,
|
|
@@ -1710,8 +1705,6 @@ const makeReport = (context, commentNode) => {
|
|
|
1710
1705
|
* }
|
|
1711
1706
|
* ) => any } JsdocVisitor
|
|
1712
1707
|
*/
|
|
1713
|
-
/* eslint-enable jsdoc/valid-types -- Old version */
|
|
1714
|
-
/* eslint-enable jsdoc/no-undefined-types -- canonical still using an older version where not defined */
|
|
1715
1708
|
|
|
1716
1709
|
/**
|
|
1717
1710
|
* @param {{
|
|
@@ -1738,7 +1731,7 @@ const iterate = (info, indent, jsdoc, ruleConfig, context, jsdocNode, node, sett
|
|
|
1738
1731
|
const report = makeReport(context, /** @type {import('estree').Node} */
|
|
1739
1732
|
jsdocNde);
|
|
1740
1733
|
const utils = getUtils(node, jsdoc, /** @type {import('eslint').AST.Token} */
|
|
1741
|
-
jsdocNode, settings, report, context, iteratingAll, ruleConfig, indent);
|
|
1734
|
+
jsdocNode, settings, report, context, sourceCode, iteratingAll, ruleConfig, indent);
|
|
1742
1735
|
if (!ruleConfig.checkInternal && settings.ignoreInternal && utils.hasTag('internal')) {
|
|
1743
1736
|
return;
|
|
1744
1737
|
}
|
|
@@ -1759,12 +1752,12 @@ const iterate = (info, indent, jsdoc, ruleConfig, context, jsdocNode, node, sett
|
|
|
1759
1752
|
indent,
|
|
1760
1753
|
info,
|
|
1761
1754
|
jsdoc,
|
|
1762
|
-
jsdocNode:
|
|
1755
|
+
jsdocNode: (
|
|
1763
1756
|
/**
|
|
1764
1757
|
* @type {import('eslint').Rule.Node & {
|
|
1765
1758
|
* range: [number, number];}}
|
|
1766
1759
|
*/
|
|
1767
|
-
jsdocNde,
|
|
1760
|
+
jsdocNde),
|
|
1768
1761
|
node,
|
|
1769
1762
|
report,
|
|
1770
1763
|
settings,
|
|
@@ -1950,8 +1943,8 @@ const iterateAllJsdocs = (iterator, ruleConfig, contexts, additiveCommentContext
|
|
|
1950
1943
|
return;
|
|
1951
1944
|
}
|
|
1952
1945
|
trackedJsdocs.add(commentNode);
|
|
1953
|
-
callIterator(context, node, [/** @type {import('estree').Comment} */
|
|
1954
|
-
commentNode], /** @type {StateObject} */state);
|
|
1946
|
+
callIterator(context, node, [( /** @type {import('estree').Comment} */
|
|
1947
|
+
commentNode)], /** @type {StateObject} */state);
|
|
1955
1948
|
},
|
|
1956
1949
|
'Program:exit'() {
|
|
1957
1950
|
const allComments = sourceCode.getAllComments();
|
|
@@ -1990,7 +1983,7 @@ const checkFile = (iterator, ruleConfig) => {
|
|
|
1990
1983
|
const allComms = /** @type {unknown} */sourceCode.getAllComments();
|
|
1991
1984
|
const utils = getBasicUtils(context, settings);
|
|
1992
1985
|
iterator({
|
|
1993
|
-
allComments: /** @type {import('estree').Node[]} */allComms,
|
|
1986
|
+
allComments: ( /** @type {import('estree').Node[]} */allComms),
|
|
1994
1987
|
context,
|
|
1995
1988
|
makeReport,
|
|
1996
1989
|
settings,
|
|
@@ -2044,7 +2037,6 @@ function iterateJsdoc(iterator, ruleConfig) {
|
|
|
2044
2037
|
* @type {Context[]|undefined}
|
|
2045
2038
|
*/
|
|
2046
2039
|
let contexts;
|
|
2047
|
-
/* eslint-enable jsdoc/valid-types -- Old version */
|
|
2048
2040
|
if (ruleConfig.contextDefaults || ruleConfig.contextSelected || ruleConfig.matchContext) {
|
|
2049
2041
|
var _context$options$2, _contexts, _contexts2;
|
|
2050
2042
|
contexts = ruleConfig.matchContext && (_context$options$2 = context.options[0]) !== null && _context$options$2 !== void 0 && _context$options$2.match ? context.options[0].match : _jsdocUtils.default.enforcedContexts(context, ruleConfig.contextDefaults, ruleConfig.nonGlobalSettings ? {} : settings);
|
|
@@ -2067,7 +2059,7 @@ function iterateJsdoc(iterator, ruleConfig) {
|
|
|
2067
2059
|
return (ctxt === null || ctxt === void 0 ? void 0 : ctxt.context) === 'any';
|
|
2068
2060
|
}));
|
|
2069
2061
|
if (hasPlainAny || hasObjectAny) {
|
|
2070
|
-
return iterateAllJsdocs(iterator, ruleConfig, hasObjectAny ? /** @type {ContextObject[]} */contexts : null, ruleConfig.matchContext).create(context);
|
|
2062
|
+
return iterateAllJsdocs(iterator, ruleConfig, hasObjectAny ? ( /** @type {ContextObject[]} */contexts) : null, ruleConfig.matchContext).create(context);
|
|
2071
2063
|
}
|
|
2072
2064
|
}
|
|
2073
2065
|
|
|
@@ -2081,7 +2073,6 @@ function iterateJsdoc(iterator, ruleConfig) {
|
|
|
2081
2073
|
|
|
2082
2074
|
/** @type {Partial<StateObject>} */
|
|
2083
2075
|
const state = {};
|
|
2084
|
-
/* eslint-enable jsdoc/no-undefined-types -- TS */
|
|
2085
2076
|
|
|
2086
2077
|
/** @type {CheckJsdoc} */
|
|
2087
2078
|
const checkJsdoc = (info, handler, node) => {
|
|
@@ -2124,10 +2115,8 @@ function iterateJsdoc(iterator, ruleConfig) {
|
|
|
2124
2115
|
settings,
|
|
2125
2116
|
state: ste
|
|
2126
2117
|
});
|
|
2127
|
-
/* eslint-enable jsdoc/no-undefined-types -- Bug */
|
|
2128
2118
|
};
|
|
2129
2119
|
}
|
|
2130
|
-
|
|
2131
2120
|
return contextObject;
|
|
2132
2121
|
},
|
|
2133
2122
|
meta: ruleConfig.meta
|