Skip to content

Releases: IanVS/prettier-plugin-sort-imports

v4.7.1

Choose a tag to compare

@IanVS IanVS released this 04 Feb 12:46

What's Changed

Fixes

  • Fix: Vue preprocessor: Support variations in block syntax by @ccondrup in #247

Dependencies

Docs

  • Add note for how to specify subpath import regex to README by @jasikpark in #243

New Contributors

Full Changelog: v4.7.0...v4.7.1

v4.7.0

Choose a tag to compare

@IanVS IanVS released this 28 Aug 11:56

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

Choose a tag to compare

@IanVS IanVS released this 27 Aug 14:10

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

Choose a tag to compare

@IanVS IanVS released this 13 Aug 14:53

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

Choose a tag to compare

@IanVS IanVS released this 08 Aug 14:04

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

Choose a tag to compare

@IanVS IanVS released this 06 Aug 13:52

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

Choose a tag to compare

@IanVS IanVS released this 10 Jul 14:29

What's Changed

Fixes

Internal

  • Upgrade development dependencies by @IanVS in #223

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

v4.5.0

Choose a tag to compare

@IanVS IanVS released this 10 Jul 12:33

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

Choose a tag to compare

@IanVS IanVS released this 28 May 19:46

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

Choose a tag to compare

@IanVS IanVS released this 13 Jan 14:22

What's Changed

New Contributors

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