"editor.codeActionsOnSave": {
  "source.fixAll": "explicit",
   // "source.sortImports": "explicit"
},

I have right now the same issue, I've solved it by commenting the source.sortImports property in my VSCode Open User settings file (Command+P -> >Open User Settings)

I beleive it will help you!

Answer from Sergei on Stack Overflow
๐ŸŒ
Reddit
reddit.com โ€บ r/vscode โ€บ sorting import statements in vs code with prettier
r/vscode on Reddit: Sorting Import statements in VS Code with Prettier
July 21, 2022 -

Here's one of the videos I made that helped many people with automatic sorting import statements in VS Code using Prettier. I hope it helps people around here as well.

Do let me know some feedback ๐Ÿ™‚

https://youtu.be/QQWgN0_gUxI

๐ŸŒ
DEV Community
dev.to โ€บ josephciullo โ€บ how-to-customize-import-sorting-in-javascript-with-prettier-and-regex-1h8j
Customizing JavaScript Import Sorting in VSCode Using Prettier (and Regex) - DEV Community
January 20, 2024 - In collaborative software development environments, where effective teamwork and code consistency hold utmost importance, maintaining well-organized and structured import statements becomes a fundamental requirement. This plays a pivotal role in ensuring a smooth development process and the creation of high-quality code. npm i prettier @trivago/prettier-plugin-sort-imports -D
Discussions

prettier - How to sort import in VSCode by using eslint-plugin-simple-import-sort? - Stack Overflow
Is it possible to sort imports (by using eslint-plugin-simple-import-sort) after applying Format Document (Shift+Alt+F) in Visual Studio Code? Currently, it works only after running eslint --fix, ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
typescript - VSCode, Prettier and TSLint: formatOnSafe messes up auto sort of imports - Stack Overflow
I'm building React apps with TypeScript. My editor is VSCode. I use prettier and TSLint to keep my code clean. Since a couple of projects when I hit safe prettier messes up the auto sort of import... More on stackoverflow.com
๐ŸŒ stackoverflow.com
October 12, 2020
typescript - VS-Code: How to sort imports in specific order to go along with InteliJ - Stack Overflow
The above packages fix the problem if you are using prettier. ... Sign up to request clarification or add additional context in comments. ... You can install a vs-code extension sort-imports to achieve the sorting of imports. ... As I stated in my question my colleagues do not use VSCode, so a ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to automatically sort imports in VS Code?
I use prettier-plugin-organize-imports https://www.npmjs.com/package/prettier-plugin-organize-imports More on reddit.com
๐ŸŒ r/vuejs
6
11
March 10, 2025
๐ŸŒ
Medium
medium.com โ€บ dooboolab โ€บ using-eslint-prettier-and-sort-imports-vscode-extensions-for-formatting-open-source-project-16edf317129d
Using eslint, prettier and sort-imports vscode extensions for formatting Open Source Projectโ€ฆ
November 19, 2019 - Format and sort imports all at once! ... prettier extension settings moved into .prettierrc.js as using it inside of .vscode/settings.json has deprecated
๐ŸŒ
GitHub
github.com โ€บ trivago โ€บ prettier-plugin-sort-imports
GitHub - trivago/prettier-plugin-sort-imports: A prettier plugin to sort imports in typescript and javascript files by the provided RegEx order. ยท GitHub
A prettier plugin to sort import declarations by provided Regular Expression order.
Starred by 3.9K users
Forked by 158 users
Languages ย  TypeScript 81.4% | JavaScript 11.0% | Svelte 4.3% | Vue 3.3%
๐ŸŒ
npm
npmjs.com โ€บ package โ€บ prettier-plugin-organize-imports
prettier-plugin-organize-imports - npm
September 18, 2025 - This plugin acts outside of Prettier's scope because "Prettier only prints code. It does not transform it.", and technically sorting is a code transformation because it changes the AST (this plugin even removes code, i. e. unused imports).
      ยป npm install prettier-plugin-organize-imports
    
Published ย  Sep 18, 2025
Version ย  4.3.0
Author ย  Simon Haenisch
๐ŸŒ
Genicsblog
genicsblog.com โ€บ usman โ€บ how-to-sort-imports-for-a-javascript-project-using-prettier
How to sort imports for a JavaScript Project using Prettier
March 29, 2022 - This post is about how you can sort import statements in your JavaScript projects easily with Prettier in VS Code when you format the code.
Find elsewhere
๐ŸŒ
Visual Studio Marketplace
marketplace.visualstudio.com โ€บ items
JS/TS Import/Export Sorter - Visual Studio Marketplace
Extension for Visual Studio Code - Auto format imports and exports for JavaScript and TypeScript.
๐ŸŒ
YouTube
youtube.com โ€บ watch
Sort imports using Prettier in a JavaScript Project inside VS Code! - YouTube
Hello, my friends and fellow developers!In this video, we cover how you can setup Prettier to format your imports automatically!Let me know in the comments b...
Published ย  March 21, 2022
๐ŸŒ
DevDojo
devdojo.com โ€บ post โ€บ usmanwrites โ€บ sort-imports-using-prettier-in-a-javascript-project-inside-vs-code
๐ŸŽจ Sort imports using Prettier in a JavaScript Project inside VS Code! - DevDojo
March 27, 2022 - ๐Ÿ‘‹ Hey developers! This post is about how you can sort import statements in your JavaScript/TypeScript/React/Node etc projects easily with Prettier in VS Code when you format the code.
๐ŸŒ
Reddit
reddit.com โ€บ r/vuejs โ€บ how to automatically sort imports in vs code?
r/vuejs on Reddit: How to automatically sort imports in VS Code?
March 10, 2025 -

Looking at this GitHub comment, it seems like I should be able to add "editor.codeActionsOnSave": { "source.organizeImports": true } to .vscode/settings.json and have it "just work", but in my testing that doesn't work. How do you handle automatic import sorting for .vue files in Visual Studio Code?

๐ŸŒ
Medium
giuseppeciullo.medium.com โ€บ customizing-javascript-import-sorting-in-vscode-using-prettier-and-regex-2ebf3e539b14
Customizing JavaScript Import Sorting in VSCode Using Prettier (and Regex) | by Giuseppe Ciullo | Medium
January 20, 2024 - @trivago/prettier-plugin-sort-imports: By incorporating this package, we gain the capability to leverage Prettier for not only code formatting but also the systematic arrangement of import statements.
๐ŸŒ
DEV Community
dev.to โ€บ bornfightcompany โ€บ easily-sort-imports-and-remove-unused-declarations-on-each-save-in-vs-code-35k1
Easily sort imports and remove unused declarations on each save in VS Code - DEV Community
May 8, 2021 - Of course, Iโ€™m assuming you already have ESLint and Prettier VS Code extensions because they are a must have for any JavaScript project. Just add the following to your VS Code settings.json: ... "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll": true, "source.organizeImports": true, "source.sortMembers": true }
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 76127977 โ€บ prettier-plugin-sort-imports-ignores-import-order
node.js - prettier-plugin-sort-imports ignores import order - Stack Overflow
6 Prettier next (2.6.0) + import order plugin @trivago/prettier-plugin-sort-imports Error Ignored unknown option { importOrderSeparation: true } 139 VSCode prettier adds `value` to imports in TypeScript React ยท 4 How to have prettier format imports on multiple lines ยท
๐ŸŒ
GitHub
github.com โ€บ prettier โ€บ prettier-vscode โ€บ issues โ€บ 716
Plugin has a conflict with the built-in organize imports ยท Issue #716 ยท prettier/prettier-vscode
February 9, 2019 - prettier: "prettier": "^1.16.4", (was initially on 1.13.7, tried to update) vscode: Version 1.31.0 (1.31.0) extension: 1.8.0 ยท I first opened a ticket with vscode core, but was referred to the extension as the source of the problem: microsoft/vscode#68193 ยท Add setting for editor.codeActionsOnSave.source.organizeImports = true (see below for example json) ... create a ts file (may also work with js) that has an import that exceeds the configured line length, which should be turned into a multi-line import
Author ย  paustint