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:
Run yarn build
Creating an optimized production build...
Failed to compile.
Error while loading rule 'prettier/prettier': context.getPhysicalFilename is not a function
Occurred while linting /home/runner/work/$repository/$repository/src/index.tsx
Error: Process completed with exit code 1.