groupe-sii / sonar-web-frontend-plugin

Sonar plugin to add metrics for web technologies (JS, CSS, HTML, SASS, AngularJS...)
Apache License 2.0
115 stars 26 forks source link

Customiezd eslint-rules in SonarQube #35

Open ergovia-devs opened 8 years ago

ergovia-devs commented 8 years ago

Hey, I'm trying to use this plugin to display our customized eslint-ruleset on our sonarqube-server@4.5.7. We're using sonar-web-frontend-plugin@2.1.0 and I strictly followed your documentation to set it up. I installed the plugin on the server, configured the gulp-task in my project, set up my eslintrc and linked it to the sonar-web-reporter, created a sonar-porject.properties-File with sonar.sii.quality.js.eslint.report.path to "reports/sonar/eslint.json" and finally started the "lint" task. The generated result looks fine so I started the sonar-runner@2.4 and it says that the execution was successful but when I login into SonarQube-Server, I can see my project but it doesn't show me any violations. The report, the gulp task generated, shows me round about 300. SonarQube doesn't use my local .eslintrc, I guess...

So, my question No.1 is : is it even possible to let SonarQube use my custom .eslintrc to display violations ? What am I missing ? This leads me to question No.2 : If it's not, how is it possible to configure the rule-options for eslint in SonarQube (like "no-unused-vars" : [1, { "vars": "all", "args": "after-used" }]).

Thanks in advance

cedric-legallo commented 7 years ago

Sonar will not use your .eslintrc, but as long as your json report is tuned, your errors will show in sonar (only the criticity might change) RuleSets are handled in sonar GUI, customisation can be done there

The fact that your sonar project does not appear seems to me that you did not launch the sonar task. After the gulp task has been succesful, you have to launch a sonar-runner (by jenkins or directly) to communicate the results to sonar (reading the sonar-project.properties file)