-
Notifications
You must be signed in to change notification settings - Fork 5
Description
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
- Create a minimal Node.js project with the following
devDependencies:{ "prettier": "^2.8.8", "eslint-plugin-prettier": "^5.1.3" } - 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
prettierare supported by which versions ofeslint-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.xonly supportsprettier@>=3, or - If possible, maintain compatibility with
prettier@2.x, or - Suggest older versions of
eslint-plugin-prettierfor those still usingprettier@2.x
Thank you for your time and effort maintaining this repository!