IanVS / prettier-plugin-sort-imports

An opinionated but flexible prettier plugin to sort import statements
Apache License 2.0
951 stars 21 forks source link

Support for Prettier version 3 #109

Closed tvanantwerp closed 1 year ago

tvanantwerp commented 1 year ago

Is your feature request related to a problem? Cannot currently be used with version 3 of Prettier

npm i -D @ianvs/prettier-plugin-sort-imports
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: stripe-connect-app-embed@1.0.0
npm ERR! Found: prettier@3.0.0
npm ERR! node_modules/prettier
npm ERR!   dev prettier@"^3.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer prettier@"2.x" from @ianvs/prettier-plugin-sort-imports@4.0.2
npm ERR! node_modules/@ianvs/prettier-plugin-sort-imports
npm ERR!   dev @ianvs/prettier-plugin-sort-imports@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/tvanantwerp/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/tvanantwerp/.npm/_logs/2023-07-10T15_00_10_576Z-debug-0.log

Describe the solution you'd like Support for version 3 of Prettier.

Related issue in @trivago/prettier-plugin-sort-imports

IanVS commented 1 year ago

Thanks, I believe we actually do work with version 3, just haven't bumped the peer dependency range. Would you be willing to try installing with --legacy-peer-deps, and check that the plugin works correctly? And if so, maybe you can submit a PR that updates our peer dependency range? Thanks!

Sparticuz commented 1 year ago

Seems to work for me.

EDIT: I mean, after I installed it with --legacy-peer-deps

basselworkforce commented 1 year ago

~@IanVS I submitted a PR, not sure if you got a chance to see it~

IanVS commented 1 year ago

Thanks, but that is the trivago plugin, which I do not have any control over. I don't know if the Trivago version is compatible with Prettier 3 or not.

basselworkforce commented 1 year ago

Ah sorry my mistake, thanks

fbartho commented 1 year ago

@basselworkforce if you're motivated, could you possibly test this PR? https://github.com/IanVS/prettier-plugin-sort-imports/pull/75

I think we're ready for prettier3 with that PR!

basselworkforce commented 1 year ago

@basselworkforce if you're motivated, could you possibly test this PR? #75

I think we're ready for prettier3 with that PR!

sorry for the confusion I don't actually use this version, I use the trivago one