Skip to content

Ianvs prettier plugin sort imports#122

Merged
thecrypticace merged 7 commits intotailwindlabs:mainfrom
j:ianvs-prettier-plugin-sort-imports
Feb 10, 2023
Merged

Ianvs prettier plugin sort imports#122
thecrypticace merged 7 commits intotailwindlabs:mainfrom
j:ianvs-prettier-plugin-sort-imports

Conversation

@j
Copy link
Copy Markdown
Contributor

@j j commented Feb 9, 2023

I edited this in GH so commits aren't squashed, but yolo.

@ianvs/prettier-plugin-sort-imports fork has been better and preserves order of side-effect imports.

@thecrypticace thecrypticace self-assigned this Feb 10, 2023
@thecrypticace
Copy link
Copy Markdown
Contributor

Will take a look at this soon. It doesn't appear to work in the tests so there might be something else going on or the test needs to be tweaked for this plugin.

@j
Copy link
Copy Markdown
Contributor Author

j commented Feb 10, 2023

Will take a look at this soon. It doesn't appear to work in the tests so there might be something else going on or the test needs to be tweaked for this plugin.

Awesome. Yeah, normally I would have contributed to this on my machine but I've been away for a while and busy with various things. I don't think I'll have time to fix it any time soon.

To be honest, it sort of bugs me when someone forks something to add their feature then keep adding to it without contributing to the original fork. :(. But it does have a feature that is really important for a lot of people. We use side-effect imports at a top level to prepare environment variables, etc. Most use it for polyfils, etc, so it should really exist in the original sorting plugin.

Thanks for taking a look at it.

@thecrypticace thecrypticace merged commit f9b249b into tailwindlabs:main Feb 10, 2023
@thecrypticace
Copy link
Copy Markdown
Contributor

Alright I figured out what was wrong there. We were testing using import "./foo" which is a side-effect import ovbs so I tweaked the tests to account for that. Thanks!

@j
Copy link
Copy Markdown
Contributor Author

j commented Feb 10, 2023

Haha, that makes sense. Well this is awesome to see. Thanks so much.

Cheers!

@IanVS
Copy link
Copy Markdown

IanVS commented May 18, 2023

To be honest, it sort of bugs me when someone forks something to add their feature then keep adding to it without contributing to the original fork.

@thecrypticace I would normally agree. However, the trivago plugin is barely maintained, so improving it was not really possible. By working on the fork, we can keep pushing forward and give people options of which one to use.

Glad you've found it useful! We're about to release a breaking change to simplify options and improve defaults. Would love if you were willing to try it out by installing it with @next. And please submit any questions or issues you come across.

bronisMateusz pushed a commit to bronisMateusz/prettier-plugin-tailwindcss-drupal that referenced this pull request Apr 16, 2025
* Add "@ianvs/prettier-plugin-sort-imports" to list of compatible plugins

* add "@ianvs/prettier-plugin-sort-imports" to readme

* Update dependencies

* Add test

* Update test

* Fix existing changelog entry

* Update changelog

---------

Co-authored-by: Jordan Pittman <[email protected]>
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.

3 participants