Skip to content

Releases: IanVS/prettier-plugin-sort-imports

v4.7.0

28 Aug 11:56
Compare
Choose a tag to compare

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 against import "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

  • Add importOrderSafeSideEffects option by @IanVS in #240

Internal

  • Clean up options & remove explicit function types by @IanVS in #239

Full Changelog: v4.6.3...v4.7.0

v4.6.3

27 Aug 14:10
Compare
Choose a tag to compare

What's Changed

  • Revert "fix: conditionally register ember and oxc parsers when depend… by @IanVS in #237

Full Changelog: 4.6.2...v4.6.3

4.6.2

13 Aug 14:53
Compare
Choose a tag to compare

What's Changed

  • fix: conditionally register ember and oxc parsers when dependencies available by @jahands in #234

New Contributors

Full Changelog: v4.6.1...4.6.2

v4.6.1

08 Aug 14:04
Compare
Choose a tag to compare

What's Changed

  • Do not warn for markdown code blocks by @IanVS in #232

Full Changelog: v4.6.0...v4.6.1

v4.6.0

06 Aug 13:52
Compare
Choose a tag to compare

What's Changed

  • Be more tolerant of babel parse errors by @IanVS in #230
  • Add support for ember template tags by @IanVS in #231

Full Changelog: v4.5.1...v4.6.0

v4.5.1

10 Jul 14:29
Compare
Choose a tag to compare

What's Changed

Fixes

Internal

  • Upgrade development dependencies by @IanVS in #223

Full Changelog: v4.5.0...v4.5.1

v4.5.0

10 Jul 12:33
Compare
Choose a tag to compare

What's Changed

  • Add @prettier/plugin-oxc support by @Marsup in #221
  • Print full stacktrace when babel parsing errors are encountered

New Contributors

Full Changelog: v4.4.2...v4.5.0

v4.4.2

28 May 19:46
Compare
Choose a tag to compare

What's Changed

  • Update peerDeps to allow prettier v4. by @cpojer in #210
  • [Internal] Update prettier dev dependency to 4.0 alpha by @IanVS in #211

New Contributors

Full Changelog: v4.4.1...v4.4.2

v4.4.1

13 Jan 14:22
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v4.4.0...v4.4.1

v4.4.0

06 Nov 20:09
Compare
Choose a tag to compare

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