Linting a function with an empty return statement:
function f() { 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
Linting a function with an empty return statement:
produces this crash: