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

189
Vistas
Define context of JS script in IntelliJ IDEA/WebStorm

I use IntelliJ to write JS scripts that are executed in an environment where several context variables are set implicitly, e.g. embeddingPage.
But IntelliJ does not know about the context so it marks these variables as unknown:

Unresolved variable or type embeddingPage

Additionally the script execution requires to return a config object at the end that the IDE complains about:

'return' outside function definition

Is there a way to make the context known to the IDE without breaking the execution of the script?

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

0

You can let the IDE know about your implicitly set variables by adding JSDoc annotations somewhere in your code. The @name tag seems to be the best choice as it is typically used in "virtual comments" for symbols that are not readily visible in the code, such as methods that are generated at runtime.

As for "'return' outside function definition" error, I can only suggest disabling the JavaScript and TypeScript | General | ECMAScript specification is not followed inspection or suppressing it for statement using // noinspection JSAnnotator

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