Possible way to scan .ts files using SonarJS plugin?

Hi All,

We have some .ts files, and we would like to use SonarJS plugin to scan them, could you help see if this is possible?

What we have tried so far, not successful:

  • added .ts via Genaral Settings->javascript -> file suffixes

but when scanning .ts files using SonarJS from scanner, it reports the errors below:

Language of file 'src/app.ts' can not be decided as the file matches patterns of both sonar.lang.patterns.js : **/*.js,**/*.jsx,**/*.vue,**/*.ts and sonar.lang.patterns.ts : **/*.ts,**/*.tsx

We tried both on Windows and Linux sonarqube server, all fail the same.

We do not want to use SonarTS, as we’d like to use an existing custom sonarJS plugin

Could you kindly help?

Thank you!

Update: I got the reason why this error happens, and after removing the SonarTS plugin, I see sonarJS picks up the .ts file now. but please also help with parse erros, looks like there are some files fail with parse error like:

07:34:19 [main] ERROR o.s.p.j.JavaScriptSensor - Parse error at line 24 column 13:
23: // Export Global Used Data


I’m glad you got analysis working! Could you start a new thread for the parsing issue?


Sure, thanks and I will open a new thread.