Skip to content

Commit ac9589c

Browse files
committed
Fixing test coverage
1 parent 1f768cd commit ac9589c

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

src/jsdocUtils.js

Lines changed: 1 addition & 1 deletion
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

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -198,25 +198,28 @@ export default iterateJsdoc(({
198198
};
199199
};
200200

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

0 commit comments

Comments
 (0)