From using Cloud9 I have noticed that the editor accepts $
as a global variable, but not other variables like _
:
Is there any way I can instruct the editor that it should accept the global underscore variable?
When I say "global" in this context, I mean "defined on the window object"
Looking for a way to use global variables in AutoSys to perform the following functions. 1) SQL query job obtains a value from the database and stores that value in an existing AutoSys global variable "BillID". Later in the day, different jobs use the value of the variable a parameter.
Go to Solution. 04-06-2021 06:37 PM 2\ If you want to create variables automatically, please try the following ways. (1) Use app's OnStart property. Automatically create a variable when the app is opened (2) Use screen's OnVisible property.Automatically create variables when a specific screen is visible.
The obvious solution would be to just add the comment /*global VarName*/ and be done with it, but I don't believe this is a good practice. After researching, I came across the JavaScript import functionality.
This hasn't been answered yet so I figured I'd update everyone who's landing here from Google.
It's now possible to do this without explicitly defining globals at the top of every javascript file by using an .eslintrc file at the root of your project in C9. You can see the documentation for this here on the eslint site.
For your use case, your .eslintrc file would look something like this:
{
"globals": {
"_": false
}
}
Assigning it to false
means that the linter will warn you when you try to overwrite the global. Setting it to true
would allow reassignment of the global. Javascript would allow you to do it in either case, this setting only affects the linter behaviour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With