How to set javascript ecmascript version in sonarjs?

1k views Asked by At

I am currently using sonarqube for codecovergae.Karma and jasmine as testing tool. Due to project complexity and dependency, i m using babel transpiler to convert ts to es5.

I am able to configure sonar-qube. However i am getting code smell like Replace "var" with "let" or "const". I check sonar configuration. I didnt find anything where i can set ecmascript version just like "sonar.java.source=1.6" My current configuration:

sonar.host.url=http://sonar.dev.***.com
sonar.projectKey=org.sonarqube:some-key
sonar.projectName=Project name
sonar.projectVersion=1.0
sonar.language=js
sonar.sources=temp/src
sonar.sourceEncoding=UTF-8
sonar.javascript.lcov.reportPath=coveragereports/coverage/lcov.info

Please help.

1

There are 1 answers

4
Elena Vilchik On

There is no way to set JS version in SonarJS. It parses all versions, and for rules by default only rules making sense for all versions are enabled. Probably you enabled Replace "var" with "let" or "const" manually. Just disable it in SQ UI.