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

218
Vistas
How to get VS Code to show / validate object schema?
  1. npm init -y
  2. npm i axios
  3. npm i @types/axios --save-dev

How come VS code 1.62 doesn't appear to give the schema of the response object when I am typing out code like:

resp = await axios("https://httpstat.us/404");
resp. 

<C-Space> shows confusing / inappropriate completions.

What am I missing please? I tried renaming the file to typescript and that doesn't help either, so I am really confused how to edit Javascript effectively. I.e. for the editor to diagnose that I am using the wrong properties and prompt for using the right ones with documentation.

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

0

Name the file with a .ts extension and import axios with:

import axios from 'axios'

Then the following should work with full autocompletion:

async function testing() {
  const resp = await axios("https://httpstat.us/404");
  resp.status // works
}

Typescript doesn't always get the types right with the require function. import is the right way you do this in typescript.

See the docs

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