As an example, take a look at our analysis results for angular. Apart from a few semantic gotchas like this one and copy-paste mishaps like this one, we are particularly pleased to see that LGTM flags a type error that appears to have eluded the TypeScript compiler. Let's consider this condition:
if (expr != null && assignExpr != null)
At this point in the program, variable
assignExpr is guaranteed to contain a Boolean value (
assignExpr != null always comes out
true. While it's hard to tell whether this could cause any bugs in practice, it's unlikely to be intentional and certainly worth investigating.
So, go ahead, take a look at the results for your favorite TypeScript projects. Add any projects that aren't on LGTM yet, and let us know if you spot any dubious alerts, or have any ideas for a TypeScript-specific query you'd like to see!
Note: Post originally published on LGTM.com on January 26, 2018