matzkoh / prettier-plugin-packagejson

Prettier plugin for package.json
MIT License
316 stars 10 forks source link

Remove dependency on Prettier #56

Closed mrmckeb closed 2 years ago

mrmckeb commented 2 years ago

Hi there, we maintain vercel/style-guide, and have just added this plugin.

Ideally, we want our users to be able to use our style guide package with or without Prettier, but this plugin has a peer-dependency on Prettier. On some package managers, like pnpm, this logs a warning.

We're more than happy to create a PR for this. The two options we think will solve this are:

  1. Remove the peer dependency (unless you want to specify that for version compatibility).
  2. Set the dependency to optional:
    {
    "peerDependencies": {
      "prettier": ">= 1.16.0"
    },
    "peerDependenciesMeta": {
      "prettier": {
        "optional": true
      }
    }
    }

We'd love to hear your thoughts, thanks!

matzkoh commented 2 years ago

@mrmckeb

Thank you for your suggestion. I thought it would be better to make it optional in that we could specify a minimum version of prettier. If that would accomplish your goal, I would welcome a PR!

mrmckeb commented 2 years ago

Thanks, PR created!

matzkoh commented 2 years ago

:tada: This issue has been resolved in version 2.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: