In this article, I will present you two new SonarQube plugins that you will never find on SonarQube marketplace (for some good reasons).
AngularJS 2, TypeScript training
Check the training.
Recently, I received a AngularJS 2 + TypeScript training course in Serial SA. The training has been performed by the NinjaSquad. The course and these guys are really great and I can recommend with configence that everyone should take that training.
However that is no the subject of this post.
At least up to SonarQube version 6.0 (a quite recent one), AngularJS2 and TypeScript are not supported.
Plugin for TypeScript / AngularJS2
Download the plugin.
I found on Github a plugin made by Pablissimo, a great guy with a lot of courage.
He built a SonarQube plugin for TypeScript and it worked well 🙂
The plugin can be downloaded on GitHub here. Copy it in your SonarPlugin
plugins folder and everything should be fine.
Notice : This SonarPlugin is relying on the tool
tslintand its configuration. If you want to enable the TypeScript analysis with SonarQube, don’t forget to do in your project :
npm install -g tslint tslint --init
Download the plugin.
I decided to make a fork of the previous plugin made by Pablissimo and to build a version for ESLint.
- Angular – Linting rules to adhere to the John Papa’s Angular Styleguide
- Backbone – Linting rules for Backbone
- Ember – Linting rules for Ember
- Jasmine – Linting rules for Jasmine
- React – Linting rules for React and JSX
- React Native – React Native specific linting rules
- RequireJS – Linting rules for RequireJS
The same way than above, you will need to initialize ESLint if you did not already have it :
npm install --save-dev eslint npm install --save-dev eslint-plugin-angular npm install --save-dev eslint-config-angular estlint --init
My Sonar plugin is also using an external linter (ESLint) to add more functionalities to SonarQube. If you are developing in the previous frameworks, let’s use it and give me feedback.
And once SonarQube has developed the right set of rules that you need, switch on the standard SonarQube analyzer.