sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
867 stars 44 forks source link

Error: "prettier/@typescript-eslint" has been merged into "prettier" in eslint-config-prettier 8.0.0 #114

Open theclive opened 3 years ago

theclive commented 3 years ago

Overview

We are having an issue using prettier-standard alongside eslint & eslint-config-prettier. Upon running prettier-standard --lint we receive an error which seems to be related to this change in eslint-config-prettier. This error does not present when eslint-config-prettier is removed from our package.json.

Steps to re-create

Expected results

➜ npm run lint

> recreate-prettier-error@1.0.0 lint /Users/clive/Developer/learning/recreate-prettier-error
> prettier-standard --lint *

package-lock.json 164ms
package.json 5ms
All matched files use Standard code style!

Actual results

➜ npm run lint

> recreate-prettier-error@1.0.0 lint /Users/clive/Developer/learning/recreate-prettier-error
> prettier-standard --lint *

Error: Cannot read config file: /Users/clive/Developer/learning/recreate-prettier-error/node_modules/eslint-config-prettier/@typescript-eslint.js
Error: "prettier/@typescript-eslint" has been merged into "prettier" in eslint-config-prettier 8.0.0. See: https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21
Referenced from: BaseConfig
    at Object.<anonymous> (/Users/clive/Developer/learning/recreate-prettier-error/node_modules/eslint-config-prettier/@typescript-eslint.js:1:7)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at module.exports (/Users/clive/Developer/learning/recreate-prettier-error/node_modules/import-fresh/index.js:32:59)
    at loadJSConfigFile (/Users/clive/Developer/learning/recreate-prettier-error/node_modules/@eslint/eslintrc/lib/config-array-factory.js:225:16)
    at loadConfigFile (/Users/clive/Developer/learning/recreate-prettier-error/node_modules/@eslint/eslintrc/lib/config-array-factory.js:309:20)
    at ConfigArrayFactory._loadConfigData (/Users/clive/Developer/learning/recreate-prettier-error/node_modules/@eslint/eslintrc/lib/config-array-factory.js:609:42)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! recreate-prettier-error@1.0.0 lint: `prettier-standard --lint *`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the recreate-prettier-error@1.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/clive/.npm/_logs/2021-03-01T11_21_47_980Z-debug.log
einSelbst commented 3 years ago

I'm having the same problem but this project seems unmaintained, no updates for more than a year unfortunately.

N1ck0lay commented 3 years ago

Read this: https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21

in my case, in .eslintrc file I had:

  "extends": [
    "standard",
    "standard-react",
    "plugin:prettier/recommended",
    "prettier/standard",
    "prettier/react"
  ],

and now I have:

  "extends": [
    "standard-react",
    "plugin:prettier/recommended"
  ],