sonarqube typescript plugin: “You must install a plugin that supports the language”

前端 未结 2 2027
别那么骄傲
别那么骄傲 2021-02-04 10:43

I\'m trying to setup SonarQube to analyse my TypeScript project using this plugin: https://github.com/Pablissimo/SonarTsPlugin

However, I\'m encountering an error like:<

相关标签:
2条回答
  • 2021-02-04 10:53

    Here are the Possible sonar.language values

     C# => "cs"
     CSS => "css"
     SCSS => "scss"
     Less => "less"
     Java => "java"
     Web => "web"
     XML => "xml"
     JSON => "json"
     JavaScript => "js"
    

    Install the required plugin and run the Scanner using -X switch, you can find the necessary values in the sonar logs.

    0 讨论(0)
  • 2021-02-04 11:04

    Okay, I figured out how to solve this specific problem. The key sonar.language in my sonar-project.properties should be set to ts, not typescript.

    # Language
    sonar.language=ts
    

    I figured this out by looking at example project corresponding to the javascript plugin: https://github.com/SonarSource/sonar-examples/blob/master/projects/languages/javascript/javascript-sonar-runner/sonar-project.properties. Here, the language is set to js not javascript.

    I have to guess that, in general, the language key should be set to the normal file extension for source files? i.e. Java -> .java, JavaScript -> .js, TypeScript -> .ts ... If so, well that's not obvious. Is there any way to confirm this hunch?

    0 讨论(0)
提交回复
热议问题