Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump optional dependency prettier version to version range to prevent version conflicts with other packages #991

Open
sceee opened this issue Oct 10, 2024 · 0 comments

Comments

@sceee
Copy link

sceee commented Oct 10, 2024

Is your enhancement related to a problem? Please describe.

yaml-language-server declares a specific 2.8.7 version of prettier as optional dependency:

"prettier": "2.8.7"

This causes issues with different prettier versions being installed in a project / being used by other packages.
E.g. with astro:

└─┬ @astrojs/[email protected]
  └─┬ @astrojs/[email protected]
    ├── [email protected] invalid: "^3.0.0" from node_modules/@astrojs/language-server
    ├─┬ [email protected]
    │ └── [email protected] deduped invalid: "^3.0.0" from node_modules/@astrojs/language-server
    └─┬ [email protected]
      └─┬ [email protected]
        └── [email protected] deduped invalid: "^3.0.0" from node_modules/@astrojs/language-server

npm error code ELSPROBLEMS
npm error invalid: [email protected] C:\my_proj\node_modules\prettier

Describe the solution you would like

Either remove prettier as optional dependency or declare a version range like ">=2.8.7" for the optional prettier dependency so that it can correctly be deduped by npm depending on the other version constaints from the project / other dependencies.

Describe alternatives you have considered

Overriding the prettier version yaml-language-server declares in my project's package.json via:

"overrides": {
    "yaml-language-server": {
      "prettier": ">=2.8.7"
    }
  }

...to "hack" around the problem.

Additional context

Related to #909 which has been open since a long time but there was no longer any activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant