Skip to content

Commit 93a9415

Browse files
wjhsfbrettz9
authored andcommitted
fix(require-yields): avoid error when ExportNamedDeclaration has no declaration prop
1 parent 244116e commit 93a9415

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/iterateJsdoc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ const getUtils = (
13531353
* @type {import('estree').ExportNamedDeclaration|
13541354
* import('estree').ExportDefaultDeclaration}
13551355
*/ (node).declaration
1356-
).generator,
1356+
)?.generator,
13571357
);
13581358
};
13591359

test/rules/assertions/requireYields.js

+13
Original file line numberDiff line numberDiff line change
@@ -1884,5 +1884,18 @@ export default {
18841884
}
18851885
`,
18861886
},
1887+
{
1888+
code: `
1889+
/**
1890+
*
1891+
*/
1892+
export { foo } from "bar"
1893+
`,
1894+
options: [
1895+
{
1896+
contexts: ['ExportNamedDeclaration']
1897+
}
1898+
]
1899+
}
18871900
],
18881901
};

0 commit comments

Comments
 (0)