3 ms·
I also use red color for global variables, helps me to detect if I forget a var or I made a typo, also I use different colors for local variables and method pa
by simion314 7y ago
I also use red color for global variables, helps me to detect if I forget a var or I made a typo, also I use different colors for local variables and method parameters.
- jobigoud 7y agoShouldn't the undefined globals be underlined by the linter already? Sorry I haven't done JS in forever, in Lua it will point out the unknown globals for me.
- evan_ 7y agoYes if you have your editor and linter configured to do so.
- simion314 7y agoNot on my configuration, maybe it is done by default but I heavily modified my settings a long time ago, though in JS globals are valid, I get a lot of underlined for spelling, unused variables, possible uninitialized variables , I am trying to fix all the warnings but with JS dynamic ways I gave up, on PHP side I mostly fix all of them by defining the types in PHP Docs, handling all exceptions etc.