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

Replace/remove deprecated options in Prettier 3.0 #345

Closed
wants to merge 2 commits into from

Conversation

Frederick888
Copy link

@Frederick888 Frederick888 commented Jul 7, 2023

Summary

  • fix: Update --loglevel to --log-level (Pretter 3.0)
  • fix: Remove --stdin (Pretter 3.0)

Test Plan

  1. Open a yaml file
  2. Format the file

Using current master branch (5e6cca2) it shows

[warn] --jsx-bracket-same-line is deprecated.
[warn] Ignored unknown option --loglevel=error. Did you mean --log-level?
[warn] Ignored unknown option --stdin.

...at the top of the file.

@Frederick888 Frederick888 marked this pull request as ready for review July 7, 2023 01:08
@LordPax
Copy link

LordPax commented Jul 12, 2023

hi, can you remove jsx-bracket-same-line ? for more information check this issue #344

@Frederick888
Copy link
Author

Frederick888 commented Jul 12, 2023 via email

@nerfologist
Copy link

Hey, this works fine for Prettier 3 🙏 , but now if I run :Prettier on a project that still has Prettier 2 I get the following warning added to the top of the file

[warn] Ignored unknown option --log-level=error. Did you mean --loglevel?

Do you think it would involve much effort to support both 2.x and 3.x versions at the same time (using different CLI arguments)? My guess is that many bigger projects might not have been migrated to Prettier 3 yet.

@Frederick888
Copy link
Author

Frederick888 commented Jul 13, 2023 via email

@adnan007d
Copy link

Hey, this works fine for Prettier 3 pray , but now if I run :Prettier on a project that still has Prettier 2 I get the following warning added to the top of the file

[warn] Ignored unknown option --log-level=error. Did you mean --loglevel?

Do you think it would involve much effort to support both 2.x and 3.x versions at the same time (using different CLI arguments)? My guess is that many bigger projects might not have been migrated to Prettier 3 yet.

I created a fork that works well with prettier 2 and 3
I am just executing prettier -v to check the version and conditionally adding the options code

Open to suggestions if there is a better way to do it

@mitermayer
Copy link
Member

mitermayer commented Sep 25, 2023

Hi folks,

Thanks for the PR. Will investigate on how we can add support for prettier 3.x while keeping support for 2.x and comment back in here

@gregorywaynepower
Copy link

@mitermayer Thank you for the update. I was worried this had flown under the radar.

@mitermayer
Copy link
Member

This was addressed on #348 if not please feel free to reopen this PR

@mitermayer mitermayer closed this Oct 10, 2023
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.

6 participants