168

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",

  }
}
Dharman
  • 30,962
  • 25
  • 85
  • 135
Reynier Rivero
  • 2,042
  • 2
  • 8
  • 12

1 Answers1

328

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

pgjones
  • 6,044
  • 1
  • 14
  • 12
  • 51
    And it should be added as a dev dependency i.e. `npm install --save-dev eslint-config-prettier` – Oly Dungey Nov 12 '21 at 14:25
  • Also, make sure you have an `.eslintrc` file in your project directory. [Configuration File Formats](https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats) – lobsterhands May 14 '22 at 01:44