Skip to content

Commit 93dc649

Browse files
committed
refactor(no-undefined-tags): no need to check tags as always expected from comment-parser
refactor(require-jsdoc): use internal `getJSDocComment` to future-proof when removed from eslint
1 parent c18e6d3 commit 93dc649

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/jsdocUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ const lookupTable = {
415415
return false;
416416
}
417417

418-
// If we end up here, we stumbled upon an unknown elements
418+
// If we end up here, we stumbled upon an unknown element.
419419
// Most likely it is enough to add it to the blacklist.
420420
//
421421
// throw new Error('Unknown node type: ' + node.type);

src/rules/noUndefinedTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default iterateJsdoc(({
5858
})
5959
.map(parseComment)
6060
.flatMap((doc) => {
61-
return (doc.tags || []).filter(({tag}) => {
61+
return doc.tags.filter(({tag}) => {
6262
return utils.isNamepathDefiningTag(tag);
6363
});
6464
})

src/rules/requireJsdoc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import _ from 'lodash';
22
import iterateJsdoc from '../iterateJsdoc';
33
import jsdocUtils from '../jsdocUtils';
44
import exportParser from '../exportParser';
5+
import getJSDocComment from '../eslint/getJSDocComment';
56

67
const OPTIONS_SCHEMA = {
78
additionalProperties: false,
@@ -125,7 +126,7 @@ export default iterateJsdoc(null, {
125126
const {require: requireOption, publicOnly} = getOptions(context);
126127

127128
const checkJsDoc = (node) => {
128-
const jsDocNode = sourceCode.getJSDocComment(node);
129+
const jsDocNode = getJSDocComment(sourceCode, node);
129130

130131
if (jsDocNode) {
131132
return;

0 commit comments

Comments
 (0)