Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

188
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda