Skip to content

Commit 28fa65d

Browse files
committed
fix(valid-types): regression with object field checking; fixes #1068
1 parent 0e0e288 commit 28fa65d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/rules/validTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ export default iterateJsdoc(({
164164

165165
if (
166166
(typ === 'JsdocTypeObjectField' || typ === 'JsdocTypeKeyValue') &&
167-
node.right.type === 'JsdocTypeNullable' &&
168-
node.right.meta.position === 'suffix'
167+
node.right?.type === 'JsdocTypeNullable' &&
168+
node.right?.meta?.position === 'suffix'
169169
) {
170170
report(`Syntax error in type: ${node.right.type}`, null, tag);
171171
}

test/rules/assertions/validTypes.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,5 +1783,12 @@ export default {
17831783
},
17841784
},
17851785
},
1786+
{
1787+
code: `
1788+
/**
1789+
* @returns {Promise<{publicKey, privateKey}>} - The public and private key
1790+
*/
1791+
`,
1792+
},
17861793
],
17871794
};

0 commit comments

Comments
 (0)