Skip to content

Commit 4c4b9b5

Browse files
committed
fix(no-undefined-types): problem with empty doc blocks (fixes #300)
1 parent 48ed8bc commit 4c4b9b5

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3239,6 +3239,15 @@ class Foo {
32393239
bar (baz) {
32403240
}
32413241
}
3242+
3243+
/****/
3244+
3245+
/**
3246+
*
3247+
*/
3248+
function quux () {
3249+
3250+
}
32423251
````
32433252

32443253

src/rules/noUndefinedTypes.js

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

test/rules/assertions/noUndefinedTypes.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export default {
181181
invalidTemplateReference () {
182182
}
183183
}
184-
184+
185185
/**
186186
* @template TEMPLATE_TYPE
187187
*/
@@ -467,6 +467,18 @@ export default {
467467
}
468468
}
469469
`
470+
},
471+
{
472+
code: `
473+
/****/
474+
475+
/**
476+
*
477+
*/
478+
function quux () {
479+
480+
}
481+
`
470482
}
471483
]
472484
};

0 commit comments

Comments
 (0)