We have been searching for good tools for measuring the quality of our TypeScript code. Mainly, we are interested in measuring Cyclomatic Complexity, LCOM, Instability and similar metrics. A tool for visualizing dependencies between modules would also be nice.
A sort of "NDepend for typescript" would be great - but we haven't been able to find anything like it...
Can anyone point us in the direction of any tools that provide some such functionality?
SonarQube 8.5 supports TypeScript 3.3. 1 to 3.9. x, both included.
SonarQube. SonarQube is the popular static analysis tool for continuously inspecting the code quality and security of your codebases and guiding development teams during code reviews. SonarQube is used for automated code review with CI/CD Integration.
ESLint is a static code analysis tool for identifying problematic patterns found in JavaScript code. It was created by Nicholas C. Zakas in 2013. Rules in ESLint are configurable, and customized rules can be defined and loaded.
Static analysis tools are known to produce false positives and these false positives can “outweigh” the true positives in volume [33]. Another known fact is that, especially with larger projects, the number of warnings produced by a tool can be high, sometimes in the thousands [9].
We have been searching for good tools for measuring the quality of our TypeScript code
Similar to JSHint (mentioned by Steve) for TypeScript there is TSLint https://github.com/palantir/tslint (with a grunt plugin https://github.com/palantir/grunt-tslint)
The rules aren't that complex to create yourself based on TypeScript language service ASTWalker
mechanism e.g. Indent rule : https://github.com/palantir/tslint/blob/master/src/rules/indentRule.ts
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