Rules
no-flush-sync
Full Name in eslint-plugin-react-dom
react-dom/no-flush-syncFull Name in @eslint-react/eslint-plugin
@eslint-react/dom/no-flush-syncPresets
domrecommendedrecommended-typescriptrecommended-type-checked
Description
Disallow flushSync.
flushSync can significantly hurt performance, and may unexpectedly force pending Suspense boundaries to show their fallback state.
Most of the time, flushSync can be avoided, so use flushSync as a last resort.
Examples
Failing
import { flushSync } from "react-dom";
flushSync(() => {
setSomething(123);
});