How to fix VSCode organizeImports conflict with prettier

Posted on May 2nd, 2022

Prettier extensions conflicts with the the organizeImports setting in VSCode, when organize imports on save is enabled.

organizeImports conflict with prettier

How to fix VSCode organizeImports conflict with prettier

Open VsCode: Select View > Command Palette... > Enter Preferences: Open Settings (JSON) and edit as below

"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
   "source.fixAll.eslint": true,
   "source.organizeImports": true
},
"eslint.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
],
"editor.formatOnSave": true