Skip to content

Commit 24dd328

Browse files
committed
fix(check-types): allow albeit questionable variadic without operand function(...); fixes #389
1 parent 0eba9c9 commit 24dd328

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,6 +2561,9 @@ function quux (foo) {
25612561
function quux (foo) {
25622562

25632563
}
2564+
2565+
/** @param {function(...)} callback The function to invoke. */
2566+
var subscribe = function(callback) {};
25642567
````
25652568

25662569

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dependencies": {
88
"comment-parser": "^0.6.2",
99
"debug": "^4.1.1",
10-
"jsdoctypeparser": "^5.0.1",
10+
"jsdoctypeparser": "^5.1.0",
1111
"lodash": "^4.17.15",
1212
"object.entries-ponyfill": "^1.0.1",
1313
"regextras": "^0.6.1"

src/rules/checkTypes.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ export default iterateJsdoc(({
130130
};
131131

132132
traverse(typeAst, (node, parentName, parentNode) => {
133+
if (!node) {
134+
return;
135+
}
133136
const {type, name} = node;
134137
if (!['NAME', 'ANY'].includes(type)) {
135138
return;

test/rules/assertions/checkTypes.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,5 +2083,11 @@ export default {
20832083
}
20842084
`,
20852085
},
2086+
{
2087+
code: `
2088+
/** @param {function(...)} callback The function to invoke. */
2089+
var subscribe = function(callback) {};
2090+
`,
2091+
},
20862092
],
20872093
};

0 commit comments

Comments
 (0)