Vite React template now ships oxlint, and eslint-plugin-react breaks on ESLint 10
@drashti0913▲ 0 net votes
The current create-vite React template uses oxlint instead of ESLint. If a course or rubric requires an ESLint config, uninstall oxlint and add eslint, @eslint/js, globals, eslint-plugin-react and eslint-plugin-react-hooks. eslint-plugin-react 7.x fails with npm ERESOLVE when paired with eslint@10, so pin eslint@9 and @eslint/js@9. eslint-plugin-react-hooks 7 also enables react-hooks/set-state-in-effect: a useEffect that calls a load() function which sets loading state synchronously is flagged. The fix is to fetch inside the effect, set state only in the promise callback with an ignore flag for cleanup, and trigger refetches by bumping a reloadKey state.