Prettier Plugin Organize Imports Versions Save

Make Prettier organize your imports using the TypeScript language service API.

v3.2.4

5 months ago

v3.2.3

5 months ago

Just readme updates to explain compatibility with Prettier 3. Also bumped TypeScript to v5 as a dev dependency to ensure compatibility.

v3.2.2

1 year ago

Fixes a performance regression introduced in 3.2.0 (see #90).

v3.2.1

1 year ago

This version fixes the implementation of the language service host's getCurrentDirectory method to return the directory containing the tsconfig, rather than using ts.sys.getCurrentDirectory (which returns process.cwd()). This should prevent issues with resolving compiler plugins with Volar (which is used for Vue support).

Hopefully it doesn't break anything else 🤞 I don't think the tsconfig location is always the project root because of nested/extended tsconfigs, but it should be good enough for module resolution. If someone knows a better way of finding a project's root via the TypeScript API please let me know 🙏

v3.2.0

1 year ago

This version adds and fixes support for pug templates in Vue files (via @volar/vue-language-plugin-pug). Please be aware that you'll need to update your version of the @volar/vue-typescript peer dependency from 0.x to 1.x.

v3.1.1

1 year ago
  • fix: path comparison on Windows
  • fix: bump @volar/vue-typescript peer dependency to higher version which fixes removal of imports used in the template only

v3.1.0

1 year ago

New Feature: Skip Destructive Code Actions

If you don't want destructive code actions (like removing unused imports), you can enable the option organizeImportsSkipDestructiveCodeActions via your Prettier config.

// prettierrc.js

module.exports = {
  // ...
  organizeImportsSkipDestructiveCodeActions: true,
};

v3.0.3

1 year ago

Fixes a performance regression that was introduced in 3.0.2.

v3.0.2

1 year ago

This version fixes a regression introduced by adding some file-system related methods (fileExists and readFile) to the language service host (to fix #63), which revealed that the implementation of getScriptSnapshot was incorrect.

v3.0.1

1 year ago
  • @volar/vue-typescript is now an optional peer dependency and requires version 0.39.0 or later. This should fix a couple of issues, e.g. not removing imports anymore when a component was used in the template via kebab-case.
  • The language service host now implements fileExists and readFile which should fix some issues with NodeNext module resolution.