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
Linting a function with an empty return statement:
functionf(){return;}
produces this crash:
Oops! Something went wrong! :(
ESLint: 8.57.0
TypeError: Cannot read properties of null (reading 'type')
Occurred while linting /tmp/test/test.js:1
Rule: "prefer-arrow-functions/prefer-arrow-functions"
at getBodySource (/tmp/test/node_modules/.pnpm/eslint-plugin-prefer-arrow-functions@3.3.2_eslint@8.57.0/node_modules/eslint-plugin-prefer-arrow-functions/dist/prefer-arrow-functions.js:59:36)
at getFunctionDescriptor (/tmp/test/node_modules/.pnpm/eslint-plugin-prefer-arrow-functions@3.3.2_eslint@8.57.0/node_modules/eslint-plugin-prefer-arrow-functions/dist/prefer-arrow-functions.js:156:23)
at writeArrowConstant (/tmp/test/node_modules/.pnpm/eslint-plugin-prefer-arrow-functions@3.3.2_eslint@8.57.0/node_modules/eslint-plugin-prefer-arrow-functions/dist/prefer-arrow-functions.js:151:22)
at Object.fix (/tmp/test/node_modules/.pnpm/eslint-plugin-prefer-arrow-functions@3.3.2_eslint@8.57.0/node_modules/eslint-plugin-prefer-arrow-functions/dist/prefer-arrow-functions.js:277:60)
at normalizeFixes (/tmp/test/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/report-translator.js:194:28)
at /tmp/test/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/report-translator.js:365:49
at Object.report (/tmp/test/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/linter.js:1047:41)
at FunctionDeclaration[parent.type!="ExportDefaultDeclaration"] (/tmp/test/node_modules/.pnpm/eslint-plugin-prefer-arrow-functions@3.3.2_eslint@8.57.0/node_modules/eslint-plugin-prefer-arrow-functions/dist/prefer-arrow-functions.js:275:29)
at ruleErrorHandler (/tmp/test/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/linter.js:1076:28)
at /tmp/test/node_modules/.pnpm/eslint@8.57.0/node_modules/eslint/lib/linter/safe-emitter.js:45:58
The text was updated successfully, but these errors were encountered:
andersk
added a commit
to andersk/eslint-plugin-prefer-arrow-functions
that referenced
this issue
Jun 7, 2024
Linting a function with an empty return statement:
produces this crash:
The text was updated successfully, but these errors were encountered: