sveltejs / prettier-plugin-svelte

Format your svelte components using prettier.
MIT License
745 stars 97 forks source link

refactor: Remove deprecated concat #334

Closed carmanchris31 closed 1 year ago

carmanchris31 commented 1 year ago

builders.doc.concat is currently deprecated and is removed in prettier v3 (see https://github.com/prettier/prettier/wiki/How-to-migrate-my-plugin-to-support-Prettier-v3%3F)

This proactively removes it's usage so there are fewer changes required to support v3

edit: this does the same as https://github.com/sveltejs/prettier-plugin-svelte/pull/276 except against the latest code which also includes replacing the groupConcat method introduced in #313

I also see from that thread that we plan on doing this for v3 only. In that case, if you could create a next branch for v3 I could go ahead and start making pull requests for that as well. I've got a number of the changes figured out; I just wanted to see if there were any we could do ahead of time.

dummdidumm commented 1 year ago

Thank you very much for tackling this, and for your desire to also work on some of the other changes! As you noted, we can remove concat only for the the next major of prettier-plugin-svelte, so a next branch is the right approach. I'll create another PR with the next branch so it exists, and you can reroute your PR to that branch.

carmanchris31 commented 1 year ago

Perfect, thanks!

carmanchris31 commented 1 year ago

Updated the base branch 👌

carmanchris31 commented 1 year ago

I noticed I missed a spot with some parts that still check for the Concat nodes.

carmanchris31 commented 1 year ago

Updated again :)

carmanchris31 commented 1 year ago

If we merge this in I can work on the next set of changes.

carmanchris31 commented 1 year ago

Sorry for taking so long - thank you! If you like you can continue to work on the next set of changes.

Thanks for following up!

On the bright side, prettier agreed to ship their own types which is a huge help: https://github.com/prettier/prettier/issues/14033