Search code examples
javascriptvisual-studio-codeimportprettier

How i can fix js import auto-hide problem in vs code


Firstly, I imported something from another module in js:

import cloneDeep  from './node_modules/lodash-es/cloneDeep.js'

But when I am not using this cloneDeep in my code and save my script file, then VS Code automatically hides that line.

Before Save

Before Save

After Save

After Save


Solution

  • vcode settings.json

    {
      "editor.codeActionsOnSave": {
        "source.organizeImports": false
      },
    }