I'm implementing ESLint along with Prettier in a React project, and the below code is giving a frustrating parsing error.
ReactDOM.render(
<TierComparisonApp {...tier_comparison_app.dataset} />,
document.getElementById('tier_comparison_app'),
); <-- Parsing error: Unexpected token )
Oddly, when I remove the comma after the second argument passed to render
, that parsing error goes away, revealing an expected problem in missing that comma, but also another problem with tier_comparision_app
being undefined.
ReactDOM.render(
<TierComparisonApp {...tier_comparison_app.dataset} />, <-- (correctly caught as undefined)
document.getElementById('tier_comparison_app') <-- (correctly saying to insert a comma)
);
Stranger yet, making the aforementioned change also reveals problems much earlier in the file having to do with using ==
instead of ===
, which is also expected behavior. Any ideas as to what could be causing this? I've created a Pastebin of my .eslintrc.json
because it is a little dense with rules.