Skip to content

Replace/remove deprecated options in Prettier 3.0#345

Closed
Frederick888 wants to merge 2 commits intoprettier:masterfrom
Frederick888:prettier-3-0
Closed

Replace/remove deprecated options in Prettier 3.0#345
Frederick888 wants to merge 2 commits intoprettier:masterfrom
Frederick888:prettier-3-0

Conversation

@Frederick888
Copy link
Copy Markdown

@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
Copy Markdown

LordPax commented Jul 12, 2023

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

@Frederick888
Copy link
Copy Markdown
Author

Frederick888 commented Jul 12, 2023 via email

@nerfologist
Copy link
Copy Markdown

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
Copy Markdown
Author

Frederick888 commented Jul 13, 2023 via email

@adnan007d
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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

@mitermayer
Copy link
Copy Markdown
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