Skip to content

Commit 61a1049

Browse files
committed
Fixing test coverage
1 parent cb78ba8 commit 61a1049

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

src/jsdocUtils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ const hasTag = (jsdoc, targetTagName) => {
458458
* @param {object} jsdoc
459459
* @returns {Array}
460460
*/
461-
const getAllTags = (jsdoc, includeInlineTags = false) => {
461+
const getAllTags = (jsdoc, includeInlineTags) => {
462462
return includeInlineTags ? [
463463
...jsdoc.tags,
464464
...jsdoc.inlineTags,

src/rules/noUndefinedTypes.js

+21-18
Original file line numberDiff line numberDiff line change
@@ -200,25 +200,28 @@ export default iterateJsdoc(({
200200
};
201201
};
202202

203+
const typeTags = utils.filterTags(({
204+
tag,
205+
}) => {
206+
return utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');
207+
}).map(tagToParsedType('type'));
208+
209+
const namepathReferencingTags = utils.filterTags(({
210+
tag,
211+
}) => {
212+
return utils.isNamepathReferencingTag(tag);
213+
}).map(tagToParsedType('name'));
214+
215+
const namepathOrUrlReferencingTags = utils.filterTags(({
216+
tag,
217+
}) => {
218+
return utils.isNamepathOrUrlReferencingTag(tag);
219+
}, true).map(tagToParsedType('namepathOrURL'));
220+
203221
const tagsWithTypes = [
204-
// Tags with type
205-
...utils.filterTags(({
206-
tag,
207-
}) => {
208-
return utils.tagMightHaveTypePosition(tag) && (tag !== 'suppress' || settings.mode !== 'closure');
209-
}).map(tagToParsedType('type')),
210-
// Tags with namepaths
211-
...utils.filterTags(({
212-
tag,
213-
}) => {
214-
return utils.isNamepathReferencingTag(tag) && (tag !== 'suppress' || settings.mode !== 'closure');
215-
}).map(tagToParsedType('name')),
216-
// Inline tags
217-
...utils.filterTags(({
218-
tag,
219-
}) => {
220-
return utils.isNamepathOrUrlReferencingTag(tag) && (tag !== 'suppress' || settings.mode !== 'closure');
221-
}, true).map(tagToParsedType('namepathOrURL')),
222+
...typeTags,
223+
...namepathReferencingTags,
224+
...namepathOrUrlReferencingTags,
222225
].filter((result) => {
223226
// Remove types which failed to parse
224227
return result;

0 commit comments

Comments
 (0)