"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 27, 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
🌐
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%
🌐
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.
🌐
npm
npmjs.com › package › prettier-plugin-organize-imports
prettier-plugin-organize-imports - npm
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
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.
🌐
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 }
🌐
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?

🌐
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
🌐
Relatablecode
relatablecode.com › how-to-quickly-sort-imports-with-prettier
How to quickly sort imports with Prettier
This will cover mostly everything! So let’s create a .prettierrc (a prettier configuration file) at the route of our project. ... JSON{ "importOrder": ["^components/(.*)$", "^[./]"], "importOrderSeparation": true, "importOrderSortSpecifiers": true }
🌐
Haseeb Majid
haseebmajid.dev › posts › til: how to get vscode eslint to sort imports
TIL: How to Get VSCode ESLint to Sort Imports | Haseeb Majid
January 4, 2026 - { "eslint.validate": [ "javascript", "svelte", "javascriptreact", "typescript", "typescriptreact" ], "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.tabSize": 2, "editor.codeActionsOnSave": { "source.organizeImports": true, "source.fixAll": true } }, } Now this format our typescript files automatically when we save it, including organising our imports. Now this is all well and good, except when we add the following ESLint plugin ESLint-plugin-import. This plugin lets us set our own rules for how to sort plugins and how to organise them into groups.