3

I need to run SonarQube analysis for .jsx file . Is there any way so that we can run sonar-runner to analyse JSX file for performance issue?

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
curogal
  • 73
  • 1
  • 2
  • 5
  • I have written a tutorial on that subject : http://sylvainleroy.com/2017/05/14/SonarQube-and-ReactJS/ You may want to install another plugin to better cover JSX Files using ESLint. – Sylvain Leroy May 14 '17 at 19:41
  • @SylvainLeroy Can you look at my problem and give a suggestion: https://stackoverflow.com/questions/59419678/sonarqube-with-reactjs-false-positive-on-duplicates-and-coverage-on-new-code Thanks – JackTheKnife Dec 20 '19 at 04:49

2 Answers2

4

You can try to add:

sonar.javascript.file.suffixes=.js,.jsx

in your sonar-project.properties file. The default value is .js, so only those files will be parsed by Sonar.

dompuiu
  • 494
  • 4
  • 6
  • 1
    Hey, this works only for coverage metrics? What if I want to add sonar.testExectuionReportPath with jsx files intend to see unit tes count for project? – B.Ohara Aug 03 '18 at 06:26
3

JSX is supported by the SonarQube JavaScript plugin since version 2.12.

See SONARJS-521 for more information.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
  • OK THANKS ...I HAVE INSTALLED UPDATED VERSION OF JAVA SCRIPT 2.12 BUT STILL .JSX ISSUE IS NOT COMING. IT ONLY ANALYSIS BUNDLE.JS FILE WHICH IS PRODUCE FROM .JSX FILE . – curogal May 06 '16 at 06:26