eslintprettier

ESLint couldn't find the config "prettier/@typescript-eslint" after relocating .eslintrc to parent


I have a folder structure like

parentFolder > componentA
             > componentB
             > componentC

Each component has a package.json which defines a yarn lint command (eslint "myFilter" --no-error-on-unmatched-pattern). And each component has its own .eslintrc and .prettierrc

When I am in a componentA/B/C folder and run yarn lint, it is working as expected.

Since all of the .eslintrc are the same in each component folder, I moved the file under parentFolder and delete the copies in the component folders. When I call yarn lint, it used the .eslintrc in the parentFolder, but, I am getting an error.

Oops! Something went wrong! :(

ESLint: 6.8.0.

ESLint couldn't find the config "prettier/@typescript-eslint" to extend from. Please check that the name of the config is correct.

I moved the .prettierrc to the parent folder, but, it couldn't find it. What should I do? Thank you

Update: I noticed if I add the prettier on the package.json in the parent folder and run the yarn install, it works. But, I don't know if this is the proper way to do it.


Solution

  • prettier/@typescript-eslint has been removed in eslint-config-prettier v8.0.0. Just remove it from your ESLint config file. The only entry in extends that is needed now for Prettier and ESLint to not conflict is "prettier" (make sure it's the last one in extends).