prettier / vim-prettier

A Vim plugin for Prettier
MIT License
1.78k stars 138 forks source link

Replace/remove deprecated options in Prettier 3.0 #345

Closed Frederick888 closed 1 year ago

Frederick888 commented 1 year ago

Summary

Test Plan

  1. Open a yaml file
  2. Format the file

Using current master branch (5e6cca21e12587c02e32a06bf423519eb1e9f1b2) 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.

LordPax commented 1 year ago

hi, can you remove jsx-bracket-same-line ? for more information check this issue https://github.com/prettier/vim-prettier/issues/344

Frederick888 commented 1 year ago

hi, can you fix |jsx-bracket-same-line| ?

Based on my tests only unknown arguments needed to be removed to get rid of the warning lines. Given the state of the project, it's probably better to keep PRs as small as possible.

On 12/7/23 20:05, Teddy Gauthier wrote:

hi, can you fix |jsx-bracket-same-line| ? for more information check this issue #344 https://github.com/prettier/vim-prettier/issues/344

— Reply to this email directly, view it on GitHub https://github.com/prettier/vim-prettier/pull/345#issuecomment-1632220231, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCMP76AWXPAO7EBTQDSIK3XPZZGZANCNFSM6AAAAAA2BEWLFQ. You are receiving this because you authored the thread.Message ID: @.***>

-- Frederick Zhang

PGP: 8BFB EA5B 4C44 BFAC C8EC 5F93 1F92 8BE6 0D8B C11D

nerfologist commented 1 year ago

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 commented 1 year ago

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)?

To be honest I didn't notice that this project hadn't been updated for so long when I submitted the PR. If the maintainers can review and merge, I'd be happy to do that. It should be just a matter of adding a global option which uses 'prettier --version' by default. For now though it's good enough for myself since I already use Prettier 3.0 everywhere.

On 13/7/23 19:30, Marco Arduini wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/prettier/vim-prettier/pull/345#issuecomment-1633894044, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCMP72KEBQSBSENW26XF4TXP6543ANCNFSM6AAAAAA2BEWLFQ. You are receiving this because you authored the thread.Message ID: @.***>

-- Frederick Zhang

PGP: 8BFB EA5B 4C44 BFAC C8EC 5F93 1F92 8BE6 0D8B C11D

adnan007d commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

mitermayer commented 1 year ago

This was addressed on https://github.com/prettier/vim-prettier/pull/348 if not please feel free to reopen this PR