Skip to content

Commit

Permalink
fix(require-yields): avoid error when ExportNamedDeclaration has …
Browse files Browse the repository at this point in the history
…no `declaration` prop
  • Loading branch information
wjhsf authored and brettz9 committed May 23, 2024
1 parent 244116e commit 93a9415
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/iterateJsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ const getUtils = (
* @type {import('estree').ExportNamedDeclaration|
* import('estree').ExportDefaultDeclaration}
*/ (node).declaration
).generator,
)?.generator,
);
};

Expand Down
13 changes: 13 additions & 0 deletions test/rules/assertions/requireYields.js
Original file line number Diff line number Diff line change
Expand Up @@ -1884,5 +1884,18 @@ export default {
}
`,
},
{
code: `
/**
*
*/
export { foo } from "bar"
`,
options: [
{
contexts: ['ExportNamedDeclaration']
}
]
}
],
};

0 comments on commit 93a9415

Please sign in to comment.