Releases: IanVS/prettier-plugin-sort-imports
v4.7.0
What's Changed
This project began as a fork because I wanted a plugin that would not move side-effect imports around and mess with my CSS cascade. So its first and most distinguishing feature is that side-effect imports do not move, and other imports are not sorted across them.
This works fine in most cases, but some people have side-effect imports that they know can be sorted safely. For those, there is now an "escape hatch" option named importOrderSafeSideEffects
. It is an array of glob pattern strings (similar to importOrder
) which, when they match against a side-effect import, allow that import to be sorted as if it were a standard import.
Suggestions for safe use:
- Use
^
at the start of your pattern and$
at the end, to avoid accidentally matching part of an import name. For example,"^server-only$"
, to avoid matching againstimport "not-server-only"
. - Use extreme caution if matching against relative files or CSS files. If you decide to sort CSS imports and a file ever imports more than one CSS file, your cascade may change.
- You can still use
// prettier-ignore
to stop sorting a particular import that would otherwise be sorted.
Feedback on this feature is welcome.
Features
Internal
Full Changelog: v4.6.3...v4.7.0
v4.6.3
4.6.2
v4.6.1
v4.6.0
v4.5.1
v4.5.0
v4.4.2
v4.4.1
What's Changed
- fix: catch babel parse errors by @michaelfaith in #198
New Contributors
- @michaelfaith made their first contribution in #198
Full Changelog: v4.4.0...v4.4.1
v4.4.0
What's Changed
Enhancements
- Re-add
importOrderCaseSensitive
option for case-sensitive sorting by @acnebs in #184 - Throw an error when no matching sortOrder group by @IanVS in #192
Maintenance
- Switch from yarn to pnpm by @IanVS in #178
- Remove unused @babel/core, update babel deps by @IanVS in #191
New Contributors
- @acnebs made their first contribution in #184
Full Changelog: v4.3.1...v4.4.0