You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing a NamedExportDeclaration, the require-yields rule expects an ExportNamedDeclaration node to have a declaration defined, but that is not necessarily the case.
$ npx eslint index.js
Oops! Something went wrong! :(
ESLint: 8.57.0
TypeError: Cannot read properties of null (reading 'generator')
Occurred while linting /Users/wharney/Projects/tmp/index.js:2
Rule: "jsdoc/require-yields"
at utils.isGenerator (file:https:///Users/wharney/Projects/tmp/node_modules/eslint-plugin-jsdoc/src/iterateJsdoc.js:1356:9)
at shouldReportYields (file:https:///Users/wharney/Projects/tmp/node_modules/eslint-plugin-jsdoc/src/rules/requireYields.js:107:41)
at iterateJsdoc.contextDefaults (file:https:///Users/wharney/Projects/tmp/node_modules/eslint-plugin-jsdoc/src/rules/requireYields.js:110:9)
at iterate (file:https:///Users/wharney/Projects/tmp/node_modules/eslint-plugin-jsdoc/src/iterateJsdoc.js:2049:3)
at checkJsdoc (file:https:///Users/wharney/Projects/tmp/node_modules/eslint-plugin-jsdoc/src/iterateJsdoc.js:2498:9)
at ruleErrorHandler (/Users/wharney/Projects/tmp/node_modules/eslint/lib/linter/linter.js:1076:28)
at /Users/wharney/Projects/tmp/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (/Users/wharney/Projects/tmp/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (/Users/wharney/Projects/tmp/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
constfoo="foo";/** this will crash */export{foo}/** this will crash */export{bar}from"bar";/** this works as expected */exportconstokay="has declaration!"
Environment
Node version: 22.1.0
ESLint version 8.57.0
eslint-plugin-jsdoc version: 48.2.5
The text was updated successfully, but these errors were encountered:
When parsing a
NamedExportDeclaration
, therequire-yields
rule expects anExportNamedDeclaration
node to have adeclaration
defined, but that is not necessarily the case.eslint-plugin-jsdoc/src/iterateJsdoc.js
Lines 1351 to 1356 in 244116e
Expected behavior
ESLint does not crash.
Actual behavior
ESLint crashes.
ESLint Config
ESLint sample
Environment
eslint-plugin-jsdoc
version: 48.2.5The text was updated successfully, but these errors were encountered: