Skip to content

Incompatible peer dependency between eslint-plugin-prettier@^5.1.3 and prettier@^2.8.8 #9

@rabbanee

Description

@rabbanee

Description

When trying to install eslint-plugin-prettier@^5.1.3 alongside prettier@^2.8.8, I encountered the following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: node-typescript-api@1.0.0
npm ERR! Found: prettier@2.8.8
npm ERR! node_modules/prettier
npm ERR! dev prettier@"^2.8.8" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer prettier@">=3.0.0" from eslint-plugin-prettier@5.4.1
npm ERR! node_modules/eslint-plugin-prettier
npm ERR! dev eslint-plugin-prettier@"^5.1.3" from the root project

Steps to Reproduce

  1. Create a minimal Node.js project with the following devDependencies:
    {
      "prettier": "^2.8.8",
      "eslint-plugin-prettier": "^5.1.3"
    }
  2. Run npm install

Expected Behavior

If eslint-plugin-prettier@^5.1.3 only supports prettier@>=3, it would be helpful to:

  • Provide a clearer note in the documentation or release notes
  • Possibly introduce a more helpful error message (if possible)
  • Clarify which versions of prettier are supported by which versions of eslint-plugin-prettier

Actual Behavior

NPM fails to resolve the dependency tree due to a version mismatch between prettier and eslint-plugin-prettier.

Environment

  • Node.js: v21.5.0
  • npm: 10.x
  • OS: Windows
  • prettier: 2.8.8
  • eslint-plugin-prettier: 5.1.3

Suggested Solution

Either:

  • Update documentation to clearly indicate that eslint-plugin-prettier@5.x only supports prettier@>=3, or
  • If possible, maintain compatibility with prettier@2.x, or
  • Suggest older versions of eslint-plugin-prettier for those still using prettier@2.x

Thank you for your time and effort maintaining this repository!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions