TypeError: Cannot read properties of null (reading 'type')
Occurred while linting /home/pedr/repo/eslint-plugin-prefer-arrow/file.js:1
at getBodySource (/home/pedr/repo/eslint-plugin-prefer-arrow/node_modules/eslint-plugin-prefer-arrow-functions/dist/prefer-arrow-functions.js:57:36)
at getFunctionDescriptor (/home/pedr/repo/eslint-plugin-prefer-arrow/node_modules/eslint-plugin-prefer-arrow-functions/dist/prefer-arrow-functions.js:128:23)
at writeArrowConstant (/home/pedr/repo/eslint-plugin-prefer-arrow/node_modules/eslint-plugin-prefer-arrow-functions/dist/prefer-arrow-functions.js:121:24)
at Object.fix (/home/pedr/repo/eslint-plugin-prefer-arrow/node_modules/eslint-plugin-prefer-arrow-functions/dist/prefer-arrow-functions.js:243:60)
at normalizeFixes (/home/pedr/repo/eslint-plugin-prefer-arrow/node_modules/eslint/lib/linter/report-translator.js:178:28)
at /home/pedr/repo/eslint-plugin-prefer-arrow/node_modules/eslint/lib/linter/report-translator.js:343:49
at Object.report (/home/pedr/repo/eslint-plugin-prefer-arrow/node_modules/eslint/lib/linter/linter.js:905:41)
at FunctionDeclaration[parent.type!="ExportDefaultDeclaration"] (/home/pedr/repo/eslint-plugin-prefer-arrow/node_modules/eslint-plugin-prefer-arrow-functions/dist/prefer-arrow-functions.js:241:29)
at /home/pedr/repo/eslint-plugin-prefer-arrow/node_modules/eslint/lib/linter/safe-emitter.js:45:58
at Array.forEach (<anonymous>)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I don't think this is a very useful edge case, but I found this error running the plugin.
Returning
undefined
resolves the problem..eslintrs.js
file.js
Try to run:
Error found: