ER.SHASHI TIWARI
ER.SHASHI TIWARI

Reputation: 917

sonarQube is not considering the typescript files with the .ts extension

I am configuring sonarQube on jenkins with angular 2 project, but sonar is not considering the typescript files with the .ts extension .

Configuration:

sonar.projectKey=App Name- Any Identifier
sonar.projectName=Project1
sonar.projectVersion=1.0.0
sonar.projectDescription=Static analysis for the AppName
sonar.sources=path/to/code/src, path/to/code/grails-app
sonar.groovy.cobertura.reportPath=path/to/code/target/test-reports/cobertura/coverage.xml
sonar.language=grvy
sonar.sourceEncoding=UTF-8

Nothing happening, Thanks in advance for the help.

Upvotes: 0

Views: 2921

Answers (1)

Shashank Vivek
Shashank Vivek

Reputation: 17494

Yeah, because you need to specify the language as

sonar.language=ts

You sonar.properties file seems to be for groovy

Here is a sample angular project file:

sonar.language=ts
# must be unique in a given SonarQube instance
sonar.projectKey=myProj-key
# this is the name and version displayed in the SonarQube UI.
sonar.projectName=myProj-name
sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
sonar.sources=src
# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
sonar.exclusions=**/*.spec.js, **/*.spec.ts, src/test/*
sonar.projectBaseDir=D:/Personal/Learning/SonarTesting/
#sonar.ts.lcov.reportpath=D:/Personal/Learning/SonarTesting/sample-proj-extensions/coverage/lcov.info
sonar.typescript.lcov.reportPaths=coverage/lcov.info 

Upvotes: 3

Related Questions