Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
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

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

vcode settings.json

{
  "editor.codeActionsOnSave": {
    "source.organizeImports": false
  },
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

try instead of import cloneDeep from './node_modules/lodash-es/cloneDeep.js

this: import cloneDeep from 'lodash-es/cloneDeep.js

you don't need to specify node_modules absolute path and if it's es6 import you need to add an entry in package.json:

"type": "module"

are you running it in NodeJs?

edit: if the code editor deleting it then it must be from a linter/extension causing it. Probably because you set the variable as global. either check the extension config or disable it or wrap the variable declaration in a function

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda