Skip to content

Commit 86fd67c

Browse files
bennieswartgajus
authored andcommitted
fix: the 'Unsupported function signature format.' error. (#37)
1 parent c6cb740 commit 86fd67c

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,13 @@ function quux (...args) {
276276
*/
277277
function quux ({a, b}) {
278278

279+
}
280+
281+
/**
282+
* @param foo
283+
*/
284+
function quux ({a, b} = {}) {
285+
279286
}
280287
```
281288

src/jsdocUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const getFunctionParameterNames = (functionNode : Object) : Array<string> => {
1111
return param.left.name;
1212
}
1313

14-
if (param.type === 'ObjectPattern') {
14+
if (param.type === 'ObjectPattern' || _.get(param, 'left.type') === 'ObjectPattern') {
1515
return '<ObjectPattern>';
1616
}
1717

test/rules/assertions/checkParamNames.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,16 @@ export default {
191191
*/
192192
function quux ({a, b}) {
193193
194+
}
195+
`
196+
},
197+
{
198+
code: `
199+
/**
200+
* @param foo
201+
*/
202+
function quux ({a, b} = {}) {
203+
194204
}
195205
`
196206
}

0 commit comments

Comments
 (0)