How to add JSHint or ESLint or TSLint to Sonar qub

2020-04-12 10:29发布

问题:

Is there any option to add JSHint or ESLint or TSLint to SonarQube? If it is there, could you please provide the step by step procedure.

Thanks, Siva Ramanjaneyulu

回答1:

Check this out: https://github.com/groupe-sii/sonar-web-frontend-plugin

Plugin for Sonarqube for the Web world with various technologies and languages (JavaScript, CSS, SASS, HTML, AngularJS...). This plugin consumes reports generated by tools that are heavily used by the Web community:

Linters:
JSHint
CSS Lint
SCSS Lint
HTMLHint
Angular Hint
ESLint plugin for AngularJS

Unit testing
Jasmine

Code coverage:
Istanbul

Code duplication
Simian
CPD

Code complexity
Plato

Seems promising... :)



回答2:

I have built a SonarPlugin for EsLint that supports AngularJs available on https://github.com/sleroy/SonarEsLintPlugin

I don't think SonarQube will allow it on the Marketplace therefore you will have to install it manually.



回答3:

List of available plugins is here.

You can use a JavaScript Plugin to check JavaScript code.

You can also create your own plugin which execute JSHint, ESLint or TSLint.