Closed jeffmccormick closed 1 year ago
Upon further investigation, it appears that this is a deeply rooted issue that goes all the way to ESLint and how it load modules. This it not a prettier-eslint issue, so I will close this.
If anyone else has this issue, there is some relevant discussion over here. And the temporary hack fix is to use @rushstack/eslint-patch in your config file (this is what CRA uses) to convince ESLint to load modules via the Yarn PnP resolver. So basically, I needed to change my .eslintrc.json
to a .eslintrc.js
like so:
require("@rushstack/eslint-patch/modern-module-resolution");
module.exports = {
"root": true,
"extends": ["eslint:recommended", "react-app"]
}
If you're here after (presumed) v9.x of ESLint has been released, you should instead just use the new config system.
prettier-eslint-cli
version: 7.1.0prettier
version: 2.5.1eslint
version: 8.13.0Minimal repo setup with PnP enabled:
Example ESLint config:
Some random JS file to lint:
Try to run prettier-eslint-cli:
Error output:
Looks like there is some disagreement about the format in which modules are getting passed around Yarn, eslint, and prettier-eslint, but I haven't been able to dig in further.