Hi there, stumbled into linter-crashing bug.
Error caused when processing a self closing fragment: <React.Fragment /> crashes eslint.
Without going into whether <React.Fragment /> is really needed, it shouldn't break eslint and especially with no indication from the error that this was the cause, I had to search file by file to find it.
TypeError: Cannot read property 'range' of null
at replaceNode (/node_modules/eslint-plugin-react/lib/rules/jsx-fragments.js:18:34)
at Object.fix (/node_modules/eslint-plugin-react/lib/rules/jsx-fragments.js:74:18)
at normalizeFixes (/node_modules/eslint/lib/report-translator.js:176:28)
at args (/node_modules/eslint/lib/report-translator.js:278:18)
at Object.report (/node_modules/eslint/lib/linter.js:830:41)
at Program:exit.jsxElements.forEach.node (/node_modules/eslint-plugin-react/lib/rules/jsx-fragments.js:169:23)
at Array.forEach (<anonymous>)
at Program:exit (/node_modules/eslint-plugin-react/lib/rules/jsx-fragments.js:158:21)
at listeners.(anonymous function).forEach.listener (/node_modules/eslint/lib/util/safe-emitter.js:45:58)
at Array.forEach (<anonymous>)
error Command failed with exit code 2.
Change <React.Fragment /> to <></> that will let you run the eslint task
Sorry about that, I鈥檒l take a look.
Most helpful comment
Sorry about that, I鈥檒l take a look.