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

Use Prettier 3.0 by default #3069

Merged
merged 7 commits into from
Jul 30, 2023

Conversation

sosukesuzuki
Copy link
Member

@sosukesuzuki sosukesuzuki commented Jul 9, 2023

  • Run tests
  • Update the CHANGELOG.md with a summary of your changes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just run yarn run prettier

@Tri125
Copy link

Tri125 commented Jul 25, 2023

Thank you for all the hard work. ❤️
Do we have an eta for this PR? 👀

@mathiash98
Copy link

Seems like the natural thing to do, waiting for this 👍🏼

import * as meriyahPlugin from "prettier/plugins/meriyah";
import * as typescriptPlugin from "prettier/plugins/typescript";
import * as yamlPlugin from "prettier/plugins/yaml";
// @ts-expect-error -- d.ts file missing estree plugin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is the best way to handle it. Maybe add a .d.ts file locally instead?

@sosukesuzuki sosukesuzuki merged commit 2f99764 into prettier:main Jul 30, 2023
9 checks passed
@sosukesuzuki sosukesuzuki deleted the use-prettier-v3-by-default branch July 30, 2023 12:53
ntotten added a commit that referenced this pull request Jul 31, 2023
ntotten added a commit that referenced this pull request Jul 31, 2023
@karlhorky
Copy link
Contributor

karlhorky commented Aug 22, 2023

@ntotten Now that this PR has been reverted in ad1d008 and the latest 10.1.0 version of the extension uses Prettier v2 again, is there any way to install the 10.2.0-preview version, for those who would like to use Prettier v3 integrated in the extension?

Or is there a plan for releasing this as non-preview version? What is a quick description of the problems that caused the revert?

I guess a workaround switch to integrated Prettier v3 is to downgrade the extension to 10.0.0...

@karlhorky
Copy link
Contributor

karlhorky commented Nov 8, 2023

@ntotten we could also open a new issue to track Prettier v3 support, since the VS Code extension page still reports 10.1.0 as the latest version (so I'm assuming that Prettier v2 is still being used in the latest VS Code extension version).

@karlhorky
Copy link
Contributor

karlhorky commented Nov 18, 2023

Oh, looks like (judging from the VS Code extension Marketplace page) the 10.2.0-preview version has been unpublished now...

Screenshot 2023-11-18 at 19 09 30

So one fewer workaround here 😬 Maybe downgrading to 10.0.0 still an option... 🤔

@karlhorky
Copy link
Contributor

karlhorky commented Nov 18, 2023

To be clear, the problem still exists with v10.1.0 of the extension and latest Prettier 3.1.0, for projects where the prettier package is not installed (which would be the majority of use cases for the extension)

The following

div {
  transition:
    transform 0.15s,
    color 0.15s;
}

will be formatted to the following with v10.1.0 of the VS Code Prettier extension:

div {
  transition: transform 0.15s, color 0.15s;
}

Endless diffs back and forth 😬

Kapture.2023-11-18.at.19.17.45.mp4

@Stanzilla
Copy link

@ntotten what's the way forward here for a 3.0 upgrade? Any way to help?

@karlhorky
Copy link
Contributor

Oh looks like there's a new PR mentioning Prettier v3 over here:

@@ -260,7 +260,7 @@
"es5",
"all"
],
"default": "es5",
"default": "all",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sosukesuzuki, @ntotten, I realize the upgrade to v3 is currently blocked on this extension.
However, since Prettier v3 was released almost a year ago, how would you feel about proactively setting this default to all (even with the current v2 support) to be future-proof?
I'm happy to open a PR if it helps :)

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

Successfully merging this pull request may close these issues.

None yet

8 participants