How to disable Typescript warning for return statements

Viewed 1960

I'd like to disable this warning for Typescript, since I am creating scripts that may have return value outside of a function body:

enter image description here

Better example on github gist

The compiled script will be used by a system called DOCUMENTS which you probably haven't heard of. This system has it's own javascript engine based on Firefox's engine. In this custom engine, you may have script returns which will cause certain actions (showing a result, an error or a file download). Basically: The environment I use my transpiled .ts files in may have such return statements outside of functions.

1 Answers
Related