Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ESLint couldn't find the config "prettier" to extend from

I am trying to format my code using eslint but when I run npm run lint -f I get this output:

Oops! Something went wrong! :( ESLint: 6.8.0. ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.    The config "prettier" was referenced from the config file in "/project/node_modules/eslint-plugin-prettier/eslint-plugin-prettier.js". 

This is my dependences package.json

{   "scripts": {     "lint": "eslint \"**/*.{js,ts}\" --quiet --fix",   },   "private": true,   "dependencies": {     "tslib": "^1.11.1",     "zone.js": "^0.10.3"   },   "devDependencies": {     "@typescript-eslint/eslint-plugin": "^2.30.0",     "@typescript-eslint/parser": "^2.30.0",     "codelyzer": "^5.2.2",     "eslint": "^6.8.0",     "eslint-config-google": "^0.14.0",     "eslint-plugin-import": "^2.20.2",     "eslint-plugin-prettier": "^3.1.3",     "prettier": "2.0.5",    } } 
like image 582
Reynier Rivero Avatar asked May 04 '20 17:05

Reynier Rivero


People also ask

What is ESLint config Prettier?

Turns off all rules that are unnecessary or might conflict with Prettier. This lets you use your favorite shareable config without letting its stylistic choices get in the way when using Prettier.

Can I use ESLint with Prettier?

You can use ESLint plugins that let you run Prettier as if it is a linter rule: eslint-plugin-prettier for JavaScript. tslint-plugin-prettier for TypeScript.

How do I fix Prettier errors in react?

To fix this we need to click over those errors and press ctrl+. and select fix all auto-fixable problems . This will fix all prettier linting issues automatically. On your right-hand side, there is an icon to Open Settings in JSON format.


1 Answers

I think you need to install eslint-config-prettier see here

like image 187
pgjones Avatar answered Sep 25 '22 02:09

pgjones