Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube: Integrate ESLint for JavaScript in SonarQube?

We have determined our rules, which should be used for JavaScript code, with ESLint. Now we want to integrate ESLint to SonarQube as we did it before the same way with Checkstyle for JavaCode.

Under the following link it is described why SonarQube doesn't want to provide a plugin for ESLint: http://www.sonarqube.org/sonarqube-javascript-plugin-why-compete-with-jslint-and-jshint/

Is there still no plugin fir ESLint in SonarQube? Isn't this part of a marketing strategy? There is also a plugin for Checkstyle, FindBugs etc... Why does SonarQube suddenly stop to support the integration of other code analysing tools?

like image 880
Stelos10 Avatar asked Sep 11 '15 08:09

Stelos10


People also ask

How do you integrate ESLint with SonarQube?

Now in order to import the ESLint issues into SonarQube scanner, first you need to run the lint and write the output into a file. The file should be a JSON file in order to SonarQube to accept it. After that in the sonar-project.

Can we use SonarQube for JavaScript?

You can use sonar. javascript. node. maxspace property to allow the analysis to use more memory.

Does SonarQube support TypeScript?

SonarQube 8.5 supports TypeScript 3.3. 1 to 3.9. x, both included.

What is the difference between SonarQube and ESLint?

Developers describe ESLint as "The fully pluggable JavaScript code quality tool". A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease. On the other hand, SonarQube is detailed as "Continuous Code Quality".


2 Answers

Yes, there is still no plugin for ESLint, and this is part of the strategy, but in the other direction.

In fact, our first plugins were for external analyzers, and over time we realized that simply aggregating other tools' results didn't truly serve the community because that community was coming to us with rule bugs, requests and suggestions for improvement - and all we could do was refer them on the tools' makers.

So we started writing our own rules instead for better responsiveness and, we believe, enhanced accuracy.

I urge you to take the rules you feel are missing to the SonarQube Google Group

Edit The strategy has come full circle. SonarJS now imports ESLint reports.

like image 99
G. Ann - SonarSource Team Avatar answered Sep 28 '22 20:09

G. Ann - SonarSource Team


I have not tried it yet, but I've just discovered this plugin that seems to be very promising for any front end project:

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

It may worth giving a try

like image 21
Carlos Melo Avatar answered Sep 28 '22 20:09

Carlos Melo