Skip to content

Releases: IanVS/prettier-plugin-sort-imports

v4.3.0

26 Jun 13:53
Compare
Choose a tag to compare

What's Changed

Features

  • Add support for import attributes by @IanVS in #174

This release adds support for experimental import attributes / assertions. There have been a number of styles proposed by TC-39 over the years, but the latest is to use import x from 'x' with { type: 'json' };, which is called an "import attribute". There is also an older "import assertion" form, which uses assert instead of with.

Note: You may need to add "importAttributes" to your "importOrderParserPlugins" option in order to support this. And if you are using the older assertion style, you'll need to add it as '[\"importAttributes\", {\"deprecatedAssertSyntax\": true}]'.

This plugin will also convert the older assertion style to import attributes.

Bugfixes

TypeScript

  • Augment Prettier Options types with internal PluginConfig by @jeremy-code in #172

You can now type your prettier config as simply /** @type {import("prettier").Config} */, and you'll also get the types for the options this plugin adds, automatically.

Docs

  • Update README to show more options for disabling and overrides by @ADTC in #165

New Contributors

Full Changelog: v4.2.1...v4.3.0

v4.2.1

17 Mar 00:31
Compare
Choose a tag to compare

What's Changed

Bugfixes

  • Detect Vue 2.7 / 3 more reliably by @IanVS in #160
  • Setting importOrder to [] should disable plugin by @IanVS in #161

Full Changelog: v4.2.0...v4.2.1

v4.2.0

13 Mar 13:24
Compare
Choose a tag to compare

What's Changed

Features

Bug fixes

Dependencies

Docs

  • Add example of sorting for built-in node types by @IanVS in #155

New Contributors

Full Changelog: v4.1.1...v4.2.0

v4.1.1

12 Oct 12:03
Compare
Choose a tag to compare

What's Changed

Fixes

Docs

  • Add plugins config to README by @IanVS in #114
  • recommend using ^react$ for sorting react to the top. by @willhoney7 in #126

Maintenance and Dependencies

New Contributors

Full Changelog: v4.1.0...v4.1.1

v4.1.0

14 Jul 16:10
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v4.0.2...v4.1.0

v4.0.2

01 Jun 17:36
Compare
Choose a tag to compare

What's Changed

Full Changelog: v4.0.1...v4.0.2

v4.0.1

30 May 19:58
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v4.0.0...v4.0.1

v4.0.0

26 May 19:46
Compare
Choose a tag to compare

What's Changed

This new release focuses on simplifying the plugin options, shipping more useful defaults, handling comments around import statements more reliably, and improving Vue and TypeScript compatibility. We also are targeting Node 16 syntax with our build, though older versions may continue to work (untested). See the full migration guide for details of the breaking changes.

⬆️ Breaking Changes

  • Build for Node 16+ (#59)
  • Remove importOrderBuiltinModulesToTop (always true) (#60)
  • Remove importOrderSeparation option (#62)
  • Remove importOrderCaseInsensitive option (#63)
  • Remove importOrderGroupNamespaceSpecifiers option (#64)
  • Remove importOrderSortSpecifiers option (#65)
  • Remove importOrderMergeDuplicateImports option (always on) (#66)
  • Replace importOrderCombineTypeAndValueImports with importOrderTypeScriptVersion (#67)
  • Improve default sort order (#83)

🐛 Bug Fixes

  • Fix behavior around comments embedded in imports (#71)
  • Preserve trailing comments on specifiers (#80)
  • Preserve comments and blank lines at top-of-file (in #82)
  • Prevent comment gap when re-arranging first import (#85)
  • Fix: Top-of-file Comments get duplicated when moving runtime code (#88)
  • Vue: Sort both script and setup script (#90)
  • Vue and TypeScript: Use correct parser plugins (#91)

⚡️ Features

  • Add <BUILTIN_MODULES> Special Word (#86)
  • Allow Explicit Separator after Top-of-file-comments (#92)
  • Support babel-ts parser (#97)

🛠️ Repo Maintenance

  • Update dependencies, jest -> vitest (#59)
  • Check formatting in CI (#61)
  • Update to latest versions of Github Actions (#73)
  • Add some more tests for comments (#77)

🧳 Dependencies

  • Drop javascript-natural-sort dependency (#28)
  • Drop lodash.clone dependency (#74)
  • Upgrade Babel to 7.21 (#72)

Full Changelog: v3.7.2...v4.0.0

v4.0.0-beta.0

22 May 02:07
Compare
Choose a tag to compare
v4.0.0-beta.0 Pre-release
Pre-release

What's Changed since 3.7.2

This new release focuses on simplifying the plugin options, shipping more useful defaults, handling comments around import statements more reliably, and improving Vue and TypeScript compatibility. We also are targeting Node 16 syntax with our build, though older versions may continue to work (untested). See the full migration guide for details of the breaking changes.

⬆️ Breaking Changes

  • Build for Node 16+ (#59)
  • Remove importOrderBuiltinModulesToTop (always true) (#60)
  • Remove importOrderSeparation option (#62)
  • Remove importOrderCaseInsensitive option (#63)
  • Remove importOrderGroupNamespaceSpecifiers option (#64)
  • Remove importOrderSortSpecifiers option (#65)
  • Remove importOrderMergeDuplicateImports option (always on) (#66)
  • Replace importOrderCombineTypeAndValueImports with importOrderTypeScriptVersion (#67)
  • Improve default sort order (#83)

🐛 Bug Fixes

  • Fix behavior around comments embedded in imports (#71)
  • Preserve trailing comments on specifiers (#80)
  • Preserve comments and blank lines at top-of-file (in #82)
  • Prevent comment gap when re-arranging first import (#85)
  • Fix: Top-of-file Comments get duplicated when moving runtime code (#88)
  • Vue: Sort both script and setup script (#90)
  • Vue and TypeScript: Use correct parser plugins (#91)

⚡️ Features

  • Add <BUILTIN_MODULES> Special Word (#86)
  • Allow Explicit Separator after Top-of-file-comments (#92)
  • Support babel-ts parser (#97)

🛠️ Repo Maintenance

  • Update dependencies, jest -> vitest (#59)
  • Check formatting in CI (#61)
  • Update to latest versions of Github Actions (#73)
  • Add some more tests for comments (#77)

🧳 Dependencies

  • Drop javascript-natural-sort dependency (#28)
  • Drop lodash.clone dependency (#74)
  • Upgrade Babel to 7.21 (#72)

What's Changed since 4.0.0-alpha.7

  • Mention <BUILTIN_MODULES> in MIGRATION.md by @IanVS in #94
  • Feature: Allow Explicit Separator after Top-of-file-comments by @fbartho in #92
  • Support babel-ts parser by @IanVS in #97

Full Changelog: v4.0.0-alpha.7...v4.0.0-beta.0

v4.0.0-alpha.7

18 May 02:38
Compare
Choose a tag to compare
v4.0.0-alpha.7 Pre-release
Pre-release

What's Changed

  • Fix: Top-of-file Comments get duplicated when moving runtime code #87 by @fbartho in #88
  • Vue: Sort both script and setup script by @IanVS in #90
  • Feature: Add <BUILTIN_MODULES> Special Word by @fbartho in #86
  • Use correct parser plugins for TS and Vue by @IanVS in #91

Full Changelog: v4.0.0-alpha.6...v4.0.0-alpha.7