Skip to content

Commit

Permalink
fix(valid-types): regression with object field checking; fixes #1068
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed May 9, 2023
1 parent 0e0e288 commit 28fa65d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rules/validTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ export default iterateJsdoc(({

if (
(typ === 'JsdocTypeObjectField' || typ === 'JsdocTypeKeyValue') &&
node.right.type === 'JsdocTypeNullable' &&
node.right.meta.position === 'suffix'
node.right?.type === 'JsdocTypeNullable' &&
node.right?.meta?.position === 'suffix'
) {
report(`Syntax error in type: ${node.right.type}`, null, tag);
}
Expand Down
7 changes: 7 additions & 0 deletions test/rules/assertions/validTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1783,5 +1783,12 @@ export default {
},
},
},
{
code: `
/**
* @returns {Promise<{publicKey, privateKey}>} - The public and private key
*/
`,
},
],
};

0 comments on commit 28fa65d

Please sign in to comment.