Resolving Prettier + React: context.getPhysicalFilename is not a function

If you’ve recently upgraded to eslint-plugin-prettier@^4 on an existing React project, you may have encountered the cryptic error: