<div dir="ltr">On Wed, Oct 18, 2017 at 4:51 AM Mark Banner <<a href="mailto:mbanner@mozilla.com">mbanner@mozilla.com</a>> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><blockquote type="cite">
<pre>I remember that we had bugs of this kind lurking for years in our
codebase, in code that was triggered daily and that everybody believed
to be tested.
I'd like to think that there is a better way to handle these bugs,
without waiting for them to explode in our user's face. Opening this
thread to see if we can find a way to somehow "solve" these bugs, either
by making them impossible, or by making them much easier to solve.</pre>
</blockquote></div><div text="#000000" bgcolor="#FFFFFF">
ESLint has caught some bugs - mainly undefined and unused related
issues, and is spread through most of the production javascript
code. Unfortunately it isn't able to catch this class of error. For
that, we'd need something like Flow. Last time I looked at it, it
didn't feel like a good fit for us, although I didn't go too deep,
and I think there may have been other people that were looking at
it.</div></blockquote><div><br></div><div>As a datapoint, I've looked at both Flow and TypeScript. Both are good tools that work well if you're writing code from scratch with them but for existing code they flag many many pre-existing problems, the vast majority of which aren't really problems just cases where the tools can't infer what is going on without adding type info to the script. I came to the conclusion that it would be too much work to use either in our main codebase.<br></div><div> </div></div></div>