hosseinmd / prettier-plugin-jsdoc

A Prettier plugin to format JSDoc comments.
MIT License
228 stars 29 forks source link

feat: support prettier v3 #195

Closed auvred closed 1 year ago

auvred commented 1 year ago

Closes https://github.com/hosseinmd/prettier-plugin-jsdoc/issues/194

This PR includes a lot of changes, I tried to make them as few as possible, so I didn't run prettier -w, to prevent formatting that might complicate the PR review.

Checklist:

If I missed something, please correct me.


P.S.

1) It'd be nice to update all the dependencies, because they're very outdated... I can do this in this or another PR image

2) It seems that the umd build is incorrect, because when I past

<script src="https://www.unpkg.com/prettier-plugin-jsdoc"></script>

to the webpage, it throws this image image

TODO after review:

so1ve commented 1 year ago

@hosseinmd Hi, thanks for supporting prettier v3! How about creating a new release? :)

turadg commented 1 year ago

Looking forward to a release of this.

I also nominate @auvred as an additional maintainer for this important project.

hosseinmd commented 1 year ago

What version you are suggesting to release this change? It seems like a breaking change, so we should move to 1.0.0

hosseinmd commented 1 year ago

In addition, need to be mention in README, compatible versions with prettier v3 and v2

so1ve commented 1 year ago

Maybe 1.0.0 / 0.5.0 (major is 0 means this package is not stable yet) ?

hosseinmd commented 1 year ago

I think it is ok to release major version.

turadg commented 1 year ago

I think it is ok to release major version.

Your project but in my experience, it's still not stable. Per https://semver.org/, Until you release 1.0 there is no obligation to bump the major version on breaking changes. Once you do this, any breaking change will require a major version bump.

I would request that you release as 0.5.0 so as to maintain flexibility in designing the options and their defaults.

danielpza commented 1 year ago

Once you do this, any breaking change will require a major version bump.

I agree. On the other hand this is a very popular package that is already used in production by a lot of projects image

semver.org states:

How do I know when to release 1.0.0? If your software is being used in production, it should probably already be 1.0.0. If you have a stable API on which users have come to depend, you should be 1.0.0. If you’re worrying a lot about backward compatibility, you should probably already be 1.0.0.

Doesn’t this discourage rapid development and fast iteration? Major version zero is all about rapid development. If you’re changing the API every day you should either still be in version 0.y.z or on a separate development branch working on the next major version.

I think both jumping to v1.0.0 or staying in v0.x.x are both valid

danielpza commented 1 year ago

Will every change in the formatting output constitute a breaking change in the future?

turadg commented 1 year ago

Will every change in the formatting output constitute a breaking change in the future?

No, some formatting output changes will be necessary to fix bugs.

But changes in intent (such as flipping a default or removing an option) will be breaking changes. And ofc anything that throws an error.

hosseinmd commented 1 year ago

In my opinion, this is a breaking change for someone who doesn't want to move to prettier v3, so if anybody installed this by caret ^0.4.x might get 0.5.0 then break. We should prevent them to get this version, so we should release major version

so1ve commented 1 year ago

@hosseinmd IMO this package's major version is 0, which means it may introduce breaking changes in any minor version change. But I don't mind whether you release a major or minor! :)

hosseinmd commented 1 year ago

So, I released v1.0.0. Thank you.