Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

187
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!