sveltejs / prettier-plugin-svelte

Format your svelte components using prettier.
MIT License
735 stars 95 forks source link

Migrate to Prettier v3 #317

Closed sosukesuzuki closed 1 year ago

sosukesuzuki commented 1 year ago

Hi, I am a maintainer at Prettier.

The Prettier team is currently working on v3(still alpha). v3 will include breaking changes to the plugin interface. Please see https://github.com/prettier/prettier/releases/tag/3.0.0-alpha.2 for more information.

I created this issue to help major plugins migrate to Prettier v3.

Myself and @fisker have created a migration guide which you can see here:

https://github.com/prettier/prettier/wiki/How-to-migrate-my-plugin-to-support-Prettier-v3%3F

If you have any questions, feel free to mention us. We can help you.

If you have already migrated to Prettier v3, sorry but please close this issue.

carmanchris31 commented 1 year ago

Thanks @sosukesuzuki! Are there any plans for prettier to start publishing types for the api?

sosukesuzuki commented 1 year ago

We have @types/prettier. But it doesn't support 3.x...

carmanchris31 commented 1 year ago

Are there plans for prettier to update the types there? Or should we look into it?

carmanchris31 commented 1 year ago

I've started working on this and will post a PR when I've got the tests passing again. Can we also make a next branch for the v3 changes?

sosukesuzuki commented 1 year ago

Are there plans for prettier to update the types there? Or should we look into it?

Sorry, Prettier core team doesn't maintain @types/prettier.

carmanchris31 commented 1 year ago

@prettier/plugin-pug is migrating here: https://github.com/prettier/plugin-pug/pull/411

potykion commented 1 year ago

Prettier v3 is out!

sebastinez commented 1 year ago

Is this something that is being worked on? Would you be ok with receiving a PR for this issue?

dummdidumm commented 1 year ago

365 is the current PR for this. The plan is to pick it up this or next week. Help is welcome!

carmanchris31 commented 1 year ago

Is this something that is being worked on? Would you be ok with receiving a PR for this issue?

Yes this is a work in progress (there is a draft PR at https://github.com/sveltejs/prettier-plugin-svelte/pull/365) but we need help to move it along. Maybe you could coordinate with @dummdidumm who also volunteered to help?

sebastinez commented 1 year ago

365 is the current PR for this. The plan is to pick it up this or next week. Help is welcome!

Nice will give it a look and help where I can

dummdidumm commented 1 year ago

Note to self: When we integrate the new major version of prettier-plugin-svelte which only works for Prettier 3, we have to add additional checks in the VS Code extension since to ensure we're not loading incompatible combinations of Prettier and the Svelte plugin.

TristanBrotherton commented 1 year ago

Is this still in the works? We recently migrated to prettier v3 and I'm now having trouble getting VsCode to format svelte files on save. Not sure if the issue lies here or in the vscode extension.

PuruVJ commented 1 year ago

The PRs are merged, although it is unreleased as of yet https://github.com/sveltejs/prettier-plugin-svelte/blob/master/CHANGELOG.md

TristanBrotherton commented 1 year ago

Thank you for the reply, that's very helpful. I'm guessing when the vscode plug-in is updated after release it will resolve the issue.

dummdidumm commented 1 year ago

Version 3 of this plugin has been released with Prettier v3 support.