Releases: IanVS/prettier-plugin-sort-imports
v4.7.1
What's Changed
Fixes
Dependencies
Docs
- Add note for how to specify subpath import regex to README by @jasikpark in #243
New Contributors
- @jasikpark made their first contribution in #243
- @ccondrup made their first contribution in #247
- @CHC383 made their first contribution in #249
Full Changelog: v4.7.0...v4.7.1
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-ignoreto 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