I use SonarQube (live demo) a fair bit to monitor code quality metrics, but there’s no in-built support nor published community plugins for TypeScript analysis – so I’m writing one.
I intend two core features:
- Measure code quality by running against TsLint
- Measure unit test coverage by processing an LCOV file

Running an alpha version of SonarTsPlugin against a random TypeScript project from GitHub shows code issues but no code coverage – yet
The first of those two goals isn’t that far away at all – above is a screenshot from the alpha version running locally. If you’re interested in helping, drop me an email!
Hi,
I’d be interested in helping test this – we currently don’t include the generated .js files in the project – and as we are using the vs bootstrapper plugin these .js files are not included in the analysis for javascript rules or coverage
Any chance I could get a copy of the plugin to test?
Many thanks
Richard
I know I replied to your Tweet on this but just for Google’s sake, there’s an alpha build here: http://pablissimo.com/sonarqube/sonar-typescript-plugin-0.1-SNAPSHOT.jar
In a couple weeks (when I’m back from holiday!) I’ll try to get a less-alpha build going with a newer version of TsLint so that we’re more up to date with TS versions.
Hi,
I’m wondering if you made any progress on SonarQube typescript code coverage. I’m writing this from a post from yourself dated 19 / Jan / 2015.
Thanks
Jonny
If you’re using Chutzpah (or some tool that can output LCOV) then yeah, the plugin as it stands will pull in coverage data. For Chutzpah you’ll need to use the new UseSourceMaps setting to map between your .js files and source .ts files (which will cause the LCOV to be output against the .ts files).
In your sonar properties file, add a key value pair similar to:
sonar.ts.lcov.reportpath=lcov.dat
where lcov.dat is the properties-file-relative path to the LCOV data.
Hi
Getting this error,
projects/vCoreUI/app/main.ts” “/home/arvind/projects/vApp/app/services/organisation.service.ts”
13:52:23.339 ERROR – TsLint Err: module.js:457
13:52:23.339 ERROR – TsLint Err: throw err;
13:52:23.340 ERROR – TsLint Err: ^
13:52:23.340 ERROR – TsLint Err:
13:52:23.341 ERROR – TsLint Err: Error: Cannot find module ‘/home/arvind/projects/vApp/”/usr/local/bin/tslint”‘
13:52:23.342 ERROR – TsLint Err: at Function.Module._resolveFilename (module.js:455:15)
13:52:23.342 ERROR – TsLint Err: at Function.Module._load (module.js:403:25)
13:52:23.342 ERROR – TsLint Err: at Module.runMain (module.js:590:10)
13:52:23.342 ERROR – TsLint Err: at run (bootstrap_node.js:394:7)
13:52:23.342 ERROR – TsLint Err: at startup (bootstrap_node.js:149:9)
13:52:23.342 ERROR – TsLint Err: at bootstrap_node.js:509:3
13:52:23.401 INFO – Sensor com.pablissimo.sonar.TsLintSensor (done) | time=166ms
13:52:23.401 INFO – Sensor LOCSensor
13:52:23.482 INFO – Sensor LOCSensor (done) | time=81ms
Not sure why it is not able to find the module.
It’s a known issue with 0.9, try https://github.com/Pablissimo/SonarTsPlugin/files/440852/sonar-typescript-plugin-0.92-SNAPSHOT.zip as a temporary fix?
Hey , i download the tslint jar plugin and added to extension folder still i can’t see tab of ts lint anywhere
Ps : also restarted the server