Are there any tools out there to help programmers that REALLY want type safety and the more stringent rules of a language like c# or java with javascript?
For example, something that say analyzed source files and found things like undeclared variables or a js file of defined type objects like int or string?
You can use sonar. javascript. node. maxspace property to allow the analysis to use more memory.
In addition to JSLint, Google Closure Compiler can be used for static analysis of JS source as well, and it checks different things than JSLint too.
Neither of these tools does provide exactly what you want though.. Closure Compiler attempts type-checking if I remember correctly, but it doesn't always work (at all).
Although such features may seem desirable from the point of view of someone who's used to strictly typed languages, I often see people attempting to use JS like C#/Java/whatever go wrong on more than one level, and usually ending up with less readable and worse code in general. Of course this may not be your case, but this is just a general observation/warning to keep in mind.
My suggestion would be to embrace the "looseness" of the language, with perhaps test-driven development as a quality assistance tool (JsTestDriver).
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