Skip to content

Conversation

@david-crespo
Copy link
Collaborator

@david-crespo david-crespo commented Oct 31, 2023

Not very interesting, but this plugin is a better fork of the @trivago one that I've had my eye on.

Old: https://github.com/trivago/prettier-plugin-sort-imports
New: https://github.com/IanVS/prettier-plugin-sort-imports

Key differences

  • Group imports from the same package that have been put on different lines for whatever reason (my IDE does this all the time with auto-add)
  • Enforce that all type + non-type imports are the same style (most of the diff), i.e., combined
    import { abc, def, type Ghi, type Jkl } from '...'
    rather than separate
    import type { Ghi, Jkl } from '...'
    import { abc, def } from '...'
    The latter might save us a few lines by getting things on one line (well, two) more often, but I think it's meant to be a legacy format.

Neutral-to-good differences

Tried to config these away but I couldn't, and I think they're fine changes.

  • type imports sorted to end of list
  • Lower- and upper-case sorted together instead of all uppers then all lowers

Fork is catching up

It seems more actively worked on and is catching up in downloads.

https://npmtrends.com/@ianvs/prettier-plugin-sort-imports-vs-@trivago/prettier-plugin-sort-imports

image

@vercel
Copy link

vercel bot commented Oct 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Oct 31, 2023 7:14pm

@david-crespo david-crespo enabled auto-merge (squash) October 31, 2023 19:18
@david-crespo david-crespo merged commit 1a2b565 into main Oct 31, 2023
@david-crespo david-crespo deleted the switch-import-sorter branch October 31, 2023 19:29
david-crespo added a commit to oxidecomputer/omicron that referenced this pull request Nov 4, 2023
oxidecomputer/console@bd65b9d...ae8218d

* [ae8218df](oxidecomputer/console@ae8218df) bump msw to 2.0.3 for the real safari fix
* [9a3f95a9](oxidecomputer/console@9a3f95a9) reduce dev console noise about local assets not served by MSW
* [a61ecf24](oxidecomputer/console@a61ecf24) oxidecomputer/console#1809
* [50f3a5b2](oxidecomputer/console@50f3a5b2) bump recharts and react query
* [1a2b5656](oxidecomputer/console@1a2b5656) oxidecomputer/console#1808
* [4c01cd68](oxidecomputer/console@4c01cd68) oxidecomputer/console#1800
* [57cc1892](oxidecomputer/console@57cc1892) oxidecomputer/console#1802
* [47d76dbf](oxidecomputer/console@47d76dbf) oxidecomputer/console#1806
* [eee0eb2e](oxidecomputer/console@eee0eb2e) oxidecomputer/console#1805
* [60c2285e](oxidecomputer/console@60c2285e) oxidecomputer/console#1804
* [d9cf1ef1](oxidecomputer/console@d9cf1ef1) bump sort imports plugin for vuln
* [ba3a383e](oxidecomputer/console@ba3a383e) bump playwright to 1.39 (fix issue with z-index test)
david-crespo added a commit to oxidecomputer/omicron that referenced this pull request Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants