[英]How to set javascript ecmascript version in sonarjs?
I am currently using sonarqube for codecovergae.Karma and jasmine as testing tool. 我目前正在将sonarqube用于codecovergae.Karma和茉莉花作为测试工具。 Due to project complexity and dependency, im using babel transpiler to convert ts to es5. 由于项目的复杂性和依赖性,我使用babel transpiler将ts转换为es5。
I am able to configure sonar-qube. 我能够配置sonar-qube。 However i am getting code smell like Replace "var" with "let" or "const" . 但是我得到代码气味,如用“ let”或“ const”替换“ var” 。 I check sonar configuration. 我检查声纳配置。 I didnt find anything where i can set ecmascript version just like "sonar.java.source=1.6" My current configuration: 我没有找到可以设置ecmascript版本的任何内容,就像“ sonar.java.source = 1.6”我的当前配置:
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. 请帮忙。
There is no way to set JS version in SonarJS. 无法在SonarJS中设置JS版本。 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. 可能您已启用手动Replace "var" with "let" or "const"
。 Just disable it in SQ UI. 只需在SQ UI中将其禁用即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.